[Feature Request] Option to disable metrics in server start-dev

Aperta
#1,274 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@shafiktanbir ci sta già lavorando.

Dal 22/11/2026.

  • #1278 di @shafiktanbir — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
67/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
go, prometheus
Ambito
cli, observability

Direzione di ricerca

Start with internal/temporalcli/commands.server.go around the metrics port selection and internal/devserver/server.go around buildServerConfig, where the issue says metrics are configured. Check the startup banner code that prints the Temporal Metrics endpoint. Add a supported way to disable metrics and confirm startup skips Prometheus configuration and reports the disabled state or omits the endpoint.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Is your feature request related to a problem? Please describe.

There's no way to run temporal server start-dev without Prometheus metrics. If --metrics-port is omitted, the CLI picks a free port (commands.server.go#L147-L154), so MetricsPort is always > 0 when it reaches buildServerConfig, and metrics are always configured (server.go#L272). Passing a non-positive value fails: can't set metrics port -1: listen tcp: address -1: invalid port.

This matters when the dev server backs a test suite that creates many short-lived namespaces (one or two per test, so tests are isolated). The metric registry keeps a set of series for every namespace, task queue and partition it has seen, and never drops them, even after the namespace is deleted. On CLI 1.9.1 (server 1.32.0), one run of a ~100-test suite left about 1.3M series and 212 namespace label values. The dev server's memory grew by about 1.6 GiB per run and was OOM-killed on the third run in a long-lived container.

Running temporalio/server:1.32.0 with a config that has no global.metrics section, plus the same dynamic config settings, cut growth by about 450 MiB per run compared with the dev server. That's because the server falls back to metrics.NoopMetricsHandler when Global.Metrics is nil. But it means writing and maintaining a full server config just to drop metrics.

Describe the solution you'd like

A way to turn metrics off in server start-dev, for example:

  • a --disable-metrics flag, or
  • --metrics-port 0 (or a negative value) meaning "no metrics", if changing the meaning of 0 is acceptable.

Either one would leave MetricsPort at 0, so the existing check at server.go#L272 skips the Prometheus config. The startup banner would then print nothing (or "disabled") for Temporal Metrics.

Additional context
  • #309 added printing of the auto-picked metrics port. As far as I can tell, there's no existing request to turn metrics off.
  • The same option would help testsuite.StartDevServer users in the Go SDK, which runs this CLI: they could pass the flag through ExtraArgs.
Lingua principale
Go
Stelle
390
Fork
123
Merge medio
2g 9h
PR unite (30g)
13

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di temporalio/cli

Tutte le issue di temporalio/cli

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.