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

Report error locus within instrumented code #170

Merged
merged 6 commits into from
Jan 10, 2024
Merged

Report error locus within instrumented code #170

merged 6 commits into from
Jan 10, 2024

Conversation

gagbo
Copy link
Member

@gagbo gagbo commented Jan 4, 2024

This fixes a small regression introduced when fixing instrumentation of async_trait code.

  • Add failing locus test
  • Let rust parse impl automatically

Checklist

  • Changelog updated

Letting Rust parse the impl block allows us to keep the same TokenStream as input in the autometrics macro code, even when async_trait is involved.

Keeping the original TokenStream keeps the Span information in method/function bodies so error reporting in instrumented code is not absorbed in "#[autometrics]" span.

This also simplifies the parsing code a little bit.
@gagbo
Copy link
Member Author

gagbo commented Jan 4, 2024

So apparently it makes exemplars disappear :( (it was a precedence issue)

Copy link
Member

@mellowagain mellowagain left a comment

Choose a reason for hiding this comment

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

looks good! we should release a new release after this is merged and the other issue with the otel exporter http client is fixed

autometrics/tests/error_locus.rs Outdated Show resolved Hide resolved
autometrics/tests/exemplars_test.rs Outdated Show resolved Hide resolved
Gather all trybuild tests

Remove extra println used in failing tests
@gagbo gagbo merged commit bbba7c1 into main Jan 10, 2024
1 check passed
@gagbo gagbo deleted the report_error_locus branch January 10, 2024 08:30
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