Skip to content

feat(dev): add support for pprof#2666

Merged
simar7 merged 4 commits intomainfrom
add-profiling
Aug 21, 2025
Merged

feat(dev): add support for pprof#2666
simar7 merged 4 commits intomainfrom
add-profiling

Conversation

@simar7
Copy link
Copy Markdown
Member

@simar7 simar7 commented Jul 19, 2025

Description

dev: add support for pprof

Related issues

Checklist

  • I've read the guidelines for contributing to this repository.
  • I've added tests that prove my fix is effective or that my feature works.
  • I've updated the documentation with the relevant information (if needed).
  • I've added usage information (if the PR introduces new options)
  • I've included a "before" and "after" example to the description (if the PR is a user interface change).

@afdesk afdesk changed the title dev: add support for pprof feat(dev): add support for pprof Jul 29, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_ADDRESS environment 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 simar7 marked this pull request as ready for review August 8, 2025 06:48
@simar7
Copy link
Copy Markdown
Member Author

simar7 commented Aug 19, 2025

@afdesk can you take a look?

@simar7 simar7 requested a review from afdesk August 19, 2025 01:03
Copy link
Copy Markdown
Contributor

@afdesk afdesk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 }}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah that's right! - I added 57fd7db

@simar7 simar7 requested a review from afdesk August 20, 2025 22:38
@simar7 simar7 merged commit c63b74a into main Aug 21, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants