-
Notifications
You must be signed in to change notification settings - Fork 180
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
Add support for OpenTelemetry tracing #2796
Comments
The initial work for this has been started here. |
Some notes on how this should be handled:
|
Seems like OTEL supports overriding both:
This way we can likely make it backwards compatible with the current tracer. Let me try migrating existing code to it. |
2823: [All] OpenTracing to OpenTelemetry migration r=SaveTheRbtz a=SaveTheRbtz Issue: #2796 OpenTracing spec is deprecated: opentracing/specification#163. Switching to the supported OpenTelemetry implementation. Note that new tracing code would honor [OTEL env vars](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.12.0/specification/protocol/exporter.md) instead of JAEGER ones, e.g.: `JAEGER_ENDPOINT` -> `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT`, `OTEL_EXPORTER_OTLP_TRACES_INSECURE`, etc (cc: `@sjonpaulbrown` `@haroldsphinx)` New API is slightly slower and consumes more memory but does substantially less allocs (~ -50%): ``` name old time/op new time/op delta StartSpanFromParent-8 485ns ± 6% 639ns ± 1% +31.71% (p=0.000 n=10+9) StartTransactionSpan/cacheHit-8 993ns ± 4% 927ns ± 3% -6.69% (p=0.000 n=10+10) StartTransactionSpan/cacheMiss-8 2.24µs ± 1% 2.19µs ± 1% -2.42% (p=0.000 n=10+10) name old alloc/op new alloc/op delta StartSpanFromParent-8 577B ± 0% 864B ± 0% +49.74% (p=0.000 n=10+10) StartTransactionSpan/cacheHit-8 776B ± 1% 944B ± 0% +21.65% (p=0.000 n=10+8) StartTransactionSpan/cacheMiss-8 2.16kB ± 1% 2.39kB ± 0% +10.62% (p=0.000 n=10+10) name old allocs/op new allocs/op delta StartSpanFromParent-8 7.00 ± 0% 4.00 ± 0% -42.86% (p=0.000 n=10+10) StartTransactionSpan/cacheHit-8 10.3 ± 7% 6.0 ± 0% -41.75% (p=0.000 n=10+10) StartTransactionSpan/cacheMiss-8 35.3 ± 2% 18.0 ± 0% -49.01% (p=0.000 n=10+10) ``` An example of both extensive tracing and cadence tracing enabled: <img width="1459" alt="Screen Shot 2022-07-25 at 10 21 07 PM" src="https://user-images.githubusercontent.com/169976/180929610-edbfdc54-e604-401f-aea5-501af2f861b2.png"> - [x] test against localnet's Tempo instance. - [x] noop tracer. - [x] log tracer. - [x] merge cadence bits onflow/cadence#1824. - [x] merge onflow/flow-core-contracts#298. - [x] update cadence. Co-authored-by: Alexey Ivanov <rbtz@dapperlabs.com>
OpenTelemetry support has landed. To control new library, feel free to switch from old (NB! We use gRPC exporter by default, so you need to use gRPC-enabled collector on the other side.) Re-assigning back to @sjonpaulbrown for verification. (cc: @haroldsphinx) |
Problem Definition
We would like to add support for tracing with OpenTelemetry. Currently, we support tracing with Open Tracer, but we would like to support OpenTelemetry so that we can integrate into our standard model for distributed tracing.
Proposed Solution
To add support for OpenTelemetry, we can add a new struct that implements the Tracer interface, and we need to add support for enabling tracing with OpenTelemetry.
Definition of Done
The text was updated successfully, but these errors were encountered: