JuliusBrussee/caveman · error
telemetry attributes exceed
Error message
telemetry attributes exceed %d bytes
What it means
SanitizeAttributes enforces telemetry span-attribute budgets: each attribute value must fit MaxAttributeValueBytes and the combined size of all keys+values must fit MaxAttributesBytes. When the running total crosses MaxAttributesBytes, the sanitizer fails closed and returns this error instead of emitting oversized span data.
Solutions
- Trim attribute values so the total of all keys+values stays under MaxAttributesBytes
- Drop low-value attributes (pivots, payloads) before calling SanitizeAttributes
- Truncate each value to MaxAttributeValueBytes and count the total yourself before the call
- Increase MaxAttributesBytes only if your backend truly supports larger spans
Example fix
// before
attrs["http.request.body"] = string(body) // huge
attrs["pivots"] = pivotsJSON
sanitized, err := SanitizeAttributes(attrs)
// after
sanitized, err := SanitizeAttributes(map[string]string{
"http.status_code": code,
"http.body.sha256": sha256hex(body), // bounded size
}) Defensive patterns
Strategy: validation
Validate before calling
const total = Object.entries(attrs).reduce((n,[k,v])=>n+k.length+v.length,0)
if (total > MaxAttributesBytes) {
throw new Error(`attributes total ${total} exceeds ${MaxAttributesBytes} bytes`)
} Type guard
function fitsBudget(attrs: Record<string,string>, max: number): boolean {
return Object.entries(attrs).every(([k,v]) => v.length <= MaxAttributeValueBytes) &&
Object.entries(attrs).reduce((n,[k,v])=>n+k.length+v.length,0) <= max
} Prevention
- Hash or summarize large payloads instead of embedding them as attribute values
- Keep a small allowlist of span attribute keys
- Truncate values defensively before aggregating into spans
When it happens
Trigger: Calling SanitizeAttributes (via Parse) with a map whose cumulative key+value byte length exceeds MaxAttributesBytes — e.g. many large attributes accumulated on a span before export.
Common situations: Instrumentation attaching request/response bodies or long error strings as span attributes; batch exporters aggregating too many attributes on one span; misconfigured telemetry pipelines that disable attribute truncation upstream.
Understand the failure class
Background: payload too large / request exceeds maximum size: why libraries cap bytes and how to fix oversize payloads — this error's family across 50 libraries.
Related errors
- cave_memory_too_large
- githubapp: repository proof size mismatch
- SKILL.md must be 1..262144 bytes
- telemetry attribute key exceeds
- : bytes (limit )
AI-assisted analysis of JuliusBrussee/caveman@3ee70a1026 (2026-09-20).
Data as JSON: /api/errors/85ef37941e6b9e91.
Report an issue: GitHub.
Appendix: source
Thrown at shared/platform/telemetry/span.go:272
}
}
if len(keys) > MaxAttributes {
return nil, fmt.Errorf("telemetry attributes exceed %d keys", MaxAttributes)
}
sort.Strings(keys)
out := make(map[string]string, len(keys))
total := 0
for _, key := range keys {
value := attrs[key]
if len(key) > MaxAttributeKeyBytes {
return nil, fmt.Errorf("telemetry attribute key exceeds %d bytes", MaxAttributeKeyBytes)
}
if len(value) > MaxAttributeValueBytes {
return nil, fmt.Errorf("telemetry attribute %q exceeds %d bytes", key, MaxAttributeValueBytes)
}
total += len(key) + len(value)
if total > MaxAttributesBytes {
return nil, fmt.Errorf("telemetry attributes exceed %d bytes", MaxAttributesBytes)
}
out[key] = value
}
return out, nil
}
View on GitHub (pinned to 3ee70a1026)