Interface RequestListener

  • All Known Implementing Classes:
    HttpServerMetrics

    public interface RequestListener
    A listener of the start and end of a request. Instrumented libraries will call start(Context, Attributes) as early as possible in the processing of a request and end(Context, Attributes) as late as possible when finishing the request. These correspond to the start and end of a span when tracing.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void end​(io.opentelemetry.context.Context context, io.opentelemetry.api.common.Attributes responseAttributes)
      Listener method that is called at the end of a request.
      io.opentelemetry.context.Context start​(io.opentelemetry.context.Context context, io.opentelemetry.api.common.Attributes requestAttributes)
      Listener method that is called at the start of a request.
    • Method Detail

      • start

        io.opentelemetry.context.Context start​(io.opentelemetry.context.Context context,
                                               io.opentelemetry.api.common.Attributes requestAttributes)
        Listener method that is called at the start of a request. If any state needs to be kept between the start and end of the request, e.g., an in-progress span, it should be added to the passed in Context and returned.
      • end

        void end​(io.opentelemetry.context.Context context,
                 io.opentelemetry.api.common.Attributes responseAttributes)
        Listener method that is called at the end of a request.