Repository navigation
feat(dev): add support for pprof - #2666
Merged
Merged
Conversation
5 tasks
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for Go profiling (pprof) to the trivy-operator by introducing a new configuration option that allows users to specify a bind address for the pprof HTTP server. This enables developers and operators to collect runtime profiling data for performance analysis and debugging.
- Added
OPERATOR_PPROF_BIND_ADDRESSenvironment variable to control pprof server binding - Integrated pprof configuration into the operator startup logic with conditional enabling
- Updated documentation and deployment configurations to include the new setting
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/operator/etc/config.go | Adds PprofBindAddress field to operator configuration struct |
| pkg/operator/operator.go | Implements pprof setup logic with conditional enabling based on configuration |
| docs/getting-started/installation/configuration.md | Documents the new pprof configuration option and fixes grammar issues |
| deploy/static/trivy-operator.yaml | Adds default empty value for pprof bind address in static deployment |
| deploy/helm/templates/configmaps/trivy-operator-config.yaml | Includes pprof configuration in Helm template |
simar7
marked this pull request as ready for review
August 8, 2025 06:48
Contributor
Author
|
@afdesk can you take a look? |
afdesk
approved these changes
Aug 19, 2025
afdesk
left a comment
Contributor
There was a problem hiding this comment.
LGTM, I left a small comment
| OPERATOR_METRICS_FINDINGS_ENABLED: {{ .Values.operator.metricsFindingsEnabled | quote }} | ||
| OPERATOR_METRICS_VULN_ID_ENABLED: {{ .Values.operator.metricsVulnIdEnabled | quote }} | ||
| OPERATOR_HEALTH_PROBE_BIND_ADDRESS: ":9090" | ||
| OPERATOR_PPROF_BIND_ADDRESS: {{ "" | quote }} |
Contributor
There was a problem hiding this comment.
Would it make sense to add support for configuring this flag via a Helm value?
it allows to use prepared configs https://github.com/afdesk/to-values/blob/main/pprof.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
dev: add support for pprof
Related issues
Checklist