Class OtlpOutput

java.lang.Object
io.jstach.rainbowgum.otlp.OtlpOutput
All Implemented Interfaces:
LogLifecycle, LogOutput, LogOutput.ProvidesEncoder, Flushable, AutoCloseable

public final class OtlpOutput extends Object implements LogOutput, LogOutput.ProvidesEncoder
Sends log events to an OTLP/HTTP endpoint (/v1/logs) as protobuf (the default) or JSON, without the OpenTelemetry SDK or a protobuf library.

Events are buffered and sent as one request per flush(), and as soon as maxBatchSize events are pending. Use an asynchronous publisher: with the default synchronous one every log call waits for its own HTTP request. HTTP 429, 502, 503, and 504 responses and network errors are retried up to three times with exponential backoff with jitter, honoring Retry-After. The timeout bounds the whole export, including retries and response-body reads. A batch that still fails is dropped, recorded as an error alert, and counted in "otlp.records.failed". Records the endpoint reports as rejected (partial success) are a warning alert and counted in "otlp.records.rejected".

This output encodes events itself, so it does not use an appender encoder. Records have the same content as OtlpJsonEncoder produces.