{"record":{"id":"dfca89f0144907ad","repo":"JuliusBrussee/caveman","slug":"telemetry-attributes-exceed-d-keys","errorCode":null,"errorMessage":"telemetry attributes exceed %d keys","messagePattern":"telemetry attributes exceed (.+?) keys","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"shared/platform/telemetry/span.go","lineNumber":257,"sourceCode":"\t\t}\n\t}\n\tif strings.Contains(lower, \"api_key\") || strings.Contains(lower, \"access_token\") || strings.Contains(lower, \"refresh_token\") {\n\t\treturn false\n\t}\n\treturn true\n}\n\n// 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}","sourceCodeStart":239,"sourceCodeEnd":275,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/27d5a3981a347890211bb1bf2439e5c821a63bc9/shared/platform/telemetry/span.go#L239-L275","documentation":"Error \"telemetry attributes exceed %d keys\" thrown in JuliusBrussee/caveman.","triggerScenarios":"Thrown at shared/platform/telemetry/span.go:257 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reduce the number of telemetry attribute keys below the 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-15T22:17:37.221Z"}