pinpoint-apm/pinpoint · warning

Failed to insert uriStat

Error message

Failed to insert uriStat

What it means

OtlpTraceExportService.export calls uriStatService.store(...) for the optional URI statistics side channel; any exception increments uriStatInsertErrorCounter and logs this throttled warning. Per the in-code comment, uriStat failure deliberately does not fail the trace export and is not counted toward serverErrorCount because spans are already stored.

Solutions

  1. Check the throttled stack trace to identify the uriStat storage failure.
  2. Verify uriStat backend connectivity and topic/table configuration.
  3. Disable the uriStat service if the feature is not used, eliminating the error path.
  4. Monitor uriStatInsertErrorCounter; uriStat data loss here is intentionally non-fatal.
Defensive patterns

Strategy: fallback

Validate before calling

if (uriStatService == null || otlpTraceMapperData.getUriStatSpanList().isEmpty()) {
    return; // uriStat is optional; skip when unconfigured or empty
}

Try / catch

try {
    uriStatService.store(otlpTraceMapperData.getUriStatSpanList());
} catch (Exception e) {
    uriStatInsertErrorCounter.increment();
    logger.warn("Failed to insert uriStat (side channel; export not failed)", e);
    // fallback: data loss accepted by design, spans already stored
}

Prevention

When it happens

Trigger: uriStatService.store(otlpTraceMapperData.getUriStatSpanList()) throws when the uriStat service bean is configured — typically a failure in the uriStat storage pipeline.

Common situations: URI-stat backend (e.g. Pinot/web-backend pipeline) unreachable or queue full; misconfigured optional uriStat module; deserialization/schema mismatch after version change.

Related errors


AI-assisted analysis of pinpoint-apm/pinpoint@744c3d3075 (2026-09-07). Data as JSON: /api/errors/42c1406860e79af7. Report an issue: GitHub.

Appendix: source

Thrown at otlptrace/otlptrace-collector/src/main/java/com/navercorp/pinpoint/otlp/trace/collector/service/OtlpTraceExportService.java:200

        if (exceptionMetaDataService != null) {
            for (ExceptionMetaDataBo exceptionMetaDataBo : otlpTraceMapperData.getExceptionMetaDataBoList()) {
                try {
                    exceptionMetaDataService.save(exceptionMetaDataBo);
                } catch (Exception e) {
                    exceptionInsertErrorCounter.increment();
                    throttledLogger.warn("Failed to insert exceptionMetaData", e);
                }
            }
        }

        // Optional statistics side channel: a uriStat failure must not fail the trace export, so it
        // is not counted toward serverErrorCount (spans are already stored at this point).
        if (uriStatService != null) {
            try {
                uriStatService.store(otlpTraceMapperData.getUriStatSpanList());
            } catch (Exception e) {
                uriStatInsertErrorCounter.increment();
                throttledLogger.warn("Failed to insert uriStat", e);
            }
        }

        final int serverErrorCount = insertErrorCount + agentInfoErrorCount;
        return new OtlpTraceExportResult(clientRejected, serverErrorCount, buildServerMessage(insertErrorCount, agentInfoErrorCount));
    }

    private static String buildServerMessage(int insertErrorCount, int agentInfoErrorCount) {
        final StringBuilder sb = new StringBuilder();
        if (insertErrorCount > 0) {
            sb.append("insert error (").append(insertErrorCount).append(')');
        }
        if (agentInfoErrorCount > 0) {
            if (!sb.isEmpty()) {
                sb.append(", ");
            }
            sb.append("agentInfo error (").append(agentInfoErrorCount).append(')');
        }

View on GitHub (pinned to 744c3d3075)