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

fix(tracing): only set span.status=OK if UNSET - #1248

Merged
harshachinta merged 4 commits into
googleapis:mainfrom
odeke-em:trace-fix-trace_call-unconditionally-setting-span_status_OK
Dec 6, 2024
Merged

fix(tracing): only set span.status=OK if UNSET#1248
harshachinta merged 4 commits into
googleapis:mainfrom
odeke-em:trace-fix-trace_call-unconditionally-setting-span_status_OK

Conversation

@odeke-em

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

@odeke-em
odeke-em requested review from a teamDecember 3, 2024 09:42
@product-auto-labelproduct-auto-labelBot added the size: s Pull request size is small. label Dec 3, 2024
@product-auto-labelproduct-auto-labelBot added the api: spanner Issues related to the googleapis/python-spanner API. label Dec 3, 2024
Comment threadgoogle/cloud/spanner_v1/_opentelemetry_tracing.py
Comment threadtests/unit/test__opentelemetry_tracing.py
Comment threadtests/unit/test__opentelemetry_tracing.py
Comment threadgoogle/cloud/spanner_v1/_opentelemetry_tracing.py Outdated
@odeke-em
odeke-emforce-pushed the trace-fix-trace_call-unconditionally-setting-span_status_OK branch from d1018ac to f1d41eeCompareDecember 4, 2024 11:39
@harshachintaharshachinta added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 4, 2024
@harshachintaharshachinta added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Dec 4, 2024
@yoshi-kokoroyoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 4, 2024
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.
Fixesgoogleapis#1246
@odeke-em
odeke-emforce-pushed the trace-fix-trace_call-unconditionally-setting-span_status_OK branch from f1d41ee to 981fab5CompareDecember 5, 2024 06:35
@harshachintaharshachinta added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 5, 2024
@yoshi-kokoroyoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 5, 2024
@harshachintaharshachinta added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 5, 2024
@yoshi-kokoroyoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 5, 2024
@harshachintaharshachinta added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 5, 2024
@yoshi-kokoroyoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 5, 2024
@harshachintaharshachinta 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-kokoroyoshi-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:mainDec 6, 2024
@release-pleaserelease-pleaseBot mentioned this pull request Dec 6, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: spannerIssues related to the googleapis/python-spanner API.size: sPull request size is small.

Projects

None yet

4 participants

@odeke-em@harshachinta@aseering@yoshi-kokoro