Package jline.streaming
Class OtlpMetricsClient
java.lang.Object
jline.streaming.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).
-
Constructor Summary
ConstructorsConstructorDescriptionOtlpMetricsClient(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. -
Method Summary
Modifier and TypeMethodDescriptionGet the service name configured for this client.booleanCheck if the client is connected and ready.booleansendMetrics(List<SSAMetricPoint> metrics) Send a batch of metrics to the OTLP receiver.voidshutdown()Shutdown the client gracefully.
-
Constructor Details
-
OtlpMetricsClient
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
Create a new OTLP metrics client.- Parameters:
endpoint- The OTLP receiver endpoint in format "host:port"serviceName- The service name to identify this simulationfailOnConnectionError- If true, throw exception on connection failure; if false, use dry-run mode
-
-
Method Details
-
sendMetrics
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
Get the service name configured for this client.- Returns:
- service name
-