Class OtlpMetricsClient

  • All Implemented Interfaces:

    
    public class OtlpMetricsClient
    
                        

    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).

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      public final String serviceName
    • Constructor Summary

      Constructors 
      Constructor Description
      OtlpMetricsClient(String endpoint, String serviceName) Create a new OTLP metrics client (dry-run mode allowed on connection failure).
      OtlpMetricsClient(String endpoint, String serviceName, boolean failOnConnectionError) Create a new OTLP metrics client.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      String getServiceName() Get the service name configured for this client.
      boolean sendMetrics(List<SSAMetricPoint> metrics) Send a batch of metrics to the OTLP receiver.
      boolean isConnected() Check if the client is connected and ready.
      void shutdown() Shutdown the client gracefully.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • OtlpMetricsClient

        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

        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 Detail

      • getServiceName

         String getServiceName()

        Get the service name configured for this client.

        Returns:

        service name

      • sendMetrics

         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

         boolean isConnected()

        Check if the client is connected and ready.

        Returns:

        true if connected

      • shutdown

         void shutdown()

        Shutdown the client gracefully. Waits up to 5 seconds for pending operations.