Package codes.grow.packages.signoz
Class SignozLogExporter
java.lang.Object
codes.grow.packages.signoz.SignozLogExporter
- All Implemented Interfaces:
LogExporter,AutoCloseable
LogExporter that sends records to the SigNoz collector over OTLP/HTTP protobuf (
POST <endpoint>/v1/logs) or OTLP/gRPC (LogsService/Export), with the
signoz-ingestion-key header when an ingestion key is configured. Retries are left to the
BatchProcessor; a collector partial success is reported as rejected records with a
ValidationException. No API key is needed.-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Same asshutdown().static SignozLogExportercreate(SignozConfig config) Builds an exporter from the configuration (otlpEndpoint,otlpProtocol,ingestionKey, TLS, proxy, headers, timeouts, hooks and logger).endpoint()Returns the export URL (OTLP/HTTP) or the collector endpoint (gRPC).export(List<LogRecord> records, ExportOptions options) Sends one batch.static StringotlpHttpUrl(String endpoint, String signal) Appends/v1/<signal>to the endpoint path unless it already ends with it.protocol()Returns the protocol.shutdown()Closes connections.toString()
-
Method Details
-
create
Builds an exporter from the configuration (otlpEndpoint,otlpProtocol,ingestionKey, TLS, proxy, headers, timeouts, hooks and logger).- Parameters:
config- configuration- Returns:
- the exporter
-
otlpHttpUrl
Appends/v1/<signal>to the endpoint path unless it already ends with it.- Parameters:
endpoint- collector endpointsignal-logsortraces- Returns:
- the OTLP/HTTP URL
-
protocol
Returns the protocol.- Returns:
- the protocol
-
endpoint
Returns the export URL (OTLP/HTTP) or the collector endpoint (gRPC).- Returns:
- the endpoint
-
export
Sends one batch.- Specified by:
exportin interfaceLogExporter- Parameters:
records- recordsoptions- gzip flag and time budget- Returns:
- a future result (rejected records from a partial success)
-
shutdown
Closes connections. Idempotent.- Specified by:
shutdownin interfaceLogExporter- Returns:
- a completed future
-
close
public void close()Same asshutdown().- Specified by:
closein interfaceAutoCloseable
-
toString
-