Package codes.grow.packages.loki
Class LokiOtlpExporter
java.lang.Object
codes.grow.packages.loki.LokiOtlpExporter
- All Implemented Interfaces:
LogExporter
LogExporter that writes OTLP/JSON to POST /otlp/v1/logs. Loki then decides which
resource attributes become labels (its OTLP defaults: service.name,
deployment.environment, …) and stores the rest as structured metadata.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexport(List<LogRecord> records, ExportOptions options) Exports a batch.shutdown()Releases resources.
-
Constructor Details
-
LokiOtlpExporter
Creates an exporter.- Parameters:
client- client (and tenant) to push with
-
-
Method Details
-
export
Description copied from interface:LogExporterExports a batch. The future completes with the accepted/rejected counts; it may also complete exceptionally (treated as "all rejected"). Cancelling the future cancels the export.- Specified by:
exportin interfaceLogExporter- Parameters:
records- records to send (never empty)options- gzip flag and time budget- Returns:
- the export result
-
shutdown
Description copied from interface:LogExporterReleases resources. Called once byBatchProcessor.shutdown.- Specified by:
shutdownin interfaceLogExporter- Returns:
- completes when the exporter is closed
-