![JAR search and dependency download from the Maven repository](/logo.png)
io.opentelemetry.exporter.otlp.internal.OtlpUserAgent Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of opentelemetry-exporter-otlp Show documentation
Show all versions of opentelemetry-exporter-otlp Show documentation
OpenTelemetry Protocol (OTLP) Exporters
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/
package io.opentelemetry.exporter.otlp.internal;
import io.opentelemetry.sdk.common.internal.OtelVersion;
import java.util.function.BiConsumer;
/**
* This class is internal and is hence not for public use. Its APIs are unstable and can change at
* any time.
*/
public final class OtlpUserAgent {
private static final String userAgent = "OTel-OTLP-Exporter-Java/" + OtelVersion.VERSION;
/**
* Return an OTLP {@code User-Agent} header value of the form {@code "OTel OTLP Exporter
* Java/{version}"}.
*
* @see OTLP
* Exporter User Agent
*/
public static String getUserAgent() {
return userAgent;
}
/**
* Call the {@code consumer with} an OTLP {@code User-Agent} header value of the form {@code "OTel
* OTLP Exporter Java/{version}"}.
*
* @see OTLP
* Exporter User Agent
*/
public static void addUserAgentHeader(BiConsumer consumer) {
consumer.accept("User-Agent", userAgent);
}
private OtlpUserAgent() {}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy