Class CapturedHttpHeaders
- java.lang.Object
-
- io.opentelemetry.instrumentation.api.instrumenter.http.CapturedHttpHeaders
-
public abstract class CapturedHttpHeaders extends Object
Represents the configuration that specifies which HTTP request and response headers should be captured as span attributes as described in HTTP semantic conventions.The HTTP request header values will be captured under the
http.request.header.<name>attribute key. The HTTP response header values will be captured under thehttp.response.header.<name>attribute key. The<name>part in the attribute key is the normalized header name: lowercase, with dashes replaced by underscores.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static CapturedHttpHeadersclient(Config config)Returns a configuration that captures HTTP client request and response headers as configured in the receivedconfig.static CapturedHttpHeaderscreate(List<String> capturedRequestHeaders, List<String> capturedResponseHeaders)Returns a configuration that captures chosen HTTP request and response headers.static CapturedHttpHeadersempty()Returns a configuration that does not capture any HTTP headers as span attributes.abstract List<String>requestHeaders()Returns the list of HTTP request header names that are to be captured as span attributes.abstract List<String>responseHeaders()Returns the list of HTTP response header names that are to be captured as span attributes.static CapturedHttpHeadersserver(Config config)Returns a configuration that captures HTTP server request and response headers as configured in the receivedconfig.
-
-
-
Method Detail
-
empty
public static CapturedHttpHeaders empty()
Returns a configuration that does not capture any HTTP headers as span attributes.
-
client
public static CapturedHttpHeaders client(Config config)
Returns a configuration that captures HTTP client request and response headers as configured in the receivedconfig.
-
server
public static CapturedHttpHeaders server(Config config)
Returns a configuration that captures HTTP server request and response headers as configured in the receivedconfig.
-
create
public static CapturedHttpHeaders create(List<String> capturedRequestHeaders, List<String> capturedResponseHeaders)
Returns a configuration that captures chosen HTTP request and response headers.- Parameters:
capturedRequestHeaders- A list of HTTP request header names that are to be captured as span attributes.capturedResponseHeaders- A list of HTTP response header names that are to be captured as span attributes.
-
requestHeaders
public abstract List<String> requestHeaders()
Returns the list of HTTP request header names that are to be captured as span attributes.
-
-