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

feat(metrics): Improve code location reporting #2552

Merged
merged 5 commits into from Dec 1, 2023

Conversation

mitsuhiko
Copy link
Member

This corrects the reporting for context managers using timing. It does not address the code locations for @timing which are currently pointing to the call site instead of the function itself. That's tricker to fix because by the time we take the measurement the stack is unwound and before the measurement the function is not yet invoked. We could work around this, but it's pretty ugly and does not really fit into how that system works at the moment.

Fixes #2550

@mitsuhiko mitsuhiko marked this pull request as ready for review November 30, 2023 22:45
@mitsuhiko mitsuhiko merged commit 916ed04 into master Dec 1, 2023
1 check passed
@mitsuhiko mitsuhiko deleted the feature/fix-context-manager-location branch December 1, 2023 10:48
)

@metrics_noop
def need_code_loation(
Copy link

Choose a reason for hiding this comment

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

There is a little typo: ..._location

Copy link
Member

Choose a reason for hiding this comment

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

I opened a PR to fix this here #2783.

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.

Incorrect metric meta location for metrics.timing
4 participants