-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modify subscriber Message to contain OpenTelemetryData
* Add the subscribe span to OpenTelemetryData
- Loading branch information
1 parent
81a96b4
commit 9c0ac12
Showing
10 changed files
with
481 additions
and
34 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
google/cloud/pubsub_v1/opentelemetry/subscribe_spans_data.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from dataclasses import dataclass | ||
from typing import Optional | ||
|
||
from opentelemetry.trace.span import Span | ||
|
||
|
||
@dataclass | ||
class OpenTelemetryData: | ||
""" | ||
This class is for internal use by the library only. | ||
Contains Open Telmetry data associated with a | ||
google.cloud.pubsub_v1.subscriber.message.Message. Specifically it contains | ||
the subscriber side spans associated with the message. | ||
This is so that the subsriber side spans can be ended by the library | ||
after receiving the message back via an ack(), ack_with_response(), nack(). | ||
""" | ||
|
||
subscribe_span: Optional[Span] = None | ||
concurrrency_control_span: Optional[Span] = None | ||
scheduler_span: Optional[Span] = None | ||
process_span: Optional[Span] = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.