Skip to content

feat(pprof): support Temporal Server pprof profiling via spec.pprof - #29

Open
Azerothian wants to merge 1 commit into
mainfrom
devbot/approved-temporal-operator-16
Open

feat(pprof): support Temporal Server pprof profiling via spec.pprof#29
Azerothian wants to merge 1 commit into
mainfrom
devbot/approved-temporal-operator-16

Conversation

@Azerothian

Copy link
Copy Markdown

Summary

Adds opt-in support for Temporal Server's pprof profiling endpoint to the operator.

Closes #16.

What changed

  • spec.pprof (new, default-off): cluster-wide block with enabled, port (default 7936), and host (default 127.0.0.1).
  • Config generation: when enabled, renders Temporal's process-wide global.pprof block into the generated server config (all services share it).
  • Pod spec: declares a named pprof container port on every temporal service pod (frontend, internal-frontend, history, matching, worker), reachable via kubectl port-forward.
  • Webhook validation: rejects any pprof port that collides with a service rpc/membership/http port or the metrics port.
  • CRD / deepcopy / docs: regenerated CRD manifests, deepcopy, API reference, CHANGELOG entry, and a new docs/features/pprof.md page.

Rationale

pprof is the standard way to profile live Temporal components while debugging production memory/CPU issues. It is off by default because it serves unauthenticated profiles; binding defaults to loopback so nothing is exposed on the pod network unless the user opts in with host: 0.0.0.0.

Verification

  • go build ./... — passes
  • go vet ./... — passes
  • Full unit suite via envtest (KUBEBUILDER_ASSETS provisioned): all packages pass, including new TestPProfSpecAccessors, TestPProfDefaults, TestValidatePProf, and TestConfigPProf{Disabled,Enabled}.
  • E2E suite not run (requires kind); controller/suite tests pass under envtest.

Add an opt-in, cluster-wide spec.pprof block (enabled/port/host). When enabled
the operator renders the temporal global.pprof config, declares a 'pprof'
container port on every temporal service pod, and the webhook rejects any
pprof port that collides with a service rpc/membership/http or metrics port.

Defaults: port 7936, host 127.0.0.1 (reachable via kubectl port-forward without
publishing on the pod network). Disabled by default to avoid exposing
unauthenticated profiles.

Refs #16
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.

Implementation proposal: support Temporal server pprof profiling

1 participant