-
Notifications
You must be signed in to change notification settings - Fork 14
Adds statsd configuration to pulp-api app #603
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
base: main
Are you sure you want to change the base?
Conversation
Reviewer's GuideThis PR configures StatsD metrics for the pulp-api service by extending the Clowd application manifest to support a new 'statsd' protocol and by enabling Gunicorn StatsD integration through additional command-line flags. Flow diagram for pulp-api startup with StatsD configurationflowchart TD
A[Start pulp-api container]
B[Read ClowdApp config with statsd protocol]
C[Start pulpcore-api with --statsd-host and --statsd-prefix]
D[Metrics sent to StatsD agent]
A --> B --> C --> D
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey @decko - I've reviewed your changes and they look great!
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `deploy/clowdapp.yaml:235` </location>
<code_context>
"kubectl.kubernetes.io/default-container": pulp-api
image: ${IMAGE}:${IMAGE_TAG}
- command: ['pulpcore-api', '-b', '0.0.0.0:8000', '--timeout', '90', '--workers', '${PULP_API_GUNICORN_WORKERS}', '--access-logfile', '-', '--access-logformat', '(pulp [%({correlation-id}o)s]: %(h)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s" %(M)s)']
+ command: ['pulpcore-api', '-b', '0.0.0.0:8000', '--timeout', '90', '--workers', '${PULP_API_GUNICORN_WORKERS}', '--statsd-host=localhost:8125', '--statsd-prefix=pulp-api.app', '--access-logfile', '-', '--access-logformat', '(pulp [%({correlation-id}o)s]: %(h)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s" %(M)s)']
volumeMounts:
- name: secret-volume
</code_context>
<issue_to_address>
Hardcoding 'localhost:8125' for statsd host may reduce deployment flexibility.
Consider making the statsd host and port configurable, such as via environment variables, to support different deployment environments.
</issue_to_address>
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
@@ -231,7 +232,7 @@ objects: | |||
annotations: | |||
"kubectl.kubernetes.io/default-container": pulp-api | |||
image: ${IMAGE}:${IMAGE_TAG} | |||
command: ['pulpcore-api', '-b', '0.0.0.0:8000', '--timeout', '90', '--workers', '${PULP_API_GUNICORN_WORKERS}', '--access-logfile', '-', '--access-logformat', '(pulp [%({correlation-id}o)s]: %(h)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s" %(M)s)'] | |||
command: ['pulpcore-api', '-b', '0.0.0.0:8000', '--timeout', '90', '--workers', '${PULP_API_GUNICORN_WORKERS}', '--statsd-host=localhost:8125', '--statsd-prefix=pulp-api.app', '--access-logfile', '-', '--access-logformat', '(pulp [%({correlation-id}o)s]: %(h)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s" %(M)s)'] |
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.
suggestion: Hardcoding 'localhost:8125' for statsd host may reduce deployment flexibility.
Consider making the statsd host and port configurable, such as via environment variables, to support different deployment environments.
Summary by Sourcery
Enable StatsD metrics collection in the pulp-api application by updating the Clowd deployment manifest and gunicorn startup command.
Enhancements: