io.prometheus.metrics.config.ExporterOpenTelemetryProperties Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jmx_prometheus_httpserver Show documentation
Show all versions of jmx_prometheus_httpserver Show documentation
See https://github.com/prometheus/jmx_exporter/blob/master/README.md
package io.prometheus.metrics.config;
import java.util.HashMap;
import java.util.Map;
// TODO: JavaDoc is currently only in OpenTelemetryExporter.Builder. Look there for reference.
public class ExporterOpenTelemetryProperties {
// See https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk-extensions/autoconfigure/README.md
private static String PROTOCOL = "protocol"; // otel.exporter.otlp.protocol
private static String ENDPOINT = "endpoint"; // otel.exporter.otlp.endpoint
private static String HEADERS = "headers"; // otel.exporter.otlp.headers
private static String INTERVAL_SECONDS = "intervalSeconds"; // otel.metric.export.interval
private static String TIMEOUT_SECONDS = "timeoutSeconds"; // otel.exporter.otlp.timeout
private static String SERVICE_NAME = "serviceName"; // otel.service.name
private static String SERVICE_NAMESPACE = "serviceNamespace";
private static String SERVICE_INSTANCE_ID = "serviceInstanceId";
private static String SERVICE_VERSION = "serviceVersion";
private static String RESOURCE_ATTRIBUTES = "resourceAttributes"; // otel.resource.attributes
private final String protocol;
private final String endpoint;
private final Map headers;
private final Integer intervalSeconds;
private final Integer timeoutSeconds;
private final String serviceName;
private final String serviceNamespace;
private final String serviceInstanceId;
private final String serviceVersion;
private final Map resourceAttributes;
private ExporterOpenTelemetryProperties(String protocol, String endpoint, Map headers, Integer intervalSeconds, Integer timeoutSeconds, String serviceName, String serviceNamespace, String serviceInstanceId, String serviceVersion, Map resourceAttributes) {
this.protocol = protocol;
this.endpoint = endpoint;
this.headers = headers;
this.intervalSeconds = intervalSeconds;
this.timeoutSeconds = timeoutSeconds;
this.serviceName = serviceName;
this.serviceNamespace = serviceNamespace;
this.serviceInstanceId = serviceInstanceId;
this.serviceVersion = serviceVersion;
this.resourceAttributes = resourceAttributes;
}
public String getProtocol() {
return protocol;
}
public String getEndpoint() {
return endpoint;
}
public Map getHeaders() {
return headers;
}
public Integer getIntervalSeconds() {
return intervalSeconds;
}
public Integer getTimeoutSeconds() {
return timeoutSeconds;
}
public String getServiceName() {
return serviceName;
}
public String getServiceNamespace() {
return serviceNamespace;
}
public String getServiceInstanceId() {
return serviceInstanceId;
}
public String getServiceVersion() {
return serviceVersion;
}
public Map getResourceAttributes() {
return resourceAttributes;
}
/**
* Note that this will remove entries from {@code properties}.
* This is because we want to know if there are unused properties remaining after all properties have been loaded.
*/
static ExporterOpenTelemetryProperties load(String prefix, Map
© 2015 - 2025 Weber Informatics LLC | Privacy Policy