{"record":{"id":"3e6c4b4adc7eb801","repo":"pinpoint-apm/pinpoint","slug":"invalid-span-application","errorCode":null,"errorMessage":"invalid span application:{}","messagePattern":"invalid span application:(.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"web/src/main/java/com/navercorp/pinpoint/web/applicationmap/map/FilteredMapBuilder.java","lineNumber":232,"sourceCode":"                timestamp, slotTime, 1);\n    }\n\n    private record TraceSpanKey(ServerTraceId traceId, long spanId) {\n    }\n\n    public FilteredMapBuilder addTransaction(List<SpanBo> transaction) {\n        final MultiValueMap<Long, SpanBo> transactionSpanMap = createTransactionSpanMap(transaction);\n\n        for (SpanBo span : transaction) {\n            final Application parentApplication = createParentApplication(span, transactionSpanMap);\n            final Application spanApplication = getSpanApplication(span);\n\n            // records the Span's response time statistics\n            responseHistogramsBuilder.addHistogram(spanApplication, span, span.getCollectorAcceptTime());\n\n            if (!spanApplication.getServiceType().isRecordStatistics() || spanApplication.getServiceType().isRpcClient()) {\n                // span's serviceType is probably not set correctly\n                logger.warn(\"invalid span application:{}\", spanApplication);\n                continue;\n            }\n\n            if (parentApplication.getServiceType().isUser()) {\n                // Outbound data\n                if (logger.isTraceEnabled()) {\n                    logger.trace(\"span user:{} {} -> span:{} {}\", parentApplication, span.getAgentId(), spanApplication, span.getAgentId());\n                }\n                final LinkDataMap sourceLinkData = linkDataDuplexMap.getSourceLinkDataMap();\n                addLinkData(sourceLinkData, span, parentApplication, spanApplication);\n\n                if (logger.isTraceEnabled()) {\n                    logger.trace(\"span target user:{} {} -> span:{} {}\", parentApplication, span.getAgentId(), spanApplication, span.getAgentId());\n                }\n                // Inbound data\n                final LinkDataMap targetLinkDataMap = linkDataDuplexMap.getTargetLinkDataMap();\n                addLinkData(targetLinkDataMap, span, parentApplication, spanApplication);\n            } else {","sourceCodeStart":214,"sourceCodeEnd":250,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/web/src/main/java/com/navercorp/pinpoint/web/applicationmap/map/FilteredMapBuilder.java#L214-L250","documentation":"FilteredMapBuilder.addTransaction skips a span whose resolved spanApplication service type either does not record statistics (isRecordStatistics() false) or is an RPC client, logging 'invalid span application'. The builder treats this as malformed span metadata — such spans cannot contribute meaningful histogram/link statistics — so the span is excluded from the filtered map rather than crashing the build.","triggerScenarios":"Calling addTransaction (directly or via addTransactions/twoTier) with spans whose application service type has isRecordStatistics=false or isRpcClient=true, i.e. a ServiceType that is not configured for statistics recording.","commonSituations":"Custom or third-party ServiceType plugins with wrong flags (isRecordStatistics not set); agents running old plugin versions that mislabel service types; spans whose application names resolve to RPC-client types unexpectedly due to misconfiguration.","solutions":["Fix the ServiceType definition of the offending application's plugin: set the recordStatistics flag (or remove RpcClient flag) so spans are valid for statistics.","Update the agent/plugin to a version where the service type is declared correctly.","Check span data in storage for spans written with the bad service type; re-index or expire them after fixing the plugin.","If the span type is legitimately non-statistical, filter it out at ingestion instead of letting the map builder warn on every transaction."],"exampleFix":"// before: custom ServiceType missing statistics flag\npublic static final ServiceType MY_SERVICE = new ServiceType(1010, \"MY_SERVICE\", \"MY\");\n\n// after\npublic static final ServiceType MY_SERVICE = ServiceTypeFactory.of(1010, \"MY_SERVICE\", \"MY\", RECORD_STATISTICS);","handlingStrategy":"validation","validationCode":"// Before feeding spans to the map builder, validate the service type\nif (!span.getApplicationServiceType().isRecordStatistics() || span.getApplicationServiceType().isRpcClient()) {\n    logger.warn(\"skipping span with non-statistical service type: {}\", span.getApplicationServiceType());\n    return;\n}","typeGuard":"boolean isValidSpanApplication(Application app) {\n    return app.getServiceType().isRecordStatistics() && !app.getServiceType().isRpcClient();\n}","tryCatchPattern":null,"preventionTips":["Set recordStatistics on every custom ServiceType that should contribute map statistics","Test custom plugins against FilteredMapBuilder before release","Keep agent plugin definitions aligned with server-side ServiceType registry","Alert on 'invalid span application' warnings to catch plugin flag regressions early"],"tags":["service-type","plugin","span-data","service-map"],"backgroundTag":"invalid-argument-value","analyzedSha":"744c3d3075e595656abb1ae331ad2c0e4c9eb996","analyzedAt":"2026-09-07T18:48:45.289Z","contentChangedAt":"2026-09-07T18:48:45.289Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}