Skip to content
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

wsgi: always set status code on spans #3148

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

GonzaloGuasch
Copy link
Contributor

@GonzaloGuasch GonzaloGuasch commented Dec 23, 2024

Description

The same bug reported here

The histograms records are set without status_code attribute due to the decision is based on the span is_recording method.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Local with this configuration:
    python = ">=3.9,<4"
    flask-restx = "1.3.0"
    flask = "^3.1.0"
    opentelemetry-instrumentation-flask = "^0.50b0"
    opentelemetry-api = "^1.29.0"
    opentelemetry-sdk = "^1.29.0"
    opentelemetry-instrumentation-wsgi = "^0.50b0"
    opentelemetry-semantic-conventions = "^0.50b0"

Does This PR Require a Core Repo Change?

  • No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

  • Followed the style guidelines of this project
  • Changelogs have been updated

@GonzaloGuasch GonzaloGuasch requested a review from a team as a code owner December 23, 2024 20:03
@xrmx xrmx changed the title remove span is_recording method wsgi: always set status code on spans Dec 24, 2024
@@ -19,7 +19,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#3111](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3111))
- `opentelemetry-instrumentation-falcon` add support version to v4
([#3086](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3086))

- `opentelemetry-instrumentation-wsgi` remove is_recording method to record status code in all metrics
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `opentelemetry-instrumentation-wsgi` remove is_recording method to record status code in all metrics
- `opentelemetry-instrumentation-wsgi` always record span status code to have it available in metrics

Copy link
Contributor

@xrmx xrmx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, would it be possible to write a test?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants