-
Notifications
You must be signed in to change notification settings - Fork 375
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
Extract runtime metrics worker from Writer #1004
Conversation
logger = settings.logger.instance || Datadog::Logger.new(STDOUT) | ||
logger.level = settings.diagnostics.debug ? ::Logger::DEBUG : settings.logger.level | ||
def build_runtime_metrics_worker(settings) | ||
# NOTE: Should we just ignore building the worker if its not enabled? |
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.
For the time being, because we still allow dynamic reconfiguration, I think always initializing it is ok.
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.
Okay, I'll remove this for now... we'll consider optimizations like this later.
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.
I think the comment is actually helpful for future work towards true immutable components: it guides us to where we need to make changes.
I think we should keep it.
I think I saw the comment as a "request for comment" and I was just chiming in on what I think about it.
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.
Yeah, that is kind of the spirit of writing it, so this is good.
d4178f8
to
10592ce
Compare
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 a continuation of the shift towards immutable components, this pull request extracts the runtime metrics worker out of the writer. Previously this has been nested in
tracer.writer.runtime_metrics
, and has piggybacked on the writer's thread to do runtime metrics work.To do this:
Datadog::Writer
.runtime_metrics
is introduced as an attribute ofComponents
, which is aDatadog::Workers::RuntimeMetrics
.