Class OpenTelemetryExporter.Builder
- Enclosing class:
OpenTelemetryExporter
-
Method Summary
Modifier and TypeMethodDescriptionThe OTLP endpoint to send metric data to.Add an HTTP header to be applied to outgoing requests.intervalSeconds(int intervalSeconds) The interval between the start of two export attempts.Specifies the OTLP transport protocol to be used when exporting metrics.registry(PrometheusRegistry registry) resourceAttribute(String name, String value) Add a resource attribute.serviceInstanceId(String serviceInstanceId) Theservice.instance.idresource attribute.serviceName(String serviceName) Theservice.nameresource attribute.serviceNamespace(String serviceNamespace) Theservice.namespaceresource attribute.serviceVersion(String serviceVersion) Theservice.versionresource attribute.timeoutSeconds(int timeoutSeconds) The timeout for outgoing requests.
-
Method Details
-
registry
-
protocol
Specifies the OTLP transport protocol to be used when exporting metrics.Supported values are
"grpc"and"http/protobuf". Default is"grpc".See OpenTelemetry's OTEL_EXPORTER_OTLP_PROTOCOL.
-
endpoint
The OTLP endpoint to send metric data to.The default depends on the protocol:
"grpc":"http://localhost:4317""http/protobuf":"http://localhost:4318/v1/metrics"
"http/protobuf"and the endpoint does not have the"/v1/metrics"suffix, the"/v1/metrics"suffix will automatically be appended.See OpenTelemetry's OTEL_EXPORTER_OTLP_METRICS_ENDPOINT.
-
header
Add an HTTP header to be applied to outgoing requests. Call multiple times to add multiple headers.See OpenTelemetry's OTEL_EXPORTER_OTLP_HEADERS.
-
intervalSeconds
The interval between the start of two export attempts. Default is 60000.Like OpenTelemetry's OTEL_METRIC_EXPORT_INTERVAL, but in seconds rather than milliseconds.
-
timeoutSeconds
The timeout for outgoing requests. Default is 10.Like OpenTelemetry's OTEL_EXPORTER_OTLP_METRICS_TIMEOUT, but in seconds rather than milliseconds.
-
serviceName
Theservice.nameresource attribute.If not explicitly specified,
client_javawill try to initialize it with a reasonable default, like the JAR file name.See
service.namein OpenTelemetry's Resource Semantic Conventions. -
serviceNamespace
Theservice.namespaceresource attribute.See
service.namespacein OpenTelemetry's Resource Semantic Conventions. -
serviceInstanceId
Theservice.instance.idresource attribute.See
service.instance.idin OpenTelemetry's Resource Semantic Conventions. -
serviceVersion
Theservice.versionresource attribute.See
service.versionin OpenTelemetry's Resource Semantic Conventions. -
resourceAttribute
Add a resource attribute. Call multiple times to add multiple resource attributes.See OpenTelemetry's OTEL_RESOURCE_ATTRIBUTES.
-
buildAndStart
-