Interface HttpClientUrlTemplateCustomizer


public interface HttpClientUrlTemplateCustomizer
A service provider interface (SPI) for customizing http client url template.
  • Method Summary

    Modifier and Type
    Method
    Description
    <REQUEST> String
    customize(String urlTemplate, REQUEST request, io.opentelemetry.instrumentation.api.semconv.http.HttpClientAttributesGetter<REQUEST,?> getter)
    Customize url template for given request.
  • Method Details

    • customize

      @Nullable <REQUEST> String customize(@Nullable String urlTemplate, REQUEST request, io.opentelemetry.instrumentation.api.semconv.http.HttpClientAttributesGetter<REQUEST,?> getter)
      Customize url template for given request. Typically, the customizer will extract full url from the request and apply some logic (e.g. regex matching) to generate url template. The customizer can choose to override existing url template or skip customization when a url template is already set.
      Parameters:
      urlTemplate - existing url template, can be null
      request - current request
      getter - request attributes getter
      Returns:
      customized url template, or null