Repository navigation
Description
Problem Description
Two reads of the Tempo HTTP API OOM-killed the pod tempo-0 in the namespace otel on 2026-11-21. The memory limit of the pod is 2048Mi (k8s/otel/tempo-values.yaml), and the values set no limit on a search or on the size of a trace. While the pod restarted, a person or a job could not read a trace, and the pod did not get the spans of that time.
Reproduction Steps
- Run
kubectl -n otel port-forward svc/tempo 13200:3200. - Send about 10 requests, one after the other:
GET /api/search?q={name="invoke_agent agent"}&start=<t-900>&end=<t+120>&limit=50&spss=20over a busy hour, andGET /api/traces/<id>for each trace that the search returns. - Read the pod state:
kubectl -n otel get pod tempo-0.
Expected vs Actual Behavior
Expected: Tempo refuses or cuts a read that is too large, and the pod stays up.
Actual: the container stopped with OOMKilled (exit code 137) two times, at 07:07 and at 07:08:31 UTC. The restart count went to 2.
Logs, Traces, or Terminal Output
kubectl -n otel get pod tempo-0 -o jsonpath='{.status.containerStatuses[0].lastState}' gave {"terminated":{"exitCode":137,"finishedAt":"2026-11-21T07:08:31Z","reason":"OOMKilled"}}. A port-forward showed lost connection to pod.
Found during #6394. The fix belongs in k8s/otel/tempo-values.yaml: set query limits of Tempo, such as max_bytes_per_trace and the search limits of the query frontend, under the memory limit.
Alternatives check of 2026-11-21: in-use.
The repository already uses this tool.
Tool: grafana/tempo (https://github.com/grafana/tempo), AGPL-3.0, last activity 2026-11-21, maintained.
Reason: Searches found no separate tool: Grafana Tempo, already the project's tracing backend, ships the search byte, result, duration and concurrency limits the fix needs, so only the Helm values change.
Covers:
- Caps bytes per trace read by search
- Caps result count and search duration
- Caps concurrent queries and outstanding queries per tenant
Lacks:
- No default limits sized for a 2048Mi pod
- No memory-aware cut based on live usage
- Limits must be set by hand in the chart values
Proposed design
Problem statement
Two reads of the Tempo HTTP API OOM-killed the pod tempo-0 at the 2048Mi memory limit. The Tempo Helm values set no limit on a search or on the size of a trace. The fix sets Tempo query frontend and querier limits under the memory limit in k8s/otel/tempo-values.yaml.
Acceptance criteria
Requirement: Tempo query limits
The Tempo Helm values SHALL set the Tempo search, trace byte and query concurrency limits under the 2048Mi pod memory limit.
Scenario: Kubernetes manifest validation
- WHEN I run
uv run devops ci --check --only k8s - THEN The k8s check passes and reports no error for
k8s/otel/tempo-values.yaml.
Requirement: Tempo stays up under search
Tempo SHALL refuse or cut an oversized search or trace read without restarting the pod.
Scenario: Ten search and trace reads
- WHEN I deploy the values and run the ten search and trace reads from the reproduction steps
- THEN
kubectl -n otel get pod tempo-0showsRunningand the restart count does not increase.
Requirement: Deployed Tempo limits
The deployed Tempo configuration MUST show the search, trace byte and concurrency limits under the 2048Mi pod memory limit.
Scenario: Live configuration check
- WHEN I deploy the values and run
kubectl -n otel get configmap -l app.kubernetes.io/name=tempo -o yaml - THEN The output shows
max_bytes_per_trace: 1000000,max_result_limit: 50,max_duration: 30s,target_bytes_per_second: 25000000,max_outstanding_per_tenant: 10andmax_concurrent_queries: 4.
Existing Tool Considered
Grafana Tempo (https://github.com/grafana/tempo), verdict in-use, per the alternatives check in the issue body. The check lists what the tool covers and lacks. The proposal sets the query frontend and querier limits by hand in k8s/otel/tempo-values.yaml to cover the gap that the check lists, and adds no custom code.
Key questions
- What memory limit does the Tempo pod have?: The Tempo container has a memory limit of 2048Mi in
k8s/otel/tempo-values.yaml. [sources: k8s/otel/tempo-values.yaml] - Which Tempo limits keep a search under the 2048Mi memory limit?: Set
query_frontend.search.max_bytes_per_traceto 1000000,max_result_limitto 50,max_durationto 30s andtarget_bytes_per_secondto 25000000. Setquery_frontend.max_outstanding_per_tenantto 10 andquerier.max_concurrent_queriesto 4. (best practice) [sources: k8s/otel/tempo-values.yaml]- Chosen: Tempo built-in search and concurrency limits. Tempo caps bytes per trace, result count, duration, bytes per second and concurrent queries. The chart accepts these values in its Tempo block.
- Rejected: Only
max_bytes_per_trace. It leaves result count, duration and concurrency unbounded. Ten reads can still exhaust memory. - Rejected: A custom proxy that rejects large reads. It adds code to build and keep where Tempo has the limits.
- Should the fix raise the 2048Mi memory limit instead of setting query limits?: No. Keep the 2048Mi limit and set query limits. A higher limit only delays an OOMKilled stop and increases cluster cost. (best practice) [sources: k8s/otel/tempo-values.yaml]
- Chosen: Set query limits under the 2048Mi limit. It bounds each search and trace read and keeps the memory budget.
- Rejected: Raise the memory limit above 2048Mi. It does not bound a large trace read and it spends more memory on the node.
- How should the change place these limits in the Helm values?: Use the chart's Tempo values for the limits. Do not override the whole
tempo.config, because the chart builds the Tempo configuration from its values. (best practice) [sources: k8s/otel/tempo-values.yaml]- Chosen: Chart Tempo values. The file header says the chart builds the Tempo config from these values. A full
configoverride would pin one Tempo version's layout. - Rejected: Full
tempo.configoverride. It pins a copy of one Tempo version's layout and can break on a Tempo upgrade. - Rejected: A separate ConfigMap patch. It adds a second source of Tempo configuration.
- Chosen: Chart Tempo values. The file header says the chart builds the Tempo config from these values. A full
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 21, 2026
Tempo OOM-kills twice in one minute, blocking all trace reads and losing spans during the restart window.Both target k8s/otel/tempo-values.yaml for the Tempo pod in namespace otel, but #1627 sets a restricted securityContext while this candidate sets query limits to prevent OOM.devops-cli-service commentedon Nov 21, 2026
Next step: the alternatives check records a verdict. See the section Proposed design of the body.
devops-cli-service commentedon Nov 21, 2026
The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.
Searches (9)
Tools considered:
Searches run:
Sources:
devops-cli-service commentedon Nov 21, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.
devops-cli-service commentedon Nov 21, 2026
Plan state: branch
fix/6616-a-trace-search-oom-kills-tempo, draft pull request #6631. The pull request plans the item and closes no issue. The stage job and the step fix-plan edit this comment, and a comment of each run tells what the run did.The task groups, with the tokens of the inputs of each step, for a budget of 64000 tokens:
A model review of the plan found these points. They stop no draft, and a person judges them:
spec_delta_wrongat spec workload-resource-limits (The Tempo query limits stay under the memory limit): The scenario "An edited limit fails the row" says the row names the key that differs, but the group 1 check compares all the exact values in one comparison without a per-key message; only the two product assertions name a file and a key, so no test can assert that part of the THEN. Evidence: "The row fails and namesk8s/otel/tempo-values.yamland the key that differs."otherat design (decisions): The plan decides to assert the literal values of the committed Helm values file in a gate check, which the project's testing rule forbids (a limit or a key of a config file gets no test); the plan relies on the gate exemption inconfig_values.pyinstead of the live check of the deployed configuration that the issue's criterion names. Evidence: "No test asserts a value of a manifest or of a config file: a version, a tag, a digest, a model name, a limit, a mode, a key, a port, an interval or the content of a table."20 remaining items
fix(k8s): Cap the Tempo search and query concurrency in the chart val…
fix(k8s): Cut the spans of a trace beyond one million bytes as Tempo …
docs(openspec): archive the change (#6616)
devops-cli-service commentedon Nov 21, 2026
The draft pull request #6669 holds the final title and body. In mode
onofroadmap.fix_checks.mode, the watch row marks it ready when its checks pass, and a fix-checks Job repairs a failed check whose name gives the class test, lint or types. In each other case the watch row stops the item: another failed check, a cancelled check, a conflict, a fix-checks Job that ended with no repair, or another mode.Spend: 38 model requests, 1431489 input tokens, 13963 output tokens.
devops-cli-service commentedon Nov 21, 2026
Released in v0.188.4: https://github.com/dan-petty/devops-cli/releases/tag/v0.188.4
devops-cli-service commentedon Nov 21, 2026
Live since 2026-11-21 19:37 UTC
dan-petty commentedon Nov 22, 2026
The config keys that #6669 added stop Tempo 3.1.1 at start:
otel/tempo-0crash-loops since about 19:30 UTC on 2026-11-21 (field max_bytes_per_trace not found in type frontend.SearchConfig). The fix is #6730 (P0).fix(k8s): Tempo starts again with config keys of its version (#6733)