{"record":{"id":"fbca2000f8547885","repo":"pinpoint-apm/pinpoint","slug":"invalid-pinpoint-agentid-agentid","errorCode":null,"errorMessage":"invalid pinpoint.agentId=${agentId}","messagePattern":"invalid pinpoint\\.agentId=(.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"otlptrace/otlptrace-collector/src/main/java/com/navercorp/pinpoint/otlp/trace/collector/mapper/OtlpTraceMapperUtils.java","lineNumber":150,"sourceCode":"        final String name = scope.getName();\n        if (name.isEmpty()) {\n            return null;\n        }\n        final String version = scope.getVersion();\n        if (version.isEmpty()) {\n            return name;\n        }\n        return name + '@' + version;\n    }\n\n    private record AgentAuth(String agentId, String agentName) {\n    }\n\n    private static AgentAuth getAgentAuth(Map<String, AttributeValue> attributes, String agentNameOverride, String applicationName, boolean allowApplicationNameFallback) {\n        final String agentId = AttributeUtils.getAttributeStringValue(attributes, KEY_AGENT_ID, null);\n        if (agentId != null) {\n            if (!IdValidateUtils.validateId(agentId, PinpointConstants.AGENT_ID_MAX_LEN)) {\n                throw new IllegalArgumentException(\"invalid pinpoint.agentId=\" + agentId);\n            }\n            return new AgentAuth(agentId, resolveAgentName(agentNameOverride, agentId));\n        }\n\n        final String serviceInstanceId = AttributeUtils.getAttributeStringValue(attributes, KEY_SERVICE_INSTANCE_ID, null);\n        if (serviceInstanceId != null) {\n            return toAgentAuth(serviceInstanceId, KEY_SERVICE_INSTANCE_ID, agentNameOverride);\n        }\n\n        final String podUid = AttributeUtils.getAttributeStringValue(attributes, KEY_K8S_POD_UID, null);\n        if (podUid != null) {\n            return toAgentAuth(podUid, KEY_K8S_POD_UID, agentNameOverride);\n        }\n\n        final String containerId = AttributeUtils.getAttributeStringValue(attributes, KEY_CONTAINER_ID, null);\n        if (containerId != null) {\n            return toContainerAgentAuth(containerId, agentNameOverride);\n        }","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/otlptrace/otlptrace-collector/src/main/java/com/navercorp/pinpoint/otlp/trace/collector/mapper/OtlpTraceMapperUtils.java#L132-L168","documentation":"getAgentAuth resolves the per-instance agentId from span attributes ('pinpoint.agentId' first). If a pinpoint.agentId attribute is present but fails IdValidateUtils.validateId with AGENT_ID_MAX_LEN (length/charset rules), it throws this IllegalArgumentException rather than silently producing a malformed agent identity.","triggerScenarios":"Attributes contain a non-null 'pinpoint.agentId' value whose characters or length violate IdValidateUtils.validateId(agentId, PinpointConstants.AGENT_ID_MAX_LEN).","commonSituations":"Manually configured agentId containing '-' or other disallowed chars; agentId longer than the max length; templated config that interpolated an invalid value (empty string or full hostname).","solutions":["Correct the pinpoint.agentId attribute to a valid Pinpoint agentId (allowed charset, within AGENT_ID_MAX_LEN)","Remove the pinpoint.agentId attribute and let getAgentAuth derive the id from service.instance.id / pod uid / container id / host.name","Pre-validate in your exporter with IdValidateUtils.validateId(agentId, PinpointConstants.AGENT_ID_MAX_LEN) before attaching the attribute"],"exampleFix":"// before\nattributes.put(\"pinpoint.agentId\", \"agent-01\"); // '-' invalid\n// after\nattributes.put(\"pinpoint.agentId\", \"agent01\");","handlingStrategy":"validation","validationCode":"if (agentId != null && !IdValidateUtils.validateId(agentId, PinpointConstants.AGENT_ID_MAX_LEN)) {\n    throw new IllegalArgumentException(\"invalid pinpoint.agentId=\" + agentId);\n}","typeGuard":null,"tryCatchPattern":"try { AgentAuth a = mapperUtils.agentAuth(attrs, override, app, false); } catch (IllegalArgumentException e) { /* reject or fall back to derived id */ }","preventionTips":["Avoid '-' and special characters in pinpoint.agentId","Keep agentId within AGENT_ID_MAX_LEN","Prefer deriving ids from service.instance.id instead of hand-set values"],"tags":["otlp","validation","agent-id"],"backgroundTag":"invalid-identifier-format","analyzedSha":"744c3d3075e595656abb1ae331ad2c0e4c9eb996","analyzedAt":"2026-09-07T18:48:45.289Z","contentChangedAt":"2026-09-07T18:48:45.289Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}