Package dev.dokimos.server.service
Class OtlpTraceParser
java.lang.Object
dev.dokimos.server.service.OtlpTraceParser
Pure translation from the OTLP/HTTP JSON request DTOs into the server's own span model, with no
persistence. Malformed spans (missing a trace id, span id, or name) are skipped non-fatally and
reported through the
OtlpTraceParser.Result counters so one bad span never fails the whole batch. Resource
attributes are merged onto each span so a project-name attribute on the resource is visible to rule
matching and to project resolution.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA span translated from OTLP, carrying the merged attributes and derived input/output text.static final recordThe outcome of parsing: the valid spans and the count of malformed spans that were skipped. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionparse(OtlpExportTraceServiceRequest request) Flattens the request into parsed spans, skipping malformed ones.
-
Constructor Details
-
OtlpTraceParser
public OtlpTraceParser()
-
-
Method Details
-
parse
Flattens the request into parsed spans, skipping malformed ones.- Parameters:
request- the decoded OTLP request- Returns:
- the parsed spans and the count of rejected (malformed) spans
-