Class HttpRequestTags

java.lang.Object
io.micrometer.core.instrument.binder.http.HttpRequestTags

@Incubating(since="1.4.0")
public class HttpRequestTags
extends java.lang.Object
Tags for HTTP requests.
Since:
1.4.0
  • Method Summary

    Modifier and Type Method Description
    static Tag exception​(java.lang.Throwable exception)
    Creates a exception tag based on the simple name of the class of the given exception.
    static Tag method​(javax.servlet.http.HttpServletRequest request)
    Creates a method tag based on the method of the given request.
    static Tag outcome​(javax.servlet.http.HttpServletResponse response)
    Creates an outcome tag based on the status of the given response.
    static Tag status​(javax.servlet.http.HttpServletResponse response)
    Creates a status tag based on the status of the given response.

    Methods inherited from class java.lang.Object

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

    • method

      public static Tag method​(javax.servlet.http.HttpServletRequest request)
      Creates a method tag based on the method of the given request.
      Parameters:
      request - the request
      Returns:
      the method tag whose value is a capitalized method (e.g. GET).
    • status

      public static Tag status​(javax.servlet.http.HttpServletResponse response)
      Creates a status tag based on the status of the given response.
      Parameters:
      response - the HTTP response
      Returns:
      the status tag derived from the status of the response
    • exception

      public static Tag exception​(java.lang.Throwable exception)
      Creates a exception tag based on the simple name of the class of the given exception.
      Parameters:
      exception - the exception, may be null
      Returns:
      the exception tag derived from the exception
    • outcome

      public static Tag outcome​(javax.servlet.http.HttpServletResponse response)
      Creates an outcome tag based on the status of the given response.
      Parameters:
      response - the HTTP response
      Returns:
      the outcome tag derived from the status of the response