-
Notifications
You must be signed in to change notification settings - Fork 646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor metric format #2658
Refactor metric format #2658
Conversation
opentelemetry-sdk/src/opentelemetry/sdk/_metrics/_internal/metric_reader.py
Outdated
Show resolved
Hide resolved
opentelemetry-sdk/src/opentelemetry/sdk/_metrics/_internal/metric_reader.py
Outdated
Show resolved
Hide resolved
...rter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/_metric_exporter/__init__.py
Outdated
Show resolved
Hide resolved
opentelemetry-sdk/src/opentelemetry/sdk/_metrics/_internal/export/__init__.py
Outdated
Show resolved
Hide resolved
opentelemetry-sdk/src/opentelemetry/sdk/_metrics/_internal/metric_reader.py
Outdated
Show resolved
Hide resolved
...rter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/_metric_exporter/__init__.py
Outdated
Show resolved
Hide resolved
7c5b6da
to
fe55d5c
Compare
opentelemetry-sdk/src/opentelemetry/sdk/_metrics/_internal/metric_reader.py
Outdated
Show resolved
Hide resolved
bfebe11
to
0520bf4
Compare
95edbcd
to
422e1c5
Compare
...rter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/_metric_exporter/__init__.py
Outdated
Show resolved
Hide resolved
...rter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/_metric_exporter/__init__.py
Outdated
Show resolved
Hide resolved
exporter/opentelemetry-exporter-otlp-proto-grpc/tests/metrics/test_otlp_metrics_exporter.py
Show resolved
Hide resolved
exporter/opentelemetry-exporter-prometheus/src/opentelemetry/exporter/prometheus/__init__.py
Outdated
Show resolved
Hide resolved
exporter/opentelemetry-exporter-prometheus/src/opentelemetry/exporter/prometheus/__init__.py
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just one question about logic change in point by label set
opentelemetry-sdk/src/opentelemetry/sdk/_metrics/_internal/_view_instrument_match.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, this was a big effort! 🙂
I think I found a few bugs, but sorry for all the comments.
...rter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/_metric_exporter/__init__.py
Outdated
Show resolved
Hide resolved
...rter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/_metric_exporter/__init__.py
Outdated
Show resolved
Hide resolved
...rter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/_metric_exporter/__init__.py
Outdated
Show resolved
Hide resolved
...rter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/_metric_exporter/__init__.py
Outdated
Show resolved
Hide resolved
...rter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/_metric_exporter/__init__.py
Outdated
Show resolved
Hide resolved
opentelemetry-sdk/src/opentelemetry/sdk/_metrics/_internal/aggregation.py
Outdated
Show resolved
Hide resolved
opentelemetry-sdk/src/opentelemetry/sdk/_metrics/_internal/aggregation.py
Show resolved
Hide resolved
opentelemetry-sdk/src/opentelemetry/sdk/_metrics/_internal/aggregation.py
Show resolved
Hide resolved
opentelemetry-sdk/src/opentelemetry/sdk/_metrics/_internal/metric_reader_storage.py
Show resolved
Hide resolved
opentelemetry-sdk/src/opentelemetry/sdk/_metrics/_internal/metric_reader_storage.py
Show resolved
Hide resolved
…xporter/prometheus/__init__.py Co-authored-by: Aaron Abbott <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fixes #2646
This PR has been refactored completely to address this comment.
Since this is a big PR, here is some information to help review:
This PR basically unflattens this
Metric
object to make it match the OTLPMetric
object, and it is implemented here.This means, our
Metric
object now contains aSum
,Histogram
orGauge
object and those objects now contain a series ofNumberDataPoint
orHistogramDataPoint
objects as defined by the proto.This changes many things but it is pretty much just a rearranging of data. The only "significant" change is that it was necessary to remove
_convert_aggregation_temporality
, this conversion has been split and moved into each aggregationcollect
method. I find it better since we now don't have all theif
s that did something different depending on the point type but instead that specific code is moved into each aggregation that matches the corresponding point type.