Class HttpServerMetrics

java.lang.Object
io.opentelemetry.instrumentation.api.semconv.http.HttpServerMetrics
All Implemented Interfaces:
OperationListener

public final class HttpServerMetrics extends Object implements OperationListener
Since:
2.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    get()
    Returns an OperationMetrics instance which can be used to enable recording of HttpServerMetrics.
    void
    onEnd(io.opentelemetry.context.Context context, io.opentelemetry.api.common.Attributes endAttributes, long endNanos)
    Listener method that is called at the end of an instrumented operation.
    io.opentelemetry.context.Context
    onStart(io.opentelemetry.context.Context context, io.opentelemetry.api.common.Attributes startAttributes, long startNanos)
    Listener method that is called at the start of an instrumented operation.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • get

      public static OperationMetrics get()
      Returns an OperationMetrics instance which can be used to enable recording of HttpServerMetrics.
      See Also:
    • onStart

      public io.opentelemetry.context.Context onStart(io.opentelemetry.context.Context context, io.opentelemetry.api.common.Attributes startAttributes, long startNanos)
      Description copied from interface: OperationListener
      Listener method that is called at the start of an instrumented operation. If any state needs to be kept between the start and end of the processing, e.g., an in-progress span, it should be added to the passed in Context and returned.
      Specified by:
      onStart in interface OperationListener
      Parameters:
      startNanos - The nanosecond timestamp marking the start of the operation. Can be used to compute the duration of the entire operation.
    • onEnd

      public void onEnd(io.opentelemetry.context.Context context, io.opentelemetry.api.common.Attributes endAttributes, long endNanos)
      Description copied from interface: OperationListener
      Listener method that is called at the end of an instrumented operation.
      Specified by:
      onEnd in interface OperationListener
      Parameters:
      endNanos - The nanosecond timestamp marking the end of the operation. Can be used to compute the duration of the entire operation.