Class SignozLogExporter

java.lang.Object
codes.grow.packages.signoz.SignozLogExporter
All Implemented Interfaces:
LogExporter, AutoCloseable

public final class SignozLogExporter extends Object implements 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 Details

    • create

      public static SignozLogExporter create(SignozConfig config)
      Builds an exporter from the configuration (otlpEndpoint, otlpProtocol, ingestionKey, TLS, proxy, headers, timeouts, hooks and logger).
      Parameters:
      config - configuration
      Returns:
      the exporter
    • otlpHttpUrl

      public static String otlpHttpUrl(String endpoint, String signal)
      Appends /v1/<signal> to the endpoint path unless it already ends with it.
      Parameters:
      endpoint - collector endpoint
      signal - logs or traces
      Returns:
      the OTLP/HTTP URL
    • protocol

      public OtlpProtocol protocol()
      Returns the protocol.
      Returns:
      the protocol
    • endpoint

      public String endpoint()
      Returns the export URL (OTLP/HTTP) or the collector endpoint (gRPC).
      Returns:
      the endpoint
    • export

      public CompletableFuture<ExportResult> export(List<LogRecord> records, ExportOptions options)
      Sends one batch.
      Specified by:
      export in interface LogExporter
      Parameters:
      records - records
      options - gzip flag and time budget
      Returns:
      a future result (rejected records from a partial success)
    • shutdown

      public CompletableFuture<Void> shutdown()
      Closes connections. Idempotent.
      Specified by:
      shutdown in interface LogExporter
      Returns:
      a completed future
    • close

      public void close()
      Same as shutdown().
      Specified by:
      close in interface AutoCloseable
    • toString

      public String toString()
      Overrides:
      toString in class Object