OpenTelemetry integration misses the point: we need to propagate the span/context!
See original GitHub issueThe code where the Subscriber reads the span from the attributes just creates the span and then throws it away: https://github.com/googleapis/nodejs-pubsub/blob/99107930bbed8e29834acb2347f65efc6a39958f/src/subscriber.ts#L517-L527
A good OpenTelemetry customer would then set the span to the current span in the on("message")
handler, so that any subsequent processing is attached to the remote span.
I’ll also file a Google support case.
Environment details
@google-cloud/pubsub
version: master / v2.17.0
Steps to reproduce
- Enable OpenTelemetry in both publisher and subscriber using
{ enableOpenTelemetryTracing: true }
options on topic and subscription. - Perform some processing that creates spans, either manually or (for example) do a Datastore Query or Put.
It can be observed that actions are linked to the subscriber span, as can also be seen in this screenshot (spans take <1ms because nothing is done inside):
Relates to #1078.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:5
- Comments:18 (6 by maintainers)
Top Results From Across the Web
open-telemetry/opentelemetry-java - Gitter
I 'm wondering whether io.opentelemetry.sdk.trace.export.SimpleSpansProcessor.Config.Builder#build needs to be declared public . Without it, there's no way to ...
Read more >Traces | OpenTelemetry
It serializes or deserializes Span Context and provides the relevant Trace information to be propagated from one service to another. We now have...
Read more >Distributed Tracing for Kafka with OpenTelemetry | New Relic
Ideally, you should be using distributed tracing to trace requests through ... a month or approximately nine million data points per second.
Read more >OpenTelemetry: beyond getting started | by Sergey Kanzhelev
For this to work, you need integrations with every language, web framework, RPC system, ... OpenTelemetry has a lot of extensibility points.
Read more >Enable Azure Monitor OpenTelemetry for .NET, Node.js, and ...
If you have two or more services that emit telemetry to the same Application Insights resource, you're required to set Cloud Role Names...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sorry for the radio silence on this topic, but it’s still a major objective for us. None of this is official until it’s official (please don’t take it as an announcement/promise), but the current thought is that we’re planning to shift it to use the more standard mechanism (w3c headers), and to get it piped all the way through. A preview of the Go version produces a really nice graph in Cloud Trace, showing the time spent in each phase of the library (batching, ack leasing, etc). There isn’t currently anything that will be traced in the server, but the end to end trace should at least allow you to see how long it spends in the server before being sent out.
Mentioned in the PR, but mentioning here too: there’s a suuuuper early preview branch now if anyone wants to play around with what’s done. I don’t recommend using it in any kind of production scenario or assuming any of the interfaces or trace formats are final.
That PR is here: https://github.com/googleapis/nodejs-pubsub/pull/1659
And the branch in googleapis that anyone can make PRs against if you want: https://github.com/googleapis/nodejs-pubsub/tree/otel-2
I’ll be out for a bit but plan to pick it up again in early 2023.