Class HttpClientRequestResendCount

java.lang.Object
io.opentelemetry.instrumentation.api.semconv.http.HttpClientRequestResendCount

public final class HttpClientRequestResendCount extends Object
A helper that keeps track of the count of the HTTP request resend attempts.
Since:
2.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    get(io.opentelemetry.context.Context context)
    Returns the count of the already made attempts to send an HTTP request; 0 if this is the first send attempt.
    static io.opentelemetry.context.Context
    initialize(io.opentelemetry.context.Context context)
    Initializes the HTTP request resend counter.

    Methods inherited from class java.lang.Object

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

    • initialize

      public static io.opentelemetry.context.Context initialize(io.opentelemetry.context.Context context)
      Initializes the HTTP request resend counter.

      Note that this must be called on a context that is the parent of all the outgoing HTTP request send attempts; this class is meant to be used before the Instrumenter is used, so that the resend counter is shared across all the resends.

    • get

      public static int get(io.opentelemetry.context.Context context)
      Returns the count of the already made attempts to send an HTTP request; 0 if this is the first send attempt.