Interface TelemetryProvider

All Known Implementing Classes:
TelemetryProvider.NoopTelemetryProvider

public interface TelemetryProvider
  • Field Details

  • Method Details

    • getTracer

      Tracer getTracer()
    • getMeterRegistry

      MeterRegistry getMeterRegistry()
    • attemptFlushMetrics

      void attemptFlushMetrics()
      Ensures buffered metrics are exported. Implementations should flush the meter provider they own (e.g. OTel SdkMeterProvider) or wait for the next Elastic APM Java agent export cycle.

      When metrics are backed by the Elastic APM agent, there is no flush API: the implementation only waits a bounded interval derived from telemetry.agent.metrics_interval. The first HTTP request to the configured APM server can still arrive much later (agent reporter scheduling), so callers that need observable export must allow additional wall-clock time beyond this method.

    • attemptFlushTraces

      void attemptFlushTraces()
      Ensures buffered traces are exported. Implementations should flush the tracer provider they own (e.g. OTel SdkTracerProvider) or wait for the next agent export cycle.