-
Notifications
You must be signed in to change notification settings - Fork 464
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
Metrics - Instrument Name Validation fixes #2166
Metrics - Instrument Name Validation fixes #2166
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2166 +/- ##
=======================================
- Coverage 79.2% 79.0% -0.2%
=======================================
Files 121 121
Lines 20980 20859 -121
=======================================
- Hits 16625 16490 -135
- Misses 4355 4369 +14 ☔ View full report in Codecov by Sentry. |
The biggest learning from this PR is that - I made plenty of silly copy-paste errors, but all of them were nicely caught by the InMemoryExporter based E2E tests. Though we still have opportunities to further improve test coverage, this is already yielding results and hopefully, continue to do so, as we are about to start the next set of major refactor, in the collect/export pipelein! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall! Left some comments about removing unnecessary code and increasing test coverage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Related to #1699
This does not change the name of the APIs or remove any. That'll be coming next.
This PR ensures that NoOpInstruments are returned incase of any instrument configuration errors, instead of promised Panic (which was not implemented anyway).
Removed test only setting of Erroring for validation.
Also does some refactoring to get some code reuse (plenty of remaining opportunities here, just did a minimal one in this PR)
Added unit tests for validations, and also e2e (inmemoryexporter based) to ensure instruments are no-op. (This actually fixed the existing bug that current SDK allowed invalid instrument names to still operate).
In next set of PRs, will proceed with removing try_init, renaming init to build, and better handling of edge cases, along with further refactoring to move common code to helpers.!
Changelog will be added before release covering full changes as part of #1699