-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Eventhub tracing #7153
Eventhub tracing #7153
Conversation
(message created by the CI based on PR content) Installation instructionPackage azure-eventhubsYou can install the package You can build a wheel to distribute for test using the following command: If you have a local clone of this repository, you can also do:
Or build a wheel file to distribute for testing:
Package azure-eventhubs-checkpointstoreblob-aioYou can install the package You can build a wheel to distribute for test using the following command: If you have a local clone of this repository, you can also do:
Or build a wheel file to distribute for testing:
Direct downloadYour files can be directly downloaded here: |
2fa2f3e
to
b1a4ae9
Compare
710ecbf
to
6a51f46
Compare
sdk/eventhub/azure-eventhubs/azure/eventhub/aio/consumer_async.py
Outdated
Show resolved
Hide resolved
sdk/eventhub/azure-eventhubs/azure/eventhub/aio/eventprocessor/event_processor.py
Outdated
Show resolved
Hide resolved
sdk/eventhub/azure-eventhubs/azure/eventhub/aio/producer_async.py
Outdated
Show resolved
Hide resolved
sdk/eventhub/azure-eventhubs/azure/eventhub/aio/producer_async.py
Outdated
Show resolved
Hide resolved
sdk/eventhub/azure-eventhubs/azure/eventhub/aio/eventprocessor/event_processor.py
Outdated
Show resolved
Hide resolved
fde07a4
to
3ced2ce
Compare
message_span = child.span(name="Azure.EventHubs.message") | ||
message_span.start() | ||
app_prop = dict(message.application_properties) | ||
app_prop.setdefault(b"Diagnostic-Id", message_span.get_trace_parent().encode('ascii')) |
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.
what if message was already instrumented (in previous send try or by user)?
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.
setdefault will not owerwrite the item if it is already set. We could avoid the cost of encoding by doing an in
check, however.
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.
I don't expect this encode to take a lot, since the string is 0-9A-Z and the encoder is ascii. That will let mostly cast it "as-is" under the hood.
With the in
, in case we do need to assign it, we will do another lookup to find the right spot. Without the in
, we indeed ascii-encode for nothing sometimes, but if we need to insert we know already where it is.
6e0e7ca
to
dedae18
Compare
dedae18
to
57dddb5
Compare
22ec850
to
78b78ab
Compare
… error message, but this will fix the analyze error
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.
EventHubConsumer of both sync and aio has next / anext. They should also be tracked? Users can receive evetns by:
for event in consumer: # sync EventHubConsumer
pass # do something
or
async for event in consumer: # async EventHubConsumer
pass # do something
@YijunXieMS it has been decided in arch meeting that "receive" should not be traced. |
/azp run python - eventhubs - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
self._client._add_span_request_attributes(child) # pylint: disable=protected-access | ||
self._send_event_data_with_retry(timeout=timeout) | ||
else: | ||
self._send_event_data_with_retry(timeout=timeout) |
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.
both if and else has this statement. How about removing the else block and pull the same statement in "if" out of "if"?
/azp run python - eventhubs - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
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
…into base_to_properties * 'master' of https://github.com/Azure/azure-sdk-for-python: Eventhub tracing (Azure#7153) [devtools-cognitiveservices] temp fix to allow passing cog key in headers for azure-core (Azure#7471) adds back create mgmt client (Azure#7470) Update SDK Tools Consumption (Azure#7148) [AutoPR] peering/resource-manager (Azure#6923) Key Vault: making poller return Certificate or CertificateOperation (Azure#7349) Patch os.environ in Identity mock tests (Azure#7452) Unskip urllib3 related test (Azure#7442)
* Experimentation on tracing and EventHubs * Continue to let the initial excp raise * Naive direct tracing implementation * Update Kind in EventHub to generic one * Use contextmanager in EventHub * Remove opencensus specific import * Fix possible AttributeError * Remove parent concept * Remove receive tracing code * Don't execute tracing on message if no tracing loaded * Try to re-order dev dep for CI * Fix EH plugin dev deps * Add azure-core to azure-eventhub * Share req * ChangeLog * EH extension is ok with b4 * Install blob SDK for EH extension * pylint * fix dev req * dep fix * the override had <. the setup actually defines <=. need to update the error message, but this will fix the analyze error * Tracing message from receive iterators as well * Producer simplification * Simplify eventprocessor * Consider batch size
EventHub part of #6597