{"record":{"id":"42c1406860e79af7","repo":"pinpoint-apm/pinpoint","slug":"failed-to-insert-uristat","errorCode":null,"errorMessage":"Failed to insert uriStat","messagePattern":"Failed to insert uriStat","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"otlptrace/otlptrace-collector/src/main/java/com/navercorp/pinpoint/otlp/trace/collector/service/OtlpTraceExportService.java","lineNumber":200,"sourceCode":"        if (exceptionMetaDataService != null) {\n            for (ExceptionMetaDataBo exceptionMetaDataBo : otlpTraceMapperData.getExceptionMetaDataBoList()) {\n                try {\n                    exceptionMetaDataService.save(exceptionMetaDataBo);\n                } catch (Exception e) {\n                    exceptionInsertErrorCounter.increment();\n                    throttledLogger.warn(\"Failed to insert exceptionMetaData\", e);\n                }\n            }\n        }\n\n        // Optional statistics side channel: a uriStat failure must not fail the trace export, so it\n        // is not counted toward serverErrorCount (spans are already stored at this point).\n        if (uriStatService != null) {\n            try {\n                uriStatService.store(otlpTraceMapperData.getUriStatSpanList());\n            } catch (Exception e) {\n                uriStatInsertErrorCounter.increment();\n                throttledLogger.warn(\"Failed to insert uriStat\", e);\n            }\n        }\n\n        final int serverErrorCount = insertErrorCount + agentInfoErrorCount;\n        return new OtlpTraceExportResult(clientRejected, serverErrorCount, buildServerMessage(insertErrorCount, agentInfoErrorCount));\n    }\n\n    private static String buildServerMessage(int insertErrorCount, int agentInfoErrorCount) {\n        final StringBuilder sb = new StringBuilder();\n        if (insertErrorCount > 0) {\n            sb.append(\"insert error (\").append(insertErrorCount).append(')');\n        }\n        if (agentInfoErrorCount > 0) {\n            if (!sb.isEmpty()) {\n                sb.append(\", \");\n            }\n            sb.append(\"agentInfo error (\").append(agentInfoErrorCount).append(')');\n        }","sourceCodeStart":182,"sourceCodeEnd":218,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/otlptrace/otlptrace-collector/src/main/java/com/navercorp/pinpoint/otlp/trace/collector/service/OtlpTraceExportService.java#L182-L218","documentation":"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.","triggerScenarios":"uriStatService.store(otlpTraceMapperData.getUriStatSpanList()) throws when the uriStat service bean is configured — typically a failure in the uriStat storage pipeline.","commonSituations":"URI-stat backend (e.g. Pinot/web-backend pipeline) unreachable or queue full; misconfigured optional uriStat module; deserialization/schema mismatch after version change.","solutions":["Check the throttled stack trace to identify the uriStat storage failure.","Verify uriStat backend connectivity and topic/table configuration.","Disable the uriStat service if the feature is not used, eliminating the error path.","Monitor uriStatInsertErrorCounter; uriStat data loss here is intentionally non-fatal."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"if (uriStatService == null || otlpTraceMapperData.getUriStatSpanList().isEmpty()) {\n    return; // uriStat is optional; skip when unconfigured or empty\n}","typeGuard":null,"tryCatchPattern":"try {\n    uriStatService.store(otlpTraceMapperData.getUriStatSpanList());\n} catch (Exception e) {\n    uriStatInsertErrorCounter.increment();\n    logger.warn(\"Failed to insert uriStat (side channel; export not failed)\", e);\n    // fallback: data loss accepted by design, spans already stored\n}","preventionTips":["Treat uriStat as best-effort; design dashboards to tolerate gaps.","Verify uriStat backend (topic/table) config before enabling the optional service.","Alert on uriStatInsertErrorCounter trends instead of export failures.","After upgrades, re-validate uriStat serialization schema compatibility."],"tags":["uristat","optional-feature","export-failure"],"backgroundTag":"database-write-failed","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"}