fix(profiling): enable controller profiling and update docs#2720
fix(profiling): enable controller profiling and update docs#2720theakshaypant wants to merge 2 commits into
Conversation
Update knative/eventing to v0.49.0 which includes the pprof server fix (knative/eventing#9008). Also bumps k8s.io to v0.35.4, knative/pkg, and golang.org/x dependencies. Signed-off-by: Akshay Pant <akpant@redhat.com>
Replace the obsolete profiling.enable ConfigMap key with runtime-profiling (enabled/disabled). Remove the K_METRICS_CONFIG controller section since the controller now uses ConfigMap-based observability via the eventing adapter. Document that controller profiling requires a pod restart as the adapter reads config once at startup. Add CONFIG_OBSERVABILITY_NAME prerequisite for the webhook. Fixes tektoncd#2633 Signed-off-by: Akshay Pant <akpant@redhat.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2720 +/- ##
==========================================
+ Coverage 59.25% 59.29% +0.03%
==========================================
Files 208 208
Lines 20573 20590 +17
==========================================
+ Hits 12191 12208 +17
Misses 7610 7610
Partials 772 772 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Code Review
This pull request updates the profiling documentation to reflect changes in ConfigMap keys and provides clearer component-specific instructions. It also updates several Go dependencies, including Kubernetes and Knative libraries. Review feedback identified a duplicate major version dependency for go-github in go.mod that should be consolidated. Additionally, a logic error was found in the documentation's shell script where a hardcoded port assignment would overwrite a user-defined profiling port, potentially leading to unreachable endpoints.
| github.com/google/cel-go v0.28.0 | ||
| github.com/google/go-cmp v0.7.0 | ||
| github.com/google/go-github/scrape v0.0.0-20260403152401-96a365122246 | ||
| github.com/google/go-github/v84 v84.0.0 |
There was a problem hiding this comment.
The go.mod file now lists both v84 and v85 of github.com/google/go-github as direct dependencies. This is likely an error during the dependency update process. Having multiple major versions of the same library as direct dependencies increases maintenance complexity and can lead to type conflicts if objects are passed between packages using different versions. Please consolidate on a single version (preferably v85) and remove this duplicate entry.
| the target Deployment(s) to expose it — substituting the port number if you changed it: | ||
|
|
||
| ```bash | ||
| PROFILING_PORT=8008 # change if you set a custom port above |
There was a problem hiding this comment.
This line resets the PROFILING_PORT shell variable to 8008, which will overwrite any custom port the user might have set in the previous step (e.g., 8090 on line 84). This will cause a mismatch between the port the application is configured to listen on (via the Deployment environment variable) and the containerPort exposed in the Deployment spec, making the profiling endpoints unreachable. It is better to use a default value only if the variable is not already set.
| PROFILING_PORT=8008 # change if you set a custom port above | |
| PROFILING_PORT=${PROFILING_PORT:-8008} # use existing value or default to 8008 |
Code reviewBranch: Found 11 findings across all lanes:
Deep lane — correctness & securityAuto-recommendations (2)AI-authored fix directions for findings that aren't auto-fixable today. Run
Full recommendations and alternativesF004 — The controller docs state profiling config is read once at startup and not watched, but the eventing adapter in v0.49.0 now actually starts the profiling server, meaning the controller profiling was completely broken before this PR -- the docs should note this behavioral change.File:
F007 — Port-forward command and all subsequent examples use hardcoded port 8008 despite earlier section telling users to change PROFILING_PORT.File:
Light lane — ux, policy, architectureLight-lane findings — including rows labeled auto-fixable — aren't applied by
Pre-existing — report-only (1)Shown only when
🤖 Generated with the adamsreview Claude Code Review Plugin |
📝 Description of the Change
ListenAndServeso controller profiling actually worksprofiling.enablewithruntime-profiling: enabled/disabled remove the obsoleteK_METRICS_CONFIG` controller section, and document per-component prerequisites🔗 Linked GitHub Issue
Fixes #2633
🧪 Testing Strategy
🤖 AI Assistance
AI assistance can be used for various tasks, such as code generation,
documentation, or testing.
Please indicate whether you have used AI assistance
for this PR and provide details if applicable.
Important
Slop will be simply rejected, if you are using AI assistance you need to make sure you
understand the code generated and that it meets the project's standards. you
need at least know how to run the code and deploy it (if needed). See
startpaac to make it easy
to deploy and test your code changes.
If the majority of the code in this PR was generated by an AI, please add a
Co-authored-bytrailer to your commit message.For example:
Co-authored-by: Claude noreply@anthropic.com
✅ Submitter Checklist
fix:,feat:) matches the "Type of Change" I selected above.make testandmake lintlocally to check for and fix anyissues. For an efficient workflow, I have considered installing
pre-commit and running
pre-commit installtoautomate these checks.