-
Notifications
You must be signed in to change notification settings - Fork 126
Add Rule Engine to the StartupHook #2405
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 Rule Engine to the StartupHook #2405
Conversation
Kielek
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.
In general looks good.
It will be great to have at least scaffolding/smoke tests in this PR but I will not block this.
src/OpenTelemetry.AutoInstrumentation.StartupHook/RulesEngine/Rule.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.AutoInstrumentation.StartupHook/RulesEngine/RuleEngine.cs
Outdated
Show resolved
Hide resolved
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.
Seems good. +1 to the thing that @Kielek mentioned.
Not applying to this PR but DS rule and Instrumentation assembly rule should have integration tests to be sure that these execute properly and application is not crashing before.
Turn off flag is also needed (I think in a new PR), so who has staging environment can optimize loading speed in production.
|
src/OpenTelemetry.AutoInstrumentation.StartupHook/StartupHook.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.AutoInstrumentation.StartupHook/RulesEngine/Rule.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.AutoInstrumentation.StartupHook/RulesEngine/Rule.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.AutoInstrumentation.StartupHook/RulesEngine/OpenTelemetrySdkRule.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.AutoInstrumentation.StartupHook/RulesEngine/OpenTelemetrySdkRule.cs
Show resolved
Hide resolved
|
I want to keep this PR simple. Adding the tests makes it complex. My next PRs will address the test gaps for the RuleEngine. |
|
Merging it @rajkumar-rangaraj ... |
Why
Fixes #2392
What
This PR adds a rule engine to the StartupHook. The rule engine is designed to validate all OpenTelemetry assemblies and ensures that it backs off in unsupported scenarios instead of crashing. It validates all the rules and logs error to logger.
Implemented one of the rule, want to follow up other rules in a follow up PR. Verified with manual test, it works as expected. CI results should confirm that it does not change behavior.
Follow-up items
Tests
Checklist
[ ]CHANGELOG.mdis updated.[ ] Documentation is updated.[ ] New features are covered by tests.