Package 

Class OkHttpInstrumentationConfig

    • Method Detail

      • setCapturedRequestHeaders

         static void setCapturedRequestHeaders(List<String> requestHeaders)

        Configures the HTTP request headers that will be captured as span attributes as described inHTTPsemantic conventions.

        The HTTP request header values will be captured under the {@code * http.request.header.} attribute key. The {@code } part in the attribute key isthe normalized header name: lowercase, with dashes replaced by underscores.

        Parameters:
        requestHeaders - A list of HTTP header names.
      • setCapturedResponseHeaders

         static void setCapturedResponseHeaders(List<String> responseHeaders)

        Configures the HTTP response headers that will be captured as span attributes as described inHTTPsemantic conventions.

        The HTTP response header values will be captured under the {@code * http.response.header.} attribute key. The {@code } part in the attribute key isthe normalized header name: lowercase, with dashes replaced by underscores.

        Parameters:
        responseHeaders - A list of HTTP header names.
      • setKnownMethods

         static void setKnownMethods(Set<String> knownMethods)

        Configures the attrs extractor to recognize an alternative set of HTTP request methods.

        By default, the extractor defines "known" methods as the ones listed in RFC9110 and the PATCHmethod defined in . If anunknown method is encountered, the extractor will use the value {@value HttpConstants#_OTHER} instead of it and put the original value in an extra attribute.

        Note: calling this method overrides the default known method sets completely; itdoes not supplement it.

        Parameters:
        knownMethods - A set of recognized HTTP request methods.
      • setPeerServiceMapping

         static void setPeerServiceMapping(Map<String, String> peerServiceMapping)

        Configures the extractor of the {@code peer.service} span attribute, described in thespecification.

      • setEmitExperimentalHttpClientMetrics

         static void setEmitExperimentalHttpClientMetrics(boolean emitExperimentalHttpClientMetrics)

        When enabled keeps track of non-stableHTTP client metrics: