-
Notifications
You must be signed in to change notification settings - Fork 15
feat: support DD_TRACE_ENABLED dynamic configuration #96
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
Conversation
dgoffredo
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.
This technique looks good. I like how it's consistent with previous use of ConfigManager.
There is the question, that you asked internally, of whether already-started traces should be allowed to be sent. A design where the answer is "no" might be better from a user perspective, but the implementation would be less elegant.
Please fix the test failure showing in CI, and also please add tests for the new behavior.
061e775 to
139446f
Compare
src/datadog/config_manager.h
Outdated
| // Return the `SpanDefaults` consistent with the most recent configuration. | ||
| std::shared_ptr<const SpanDefaults> get_span_defaults(); | ||
|
|
||
| bool get_report_traces(); |
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.
- document (and rename?)
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.
We could follow the lead of TracerConfig and omit the get_ prefix. It's fine either way.
Yes, please do add a comment here. Maybe:
// Return whether spans should be sent to the collector.
I don't like the use of the word "should." Something like that, anyway.
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.
TODO:
- write test
-
remove(could be useful)null_collector.*
BenchmarksBenchmark execution time: 2024-02-01 11:04:05 Comparing candidate commit 8ad3bd3 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 1 metrics, 0 unstable metrics. |
dgoffredo
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.
![]()
src/datadog/config_manager.h
Outdated
| // Return the `SpanDefaults` consistent with the most recent configuration. | ||
| std::shared_ptr<const SpanDefaults> get_span_defaults(); | ||
|
|
||
| bool get_report_traces(); |
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.
We could follow the lead of TracerConfig and omit the get_ prefix. It's fine either way.
Yes, please do add a comment here. Maybe:
// Return whether spans should be sent to the collector.
I don't like the use of the word "should." Something like that, anyway.
| if (tracing_enabled_it->is_boolean()) { | ||
| config_update.report_traces = tracing_enabled_it->get<bool>(); | ||
| } else { | ||
| // TODO: report to telemetry |
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.
coming soon...
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.

No description provided.