pinpoint-apm/pinpoint · warning
invalid span application:{}
Error message
invalid span application:{} What it means
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.
Source
Thrown at web/src/main/java/com/navercorp/pinpoint/web/applicationmap/map/FilteredMapBuilder.java:232
timestamp, slotTime, 1);
}
private record TraceSpanKey(ServerTraceId traceId, long spanId) {
}
public FilteredMapBuilder addTransaction(List<SpanBo> transaction) {
final MultiValueMap<Long, SpanBo> transactionSpanMap = createTransactionSpanMap(transaction);
for (SpanBo span : transaction) {
final Application parentApplication = createParentApplication(span, transactionSpanMap);
final Application spanApplication = getSpanApplication(span);
// records the Span's response time statistics
responseHistogramsBuilder.addHistogram(spanApplication, span, span.getCollectorAcceptTime());
if (!spanApplication.getServiceType().isRecordStatistics() || spanApplication.getServiceType().isRpcClient()) {
// span's serviceType is probably not set correctly
logger.warn("invalid span application:{}", spanApplication);
continue;
}
if (parentApplication.getServiceType().isUser()) {
// Outbound data
if (logger.isTraceEnabled()) {
logger.trace("span user:{} {} -> span:{} {}", parentApplication, span.getAgentId(), spanApplication, span.getAgentId());
}
final LinkDataMap sourceLinkData = linkDataDuplexMap.getSourceLinkDataMap();
addLinkData(sourceLinkData, span, parentApplication, spanApplication);
if (logger.isTraceEnabled()) {
logger.trace("span target user:{} {} -> span:{} {}", parentApplication, span.getAgentId(), spanApplication, span.getAgentId());
}
// Inbound data
final LinkDataMap targetLinkDataMap = linkDataDuplexMap.getTargetLinkDataMap();
addLinkData(targetLinkDataMap, span, parentApplication, spanApplication);
} else {View on GitHub (pinned to 744c3d3075)
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.
Example fix
// before: custom ServiceType missing statistics flag public static final ServiceType MY_SERVICE = new ServiceType(1010, "MY_SERVICE", "MY"); // after public static final ServiceType MY_SERVICE = ServiceTypeFactory.of(1010, "MY_SERVICE", "MY", RECORD_STATISTICS);
Defensive patterns
Strategy: validation
Validate before calling
// Before feeding spans to the map builder, validate the service type
if (!span.getApplicationServiceType().isRecordStatistics() || span.getApplicationServiceType().isRpcClient()) {
logger.warn("skipping span with non-statistical service type: {}", span.getApplicationServiceType());
return;
} Type guard
boolean isValidSpanApplication(Application app) {
return app.getServiceType().isRecordStatistics() && !app.getServiceType().isRpcClient();
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.
Related errors
- annotationKey name must not be empty
- matcher type must not be empty
- Unknown matcher type :
- service type name must not be empty
- Invalid type provider definition :
AI-assisted analysis of pinpoint-apm/pinpoint@744c3d3075 (2026-09-07).
Data as JSON: /api/errors/3e6c4b4adc7eb801.
Report an issue: GitHub.