Interface AttributesExtractor<REQUEST,​RESPONSE>

    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      static <REQUEST,​RESPONSE,​T>
      AttributesExtractor<REQUEST,​RESPONSE>
      constant​(io.opentelemetry.api.common.AttributeKey<T> attributeKey, T attributeValue)
      Returns an AttributesExtractor implementation that always extracts the provided constant value.
      void onEnd​(io.opentelemetry.api.common.AttributesBuilder attributes, REQUEST request, RESPONSE response, Throwable error)
      Extracts attributes from the AttributesExtractor and either AttributesExtractor or error into the AttributesBuilder at the end of a request.
      void onStart​(io.opentelemetry.api.common.AttributesBuilder attributes, REQUEST request)
      Extracts attributes from the AttributesExtractor into the AttributesBuilder at the beginning of a request.
      default <T> void set​(io.opentelemetry.api.common.AttributesBuilder attributes, io.opentelemetry.api.common.AttributeKey<T> key, T value)
      Sets the value with the given key to the AttributesBuilder if value is not null.
    • Method Detail

      • onStart

        void onStart​(io.opentelemetry.api.common.AttributesBuilder attributes,
                     REQUEST request)
        Extracts attributes from the AttributesExtractor into the AttributesBuilder at the beginning of a request.
      • set

        default <T> void set​(io.opentelemetry.api.common.AttributesBuilder attributes,
                             io.opentelemetry.api.common.AttributeKey<T> key,
                             @Nullable
                             T value)
        Sets the value with the given key to the AttributesBuilder if value is not null.
      • constant

        static <REQUEST,​RESPONSE,​T> AttributesExtractor<REQUEST,​RESPONSE> constant​(io.opentelemetry.api.common.AttributeKey<T> attributeKey,
                                                                                                     T attributeValue)
        Returns an AttributesExtractor implementation that always extracts the provided constant value.