Class OtlpMetricsClient

java.lang.Object
jline.streaming.OtlpMetricsClient

public class OtlpMetricsClient extends Object
OTLP gRPC client for sending metrics to line-est receiver. Uses OpenTelemetry protobuf format for metric export. This client is Java 8 compatible and connects to line-est's OtlpMetricsReceiver on the configured endpoint (default: localhost:4317).
  • Constructor Details

    • OtlpMetricsClient

      public OtlpMetricsClient(String endpoint, String serviceName)
      Create a new OTLP metrics client (dry-run mode allowed on connection failure).
      Parameters:
      endpoint - The OTLP receiver endpoint in format "host:port"
      serviceName - The service name to identify this simulation
    • OtlpMetricsClient

      public OtlpMetricsClient(String endpoint, String serviceName, boolean failOnConnectionError)
      Create a new OTLP metrics client.
      Parameters:
      endpoint - The OTLP receiver endpoint in format "host:port"
      serviceName - The service name to identify this simulation
      failOnConnectionError - If true, throw exception on connection failure; if false, use dry-run mode
  • Method Details

    • sendMetrics

      public boolean sendMetrics(List<SSAMetricPoint> metrics)
      Send a batch of metrics to the OTLP receiver.
      Parameters:
      metrics - List of metric points to send
      Returns:
      true if successful, false otherwise
    • isConnected

      public boolean isConnected()
      Check if the client is connected and ready.
      Returns:
      true if connected
    • shutdown

      public void shutdown()
      Shutdown the client gracefully. Waits up to 5 seconds for pending operations.
    • getServiceName

      public String getServiceName()
      Get the service name configured for this client.
      Returns:
      service name