{"record":{"id":"f245d085f1d5dcb1","repo":"JuliusBrussee/caveman","slug":"telemetry-attribute-key-exceeds-d-bytes","errorCode":null,"errorMessage":"telemetry attribute key exceeds %d bytes","messagePattern":"telemetry attribute key exceeds (.+?) bytes","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"shared/platform/telemetry/span.go","lineNumber":265,"sourceCode":"// SanitizeAttributes returns a deterministic copy. Sensitive keys are removed;\n// malformed or oversized metadata fails closed so callers can reject the record.\nfunc SanitizeAttributes(attrs map[string]string) (map[string]string, error) {\n\tkeys := make([]string, 0, len(attrs))\n\tfor key := range attrs {\n\t\tif AttributeAllowed(key) {\n\t\t\tkeys = append(keys, key)\n\t\t}\n\t}\n\tif len(keys) > MaxAttributes {\n\t\treturn nil, fmt.Errorf(\"telemetry attributes exceed %d keys\", MaxAttributes)\n\t}\n\tsort.Strings(keys)\n\tout := make(map[string]string, len(keys))\n\ttotal := 0\n\tfor _, key := range keys {\n\t\tvalue := attrs[key]\n\t\tif len(key) > MaxAttributeKeyBytes {\n\t\t\treturn nil, fmt.Errorf(\"telemetry attribute key exceeds %d bytes\", MaxAttributeKeyBytes)\n\t\t}\n\t\tif len(value) > MaxAttributeValueBytes {\n\t\t\treturn nil, fmt.Errorf(\"telemetry attribute %q exceeds %d bytes\", key, MaxAttributeValueBytes)\n\t\t}\n\t\ttotal += len(key) + len(value)\n\t\tif total > MaxAttributesBytes {\n\t\t\treturn nil, fmt.Errorf(\"telemetry attributes exceed %d bytes\", MaxAttributesBytes)\n\t\t}\n\t\tout[key] = value\n\t}\n\treturn out, nil\n}\n","sourceCodeStart":247,"sourceCodeEnd":278,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/27d5a3981a347890211bb1bf2439e5c821a63bc9/shared/platform/telemetry/span.go#L247-L278","documentation":"Error \"telemetry attribute key exceeds %d bytes\" thrown in JuliusBrussee/caveman.","triggerScenarios":"Thrown at shared/platform/telemetry/span.go:265 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Shorten the telemetry attribute key below the byte limit."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"27d5a3981a347890211bb1bf2439e5c821a63bc9","analyzedAt":"2026-08-15T09:26:11.751Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}