-
Notifications
You must be signed in to change notification settings - Fork 232
Closed
Labels
api: pubsubIssues related to the googleapis/nodejs-pubsub API.Issues related to the googleapis/nodejs-pubsub API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.
Description
The code where the Subscriber reads the span from the attributes just creates the span and then throws it away:
nodejs-pubsub/src/subscriber.ts
Lines 517 to 527 in 9910793
const span: Span | undefined = this._constructSpan(message); | |
if (this.isOpen) { | |
message.modAck(this.ackDeadline); | |
this._inventory.add(message); | |
} else { | |
message.nack(); | |
} | |
if (span) { | |
span.end(); | |
} |
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.
aabmass, mmizutani, naseemkullah, jlblumberg, davedc and 3 more
Metadata
Metadata
Assignees
Labels
api: pubsubIssues related to the googleapis/nodejs-pubsub API.Issues related to the googleapis/nodejs-pubsub API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.