Skip to content

docs(operations): add profiling guide for PAC components#2602

Merged
theakshaypant merged 1 commit intotektoncd:mainfrom
theakshaypant:docs-dev-enable-pprof
Mar 25, 2026
Merged

docs(operations): add profiling guide for PAC components#2602
theakshaypant merged 1 commit intotektoncd:mainfrom
theakshaypant:docs-dev-enable-pprof

Conversation

@theakshaypant
Copy link
Copy Markdown
Member

📝 Description of the Change

Document how to enable the Knative pprof profiling server on the watcher, webhook, and controller. Covers the ConfigMap toggle, PAC_DISABLE_HEALTH_PROBE requirement for the watcher, controller K_METRICS_CONFIG setup, exposing port 8008, and PROFILING_PORT override.

🔗 Linked GitHub Issue

N/A

🧪 Testing Strategy

  • Unit tests
  • Integration tests
  • End-to-end tests
  • Manual testing
  • Not Applicable

🤖 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.

  • I have not used any AI assistance for this PR.
  • I have used AI assistance for this PR.

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-by trailer to your commit message.
For example:

Co-authored-by: Claude noreply@anthropic.com

✅ Submitter Checklist

  • 📝 My commit messages are clear, informative, and follow the project's How to write a git commit message guide. The Gitlint linter ensures in CI it's properly validated
  • ✨ I have ensured my commit message prefix (e.g., fix:, feat:) matches the "Type of Change" I selected above.
  • ♽ I have run make test and make lint locally to check for and fix any
    issues. For an efficient workflow, I have considered installing
    pre-commit and running pre-commit install to
    automate these checks.
  • 📖 I have added or updated documentation for any user-facing changes.
  • 🧪 I have added sufficient unit tests for my code changes.
  • 🎁 I have added end-to-end tests where feasible. See README for more details.
  • 🔎 I have addressed any CI test flakiness or provided a clear reason to bypass it.
  • If adding a provider feature, I have filled in the following and updated the provider documentation:
    • GitHub App
    • GitHub Webhook
    • Gitea/Forgejo
    • GitLab
    • Bitbucket Cloud
    • Bitbucket Data Center

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces new documentation that guides users through the process of enabling and using Go runtime profiling (pprof) for Pipelines-as-Code components. The aim is to provide developers with the necessary information to diagnose and resolve performance bottlenecks, such as CPU hot-spots and memory leaks, by offering clear, step-by-step instructions for configuration, access, and secure operation of the profiling server.

Highlights

  • Profiling Documentation: Added comprehensive documentation on how to enable and utilize Knative pprof profiling for Pipelines-as-Code (PAC) components.
  • Component-Specific Configuration: Detailed instructions are provided for enabling profiling on the watcher, webhook, and controller components, including specific environment variables and ConfigMap configurations.
  • Accessing and Capturing Profiles: The guide includes steps for exposing the profiling port, changing the default port, and capturing various profiles (heap, CPU, goroutine) using go tool pprof and curl.
  • Security Considerations: Important security notes are included, advising against exposing profiling ports in production and emphasizing the need to disable profiling when not actively in use.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces comprehensive documentation on how to enable and access profiling for Pipelines-as-Code components (watcher, webhook, and controller). The documentation details the use of Knative's profiling server, configuration via environment variables and ConfigMaps, and methods for capturing profiles. A suggestion was made to improve the clarity of the 'Accessing Profiles' section by providing concrete instructions using kubectl port-forward instead of generic host/port placeholders.

@theakshaypant theakshaypant force-pushed the docs-dev-enable-pprof branch 2 times, most recently from 78df1e7 to 284778e Compare March 25, 2026 05:50

```bash
export POD_NAME=$(kubectl get pods -n pipelines-as-code \
-l app.kubernetes.io/name=watcher \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

maybe make it that it mentions to choose watcher or controller

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.

Added the commands to get all of the pod names in 6f7e2e2

Copy link
Copy Markdown
Member

@chmouel chmouel left a comment

Choose a reason for hiding this comment

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

smalll comment, feel free to auto approve after that

Document how to enable the Knative pprof profiling server on the
watcher, webhook, and controller. Covers the ConfigMap toggle,
PAC_DISABLE_HEALTH_PROBE requirement for the watcher, controller
K_METRICS_CONFIG setup, exposing port 8008, and PROFILING_PORT
override.

Signed-off-by: Akshay Pant <akpant@redhat.com>
Co-Authored-by: Claude <noreply@anthropic.com>
@theakshaypant theakshaypant force-pushed the docs-dev-enable-pprof branch from 284778e to 6f7e2e2 Compare March 25, 2026 07:08
@theakshaypant theakshaypant merged commit 0127492 into tektoncd:main Mar 25, 2026
4 checks passed
@theakshaypant theakshaypant deleted the docs-dev-enable-pprof branch March 25, 2026 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants