-
Notifications
You must be signed in to change notification settings - Fork 125
Add DiagnosticSource version check rule #2411
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
Add DiagnosticSource version check rule #2411
Conversation
src/OpenTelemetry.AutoInstrumentation.StartupHook/RulesEngine/DiagnosticSourceRule.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.AutoInstrumentation.StartupHook/RulesEngine/DiagnosticSourceRule.cs
Outdated
Show resolved
Hide resolved
…omAttribute<AssemblyFileVersionAttribute>()`
This reverts commit 95691ff.
|
Removed unit tests. It's probably better to test in integration tests, because most of the logic are checking the environment (the Type.GetType() call and version check of DiagnosticSource that's in For example, checking the DiagnosticSource version of the auto instrumentation library depends on checking |
src/OpenTelemetry.AutoInstrumentation.StartupHook/RulesEngine/DiagnosticSourceRule.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.AutoInstrumentation.StartupHook/RulesEngine/DiagnosticSourceRule.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.AutoInstrumentation.StartupHook/RulesEngine/DiagnosticSourceRule.cs
Show resolved
Hide resolved
pjanotti
left a comment
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.
Minor suggestions, but, otherwise LGTM. There should be a follow-up to get the version wanted by auto-instrumentation at build time or from the json created in a separate PR by Raj.
Why
Follow up of #2405 for DS rule
For issue #2392
What
This PR adds a version check rule for System.Diagnostics.DiagnosticSource. It will back off the auto instrumentation in case a
System.Diagnostics.DiagnosticSourceis included that can cause the auto instrumentation to crash.Automated tests are to be added as follow up.
Tests
Unit tests
Checklist
[ ]CHANGELOG.mdis updated.[ ] Documentation is updated.