Class OtlpProperties
java.lang.Object
org.springframework.boot.opentelemetry.autoconfigure.OtlpProperties
@ConfigurationProperties("management.opentelemetry.otlp")
public class OtlpProperties
extends Object
Common configuration properties for OpenTelemetry Protocol (OTLP) exporters.
- Since:
- 4.2.0
- Author:
- Somil Jain
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable OtlpProperties.Compression@Nullable StringmergeHeaders(Map<String, String> signalHeaders) Merges the given signal-specific headers with these common headers.<T> TresolveCompression(@Nullable T signalCompression, T defaultCompression, Function<OtlpProperties.Compression, T> mapper) Resolves the compression to use, falling back to this common compression, mapped throughmapper, whensignalCompressionis not set.@Nullable StringresolveEndpoint(@Nullable String signalEndpoint, @Nullable String path) Resolves the endpoint to use, falling back to this common endpoint (withpathappended) whensignalEndpointis not set.voidsetCompression(@Nullable OtlpProperties.Compression compression) voidsetEndpoint(@Nullable String endpoint)
-
Constructor Details
-
OtlpProperties
public OtlpProperties()
-
-
Method Details
-
getEndpoint
-
setEndpoint
-
getHeaders
-
getCompression
-
setCompression
-
resolveEndpoint
Resolves the endpoint to use, falling back to this common endpoint (withpathappended) whensignalEndpointis not set.- Parameters:
signalEndpoint- the signal-specific endpoint, ornullif not setpath- the path to append to the common endpoint when used as a fallback, ornullif no path should be appended- Returns:
- the resolved endpoint, or
nullif neither endpoint is set
-
mergeHeaders
Merges the given signal-specific headers with these common headers. Entries insignalHeaderstake precedence over common headers with the same key.- Parameters:
signalHeaders- the signal-specific headers- Returns:
- the merged headers
-
resolveCompression
public <T> T resolveCompression(@Nullable T signalCompression, T defaultCompression, Function<OtlpProperties.Compression, T> mapper) Resolves the compression to use, falling back to this common compression, mapped throughmapper, whensignalCompressionis not set.- Type Parameters:
T- the signal-specific compression type- Parameters:
signalCompression- the signal-specific compression, ornullif not setdefaultCompression- the compression to use when neither is setmapper- maps this common compression to the signal-specific type- Returns:
- the resolved compression
-