-
Notifications
You must be signed in to change notification settings - Fork 828
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
OpenCensus to OpenTelemetry metric exporter #2085
Conversation
Just curious is there anything special about metrics that let's us handle it at the export layer instead of instrumentation layer like we did for traces? |
@anuraaga mainly that metrics don't have parent-child relationships, which was the main reason for not handling traces at the export layer. Label propagation hasn't been implemented in OpenTelemetry either (https:/open-telemetry/opentelemetry-specification/blob/master/specification/metrics/api.md#baggage-into-metric-labels) so it seems that it would be fine (and much easier) to export the metric data output rather than modifying the context. |
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.
Thanks
opencensus-shim/src/main/java/io/opentelemetry/opencensusshim/OpenTelemetryMetricsExporter.java
Outdated
Show resolved
Hide resolved
opencensus-shim/src/main/java/io/opentelemetry/opencensusshim/OpenTelemetryMetricsExporter.java
Outdated
Show resolved
Hide resolved
opencensus-shim/src/main/java/io/opentelemetry/opencensusshim/OpenTelemetryMetricsExporter.java
Outdated
Show resolved
Hide resolved
opencensus-shim/src/main/java/io/opentelemetry/opencensusshim/OpenTelemetryMetricsExporter.java
Outdated
Show resolved
Hide resolved
… into metric-migration # Conflicts: # build.gradle # opencensus-shim/src/test/java/io/opentelemetry/opencensusshim/TraceInteroperabilityTest.java
opencensus-shim/src/main/java/io/opentelemetry/opencensusshim/OpenTelemetryMetricsExporter.java
Outdated
Show resolved
Hide resolved
opencensus-shim/src/main/java/io/opentelemetry/opencensusshim/OpenTelemetryMetricsExporter.java
Outdated
Show resolved
Hide resolved
opencensus-shim/src/main/java/io/opentelemetry/opencensusshim/OpenTelemetryMetricsExporter.java
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.
LGTM
opencensus-shim/src/main/java/io/opentelemetry/opencensusshim/OpenTelemetryMetricsExporter.java
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.
Just one small refactoring needed; otherwise looks good to go.
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.
Thanks!
The OpenTelemetry merger announcement promised straightforward backwards compatibility with OpenCensus.
This PR adds an OpenCensus bridge for metrics, which allows applications and libraries that are instrumented with OpenTelemetry, but depend on other libraries instrumented with OpenCensus, to export metrics from both OpenTelemetry and OpenCensus.
The bridge maps all OpenCensus metric data to OpenTelemetry metric data, which are then exported by any configured OpenTelemetry exporter.
For OpenCensus spans to be exported as OpenTelemetry spans, this bridge needs to be added as a dependency. An extra line of configuration is also necessary in addition to configuring the OpenTelemetry exporter. For example
cc @nilebox @james-bebbington