Class InstrumentationConfigUtil
java.lang.Object
io.opentelemetry.api.incubator.config.InstrumentationConfigUtil
A collection of convenience methods to extract instrumentation config from
ConfigProvider.getInstrumentationConfig().-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TgetOrNull(ConfigProvider configProvider, Function<DeclarativeConfigProperties, T> accessor, String... segments) Walk down thesegmentsofConfigProvider.getInstrumentationConfig()and callaccessoron the terminal node.httpClientRequestCapturedHeaders(ConfigProvider configProvider) Return.instrumentation.general.http.client.request_captured_headers, or null if none is configured.httpClientResponseCapturedHeaders(ConfigProvider configProvider) Return.instrumentation.general.http.client.response_captured_headers, or null if none is configured.httpServerRequestCapturedHeaders(ConfigProvider configProvider) Return.instrumentation.general.http.server.request_captured_headers, or null if none is configured.httpSeverResponseCapturedHeaders(ConfigProvider configProvider) Return.instrumentation.general.http.server.response_captured_headers, or null if none is configured.static DeclarativeConfigPropertiesjavaInstrumentationConfig(ConfigProvider configProvider, String instrumentationName) Return.instrumentation.java.<instrumentationName>, or null if none is configured.peerServiceMapping(ConfigProvider configProvider) Return a map representation of the peer service map entries in.instrumentation.general.peer.service_mapping, or null if none is configured.
-
Method Details
-
peerServiceMapping
Return a map representation of the peer service map entries in.instrumentation.general.peer.service_mapping, or null if none is configured.- Throws:
DeclarativeConfigException- if an unexpected type is encountered accessing the property
-
httpClientRequestCapturedHeaders
@Nullable public static List<String> httpClientRequestCapturedHeaders(ConfigProvider configProvider) Return.instrumentation.general.http.client.request_captured_headers, or null if none is configured.- Throws:
DeclarativeConfigException- if an unexpected type is encountered accessing the property
-
httpClientResponseCapturedHeaders
@Nullable public static List<String> httpClientResponseCapturedHeaders(ConfigProvider configProvider) Return.instrumentation.general.http.client.response_captured_headers, or null if none is configured.- Throws:
DeclarativeConfigException- if an unexpected type is encountered accessing the property
-
httpServerRequestCapturedHeaders
@Nullable public static List<String> httpServerRequestCapturedHeaders(ConfigProvider configProvider) Return.instrumentation.general.http.server.request_captured_headers, or null if none is configured.- Throws:
DeclarativeConfigException- if an unexpected type is encountered accessing the property
-
httpSeverResponseCapturedHeaders
@Nullable public static List<String> httpSeverResponseCapturedHeaders(ConfigProvider configProvider) Return.instrumentation.general.http.server.response_captured_headers, or null if none is configured.- Throws:
DeclarativeConfigException- if an unexpected type is encountered accessing the property
-
javaInstrumentationConfig
@Nullable public static DeclarativeConfigProperties javaInstrumentationConfig(ConfigProvider configProvider, String instrumentationName) Return.instrumentation.java.<instrumentationName>, or null if none is configured.- Throws:
DeclarativeConfigException- if an unexpected type is encountered accessing the property
-
getOrNull
@Nullable public static <T> T getOrNull(ConfigProvider configProvider, Function<DeclarativeConfigProperties, T> accessor, String... segments) Walk down thesegmentsofConfigProvider.getInstrumentationConfig()and callaccessoron the terminal node. Returns null ifConfigProvider.getInstrumentationConfig()is null, or if null is encountered walking thesegments, or ifaccessorreturns null.See other methods in
InstrumentationConfigUtilfor usage examples.
-