Class OtlpMetricExporter
java.lang.Object
com.codename1.backend.otel.OtlpMetricExporter
- All Implemented Interfaces:
MetricReader
Exports Metrics over OTLP/HTTP, every
cn1.otel.metrics.intervalMillis (OTEL_METRIC_EXPORT_INTERVAL, one minute
by default), with cumulative temporality.
Configured like the tracer, with the metrics-specific settings taking precedence the way the OpenTelemetry specification says:
| Key | Environment | Default |
|---|---|---|
cn1.otel.metrics.endpoint |
OTEL_EXPORTER_OTLP_METRICS_ENDPOINT |
cn1.otel.endpoint + /v1/metrics |
cn1.otel.metrics.headers |
OTEL_EXPORTER_OTLP_METRICS_HEADERS |
cn1.otel.headers |
cn1.otel.metrics.protocol |
OTEL_EXPORTER_OTLP_METRICS_PROTOCOL |
cn1.otel.protocol |
cn1.otel.metrics.enabled |
true |
OTEL_SDK_DISABLED=true turns it off with the tracer.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
ENABLED
- See Also:
-
ENDPOINT
- See Also:
-
HEADERS
- See Also:
-
PROTOCOL
- See Also:
-
INTERVAL
- See Also:
-
-
Constructor Details
-
OtlpMetricExporter
-
-
Method Details
-
open
Description copied from interface:MetricReaderReads the configuration and starts. Answers false when the deployment has metrics turned off, in which case nothing is started; one that throws must leave nothing started either, and changes nothing it was already doing -- the server does not shut down a reader whose open() failed.- Specified by:
openin interfaceMetricReader- Throws:
IOException
-
export
public boolean export()Sends one export now. Answers whether the collector accepted it. -
shutdown
public void shutdown(int timeoutMillis) Description copied from interface:MetricReaderSends what is left and stops, waiting up totimeoutMillis.- Specified by:
shutdownin interfaceMetricReader
-
status
Exports attempted, failures, and the last error, for the management view.
-