Repository navigation
Export OpenTelemetry spans for rejected updates and failed queries - #2057
Open
parbhatkapila4 wants to merge 1 commit into
Open
parbhatkapila4 wants to merge 1 commit into
parbhatkapila4 wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was changed
_ReplaySafeSpan.end()skips ending an in-workflow span that recorded an exception that isn't a workflow failure exception. That avoids a duplicate span on every retried workflow task. But exceptions from update validators and query handlers never fail the workflow task: they only reject the update or fail the query. So withOpenTelemetryPlugin(add_temporal_spans=True), the worker-sideValidateUpdatespan of a rejected update and theHandleQueryspan of a failed query were never ended or exported. The client spans showed up with no worker child.Queries and update validators run in read-only mode, so the skip now only applies when
workflow.unsafe.is_read_only()is false.How was this tested
Added
test_otel_tracing_rejected_update_and_failed_queryto test_opentelemetry_plugin.py. It sends an update the validator rejects, a query that raises, and a valid update, then checks the span hierarchy and that the two failed spans have ERROR status. On main, theValidateUpdatespan of the rejected update and theHandleQueryspan are missing. With the fix, the test passes, and the rest of tests/contrib/opentelemetry passes the same as on main.