-
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
Add runtime metrics worker #988
Conversation
|
||
self.enabled = options.fetch( | ||
:enabled, | ||
Datadog::Environment.env_to_bool(Ext::Runtime::Metrics::ENV_ENABLED, false) |
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.
Eventually want this to be driven by the configuration settings entirely (by passing it in via options) and remove the reference to the environment variable. This is a short-term behavior while we re-work configuration settings a bit.
@metrics = options.fetch(:metrics, Runtime::Metrics.new) | ||
|
||
# Workers::Async::Thread settings | ||
self.fork_policy = options.fetch(:fork_policy, Workers::Async::Thread::FORK_POLICY_STOP) |
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 don't want forks to collect runtime metrics by default; this policy prevents the runtime metrics worker from restarting and collecting metrics.
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.
💯!
Extracted from #879
This pull request introduces the
Datadog::Workers::RuntimeMetrics
worker, which is responsible for collecting and submitting runtime metrics via Statsd. The pull request effectively extracts this runtime metrics behavior from theAsyncTransport
which runtime metrics had previously hitchhiked on; it now separates it into its own thread and component, by using the same base as theAsyncTraceWriter
.It is the complement to
AsyncTraceWriter
in the respect that the combination of the two replace the responsibilities ofDatadog::Writer
; we will use this component when we also transition to the newTraceWriter
by default.