GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(tracing): only set span.status=OK if UNSET by odeke-em · Pull Request #1248 · googleapis/python-spanner

This repository was archived by the owner on Jun 8, 2026. It is now read-only.

Conversation

@odeke-em

@odeke-em odeke-em commented Dec 3, 2024

Copy link
Copy Markdown
Contributor

In modernized OpenTelemetry-Python, if the SpanStatus was not already set to OK, it can be changed and
the code for trace_call was accidentally unconditionally setting the status to OK if there was no exception. This change fixes that and adds tests to lock this behavior in.

Fixes #1246

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@odeke-em
odeke-em requested review from a team December 3, 2024 09:42
@product-auto-label product-auto-label Bot added the size: s Pull request size is small. label Dec 3, 2024
@blunderbuss-gcf blunderbuss-gcf Bot assigned aseering Dec 3, 2024
@product-auto-label product-auto-label Bot added the api: spanner Issues related to the googleapis/python-spanner API. label Dec 3, 2024
harshachinta
harshachinta reviewed Dec 4, 2024
View reviewed changes
Comment thread google/cloud/spanner_v1/_opentelemetry_tracing.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

harshachinta
harshachinta reviewed Dec 4, 2024
View reviewed changes
Comment thread tests/unit/test__opentelemetry_tracing.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

harshachinta
harshachinta reviewed Dec 4, 2024
View reviewed changes
Comment thread tests/unit/test__opentelemetry_tracing.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

harshachinta
harshachinta reviewed Dec 4, 2024
View reviewed changes
Comment thread google/cloud/spanner_v1/_opentelemetry_tracing.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@odeke-em
odeke-em force-pushed the trace-fix-trace_call-unconditionally-setting-span_status_OK branch from d1018ac to f1d41ee Compare December 4, 2024 11:39
@odeke-em
odeke-em requested a review from harshachinta December 4, 2024 11:40
@harshachinta harshachinta added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 4, 2024
harshachinta
harshachinta approved these changes Dec 4, 2024
View reviewed changes
@harshachinta harshachinta added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Dec 4, 2024
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 4, 2024
@odeke-em
fix(tracing): only set span.status=OK if UNSET
981fab5
In modernized OpenTelemetry-Python, if the SpanStatus
was not already set to OK, it can be changed and
the code for trace_call was accidentally unconditionally
setting the status to OK if there was no exception.
This change fixes that and adds tests to lock this behavior in.

Fixes googleapis#1246
@odeke-em
odeke-em force-pushed the trace-fix-trace_call-unconditionally-setting-span_status_OK branch from f1d41ee to 981fab5 Compare December 5, 2024 06:35
@harshachinta harshachinta added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 5, 2024
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 5, 2024
@harshachinta
Merge branch 'main' into trace-fix-trace_call-unconditionally-setting…
3797716
…-span_status_OK
@harshachinta harshachinta added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 5, 2024
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 5, 2024
@harshachinta
Merge branch 'main' into trace-fix-trace_call-unconditionally-setting…
22fe386
…-span_status_OK
@harshachinta harshachinta added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 5, 2024
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 5, 2024
@harshachinta
Merge branch 'main' into trace-fix-trace_call-unconditionally-setting…
fb994ff
…-span_status_OK
@harshachinta harshachinta added kokoro:force-run Add this label to force Kokoro to re-run the tests. and removed do not merge Indicates a pull request not ready for merge, due to either quality or timing. labels Dec 6, 2024
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 6, 2024
@harshachinta
harshachinta enabled auto-merge (squash) December 6, 2024 06:09
@harshachinta
harshachinta merged commit 1d393fe into googleapis:main Dec 6, 2024
@release-please release-please Bot mentioned this pull request Dec 6, 2024
chore(main): release 3.52.0 #1258
Merged
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

1 more reviewer
@harshachinta harshachinta harshachinta approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@aseering aseering

Labels

api: spanner Issues related to the googleapis/python-spanner API. size: s Pull request size is small.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

tracing: spans are unconditionally set to a status of OK even after setting to ERROR after invoking with trace_call and that fails due to unconditional overriding because OpenTelemetry-Python can change the status after ERROR to OK

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@odeke-em @harshachinta @aseering @yoshi-kokoro
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.