Interface HttpServerMetricsTagsContributor.Context

Enclosing interface:
HttpServerMetricsTagsContributor

public static interface HttpServerMetricsTagsContributor.Context
  • Method Summary

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

    • request

      io.vertx.core.http.HttpServerRequest request()
    • response

      io.vertx.core.spi.observability.HttpResponse response()
    • 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.