open-telemetry / opentelemetry-cpp

The OpenTelemetry C++ Client
https://opentelemetry.io/
Apache License 2.0
844 stars 404 forks source link

[Metrics SDK] - Supporting changing Aggregation type using Views #1664

Closed lalitb closed 1 year ago

lalitb commented 1 year ago

As of now, implementation supports default aggregation for each instrument as defined here - https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#default-aggregation

As per the specs, it should be possible to customize the aggregation through views - https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#view :

Customize the aggregation - if the default aggregation associated with the Instrument does not meet the needs of the user. For example, an HTTP client library might expose HTTP client request duration as [Histogram](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/api.md#histogram) by default, but the application developer might only want the total count of outgoing requests.

This support needs to be added to the implementation.

lalitb commented 1 year ago

Moved this post-GA milestone as of now, unless there are multiple asks to support earlier.

github-actions[bot] commented 1 year ago

This issue was marked as stale due to lack of activity.

mprzybylski commented 1 year ago

Hi,

My work is currently impacted by this issue, and I think I can fix it and contribute that fix upstream. Before I dive in, I wanted to see if @lalitb , @esigo, or @ThomsonTan had any specific wishes on the way it should be done, or pointers aside from what's in https://github.com/open-telemetry/opentelemetry-cpp/blob/main/CONTRIBUTING.md

lalitb commented 1 year ago

@mprzybylski thanks for pitching in. I have some work done on this locally, and should be able to raise a PR out of it sometime first week of Jan.

mprzybylski commented 1 year ago

Thanks, @lalitb!

Please ping me when you raise that PR. I'd very much like to read it, and build upon it, if necessary.