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
Report Puma metrics to Datadog #4618
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4618 +/- ##
=======================================
Coverage 97.11% 97.11%
=======================================
Files 393 393
Lines 8324 8324
=======================================
Hits 8084 8084
Misses 240 240 ☔ View full report in Codecov by Sentry. |
@@ -42,6 +42,9 @@ | |||
# Specifies the `pidfile` that Puma will use. | |||
pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" } | |||
|
|||
# Optionally enable the Puma Control/Metrics API | |||
activate_control_app "tcp://127.0.0.1:9293", { auth_token: ENV.fetch("PUMA_CONTROL_AUTH_TOKEN") } if ENV["PUMA_CONTROL_ENABLED"].present? |
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.
Two questions.
- Are 2 variables needed? Isn't it possible to enable when token is present?
- Is token even needed? Is the Metrics API exposed to the public?
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.
Are 2 variables needed? Isn't it possible to enable when token is present?
I need to coordinate the release of this for testing and ensuring the integration between Datadog and puma is reliable. Seeing we do not having branch environments, I can only do this with feature flags/environment variables for to enable for staging and production.
Maybe after this PR has been merged we can reduce the flags down into something simpler.
Is token even needed? Is the Metrics API exposed to the public?
The control server also lets you shutdown, restart and manage other process related actions for puma. The port will be exposed within Kubernetes, so i want to ensure the endpoint is well protected from any potential threats.
… configuration to include puma integration
cc46872
to
c1df514
Compare
This PR opens up the Puma control/metrics server to expose numerous puma metrics such as num of backlogged requests, active workers, threads, etc for Datadog to collect that allows us to report and monitor.