Interface HttpServerMetricsTagsContributor.Context

Enclosing interface:
HttpServerMetricsTagsContributor

public static interface HttpServerMetricsTagsContributor.Context
  • Method Summary

    Modifier and Type
    Method
    Description
    io.vertx.core.http.HttpServerRequest
    Represents the HTTP requests
    <T> T
    Gives access to the contextual data that was added while the HTTP request was active.
    Optional<io.vertx.core.spi.observability.HttpResponse>
    Represents the HTTP response, if one exists.
  • Method Details

    • request

      io.vertx.core.http.HttpServerRequest request()
      Represents the HTTP requests
    • response

      Optional<io.vertx.core.spi.observability.HttpResponse> response()
      Represents the HTTP response, if one exists. This is Optional because HttpServerMetricsTagsContributor.contribute(Context) is called in both cases where the HTTP request has been completed and when the request was reset (so no respose exists)
    • requestContextLocalData

      <T> T requestContextLocalData(Object key)
      Gives access to the contextual data that was added while the HTTP request was active. This can be found of doing something like ContextLocals.get(String), however this method is needed because ContextLocals.get(String) won't work when HttpServerMetricsTagsContributor.contribute(Context) is called as the HTTP request has already gone away.

      Beware of high cardinality causing memory usage increase.

      Don't use keys that might hold many different values (more than a few dozens). The problem is not just about the current request but the combination of different values from all the requests the server will receive.