-
Notifications
You must be signed in to change notification settings - Fork 5.1k
extensions: add OpenTelemetry tracer extension for exporting OTLP traces #20281
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
extensions: add OpenTelemetry tracer extension for exporting OTLP traces #20281
Conversation
Signed-off-by: Alex Ellis <alexellis@google.com>
Signed-off-by: Alex Ellis <alexellis@google.com>
Signed-off-by: Alex Ellis <alexellis@google.com>
Signed-off-by: Alex Ellis <alexellis@google.com>
Signed-off-by: Alex Ellis <alexellis@google.com>
Signed-off-by: Alex Ellis <alexellis@google.com>
Signed-off-by: Alex Ellis <alexellis@google.com>
Signed-off-by: Alex Ellis <alexellis@google.com>
Signed-off-by: Alex Ellis <alexellis@google.com>
Signed-off-by: Alex Ellis <alexellis@google.com>
Signed-off-by: Alex Ellis <alexellis@google.com>
Signed-off-by: Alex Ellis <alexellis@google.com>
Signed-off-by: Alex Ellis <alexellis@google.com>
Signed-off-by: Alex Ellis <alexellis@google.com>
Signed-off-by: Alex Ellis <alexellis@google.com>
Signed-off-by: Alex Ellis <alexellis@google.com>
Hi @AlexanderEllis, welcome and thank you for your contribution. We will try to review your Pull Request as quickly as possible. In the meantime, please take a look at the contribution guidelines if you have not done so already. |
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to |
Fantastic to see this! As part of this change can you update to the latest version of OpenTelemetry. We are currently on version https://github.com/envoyproxy/envoy/blob/main/api/bazel/repository_locations.bzl#L99-L109 |
Signed-off-by: Alex Ellis <alexellis@google.com>
Signed-off-by: Alex Ellis <alexellis@google.com>
Signed-off-by: Alex Ellis <alexellis@google.com>
Signed-off-by: Alex Ellis <alexellis@google.com>
Signed-off-by: Alex Ellis <alexellis@google.com>
Signed-off-by: Alex Ellis <ellisonjtk@gmail.com>
/retest |
Retrying Azure Pipelines: |
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.
Hurray!
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, thanks so much @AlexanderEllis for staying the journey
landing cos i was asked, and im drunk enuf 8/
cc @moderation
🎉 Thank you @AlexanderEllis for the persistence and thank you community for helping this push thru. Much appreciated |
eek @AlexanderEllis looks like i broke unknown file: Failure
C++ exception with description "Protobuf message (type opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest reason INVALID_ARGUMENT:(resource_logs.instrumentation_library_logs[0]) logs: Cannot find field.) has unknown fields" thrown in the test body.
test/extensions/access_loggers/open_telemetry/grpc_access_log_impl_test.cc:51: Failure
Actual function call count doesn't match EXPECT_CALL(*async_client, startRaw(_, _, _, _))...
Expected: to be called once
Actual: never called - unsatisfied and active
i guess some change in config |
…OTLP traces (envoyproxy#20281)" This reverts commit f7a8db0. Signed-off-by: Ryan Northey <ryan@synca.io>
Ah thanks for calling that out @phlax . I see there's a PR to revert already, which SGTM. As I mentioned there, I believe I have a quick forward fix in #21842 if that's easier — looks like it was a new test (as fresh as this morning, heh) with a field name that the updated OTel library had changed (and I had updated the other tests in this PR). Also happy to wait and revert the revert if you want too 👍 |
ill let you and @ggreenway figure it out - defo preferable to fix forward imho - opened the revert as landing broke |
@AlexanderEllis fantastic to see this land. I've been doing some testing sending from a bunch of Envoy's to Uptrace. On the OpenTelemetry Collector I have debug logging installed and it doesn't look like the traces are carrying any information. Similarly on the Uptrace side the spans are empty.
In contrast my old Lightstep setup carried a bunch of info Any idea on what is happening? Am I missing a config? |
Nothing wrong on your end! I'll be following this up with a few more PRs to flesh out the tracer, one of which will be the attribute setting correctly in the span (stubbed out span.setTag for now, but adding that should allow these attributes to be set correctly in http_tracer_impl.cc). I'll also add an example setup with the collector and a few docs as well. Should hopefully be smooth(er) sailing now that the main PR is merged :) Edit: for posterity and a PSA, I fleshed out a few of the TODOs in #9958 (comment) |
…ces (envoyproxy#20281) Signed-off-by: Alex Ellis <ellisonjtk@gmail.com> Signed-off-by: Amila Senadheera <amila.15@cse.mrt.ac.lk>
https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/trace/v3/opentelemetry.proto mentions the following
Are there any tangible steps to get this extension ready for production use? Is it a matter of adhering to Envoy's extension guidelines, or does it also involve changes to the OpenTelemetry libraries? |
@itamarkam @yanavlasov can you address #20281 (comment)? Thanks. |
// Create an Tracers::OpenTelemetry::Span class that will contain the OTel span. | ||
Span new_span = Span(config, operation_name, start_time, time_source_, *this); | ||
new_span.setSampled(tracing_decision.traced); | ||
uint64_t trace_id_high = random_.random(); |
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.
Is it possible to make it "less random"? i.e.
hex timestamp (32b) + hex ms (16b) + hex instance's IP (32b) + some internal counter?
@AlexanderEllis Any thoughts here? |
Commit Message: Add OpenTelemetry Tracer Extension for exporting OTLP traces
Additional Description: This adds a new OpenTelemetry Tracer that exports OTLP traces via Envoy's async gRPC mechanism. It includes
traceparent
header parsing, buffering, and basic stats.Risk Level: Medium (new extension that is not enabled)
Testing: Added unit tests for the new tracer and performed manual testing with the OpenTelemetry Collector
Docs Changes: TODO
Release Notes: opentelemetry: add OpenTelemetry tracer extension
Platform Specific Features: N/A
Part of #9958
Possible fix for #20641