Package jline.streaming
Class OtlpMetricsClient
-
- All Implemented Interfaces:
public class OtlpMetricsClientOTLP 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).
-
-
Field Summary
Fields Modifier and Type Field Description public final StringserviceName
-
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.
-
Method Summary
Modifier and Type Method Description StringgetServiceName()Get the service name configured for this client. booleansendMetrics(List<SSAMetricPoint> metrics)Send a batch of metrics to the OTLP receiver. booleanisConnected()Check if the client is connected and ready. voidshutdown()Shutdown the client gracefully. -
-
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 simulationfailOnConnectionError- 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.
-
-
-
-