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

fix: setting path pattern in opentelemetry traces #878

Merged

Conversation

CompuIves
Copy link
Contributor

In the OpenTelemetry Tracing middleware, the path pattern is not set as an attribute. I think that's because the PathPattern is initialized when the request is "called". Similar to this PR, I have moved the setting of the attribute to after the request is called.

As a second change (which might be considered breaking), I am renaming the span to :method :pattern instead of :method :uri. This is recommended by OpenTelemetry: https://opentelemetry.io/docs/specs/otel/trace/api/#span.

@CompuIves CompuIves force-pushed the feat/path-pattern-opentelemetry branch from 963f0b5 to 13dff7f Compare September 5, 2024 17:14
@sunli829 sunli829 merged commit 5f09df2 into poem-web:master Sep 8, 2024
1 check passed
@sunli829
Copy link
Collaborator

sunli829 commented Sep 8, 2024

thanks 🙂

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