Class OtelCollectorLogs
java.lang.Object
codes.grow.packages.otelcollector.OtelCollectorLogs
OTLP log clients for the collector: a
BatchingLogClient (SPEC section 4) over OtlpLogExporter, with the service resource (service.name, version, environment and the
configured resource attributes) and the configured log batch settings (OTEL_BLRP_*).-
Method Summary
Modifier and TypeMethodDescriptionstatic BatchingLogClientcreateLogClient(OtelCollectorConfig config) A log client exporting OTLP logs to the collector.static BatchingLogClientcreateLogClient(OtelCollectorConfig config, BatchOptions batch) A log client exporting OTLP logs to the collector with explicit batch options.static BatchingLogClient.BuilderlogClientBuilder(OtelCollectorConfig config) A log client builder preset with anOtlpLogExporter, the service resource and the configured batch options; customise redaction, resource or batching beforebuild().static BatchingLogClient.BuilderlogClientBuilder(OtelCollectorConfig config, LogExporter exporter) A log client builder preset likelogClientBuilder(OtelCollectorConfig)with another exporter (tests).
-
Method Details
-
logClientBuilder
A log client builder preset with anOtlpLogExporter, the service resource and the configured batch options; customise redaction, resource or batching beforebuild().- Parameters:
config- collector config- Returns:
- the builder
-
logClientBuilder
public static BatchingLogClient.Builder logClientBuilder(OtelCollectorConfig config, LogExporter exporter) A log client builder preset likelogClientBuilder(OtelCollectorConfig)with another exporter (tests).- Parameters:
config- collector configexporter- exporter- Returns:
- the builder
-
createLogClient
A log client exporting OTLP logs to the collector.- Parameters:
config- collector config- Returns:
- the client (close it to flush)
-
createLogClient
A log client exporting OTLP logs to the collector with explicit batch options.- Parameters:
config- collector configbatch- batch options- Returns:
- the client (close it to flush)
-