Class HttpCommonTags


  • public class HttpCommonTags
    extends Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static io.micrometer.core.instrument.Tag METHOD_UNKNOWN  
      static io.micrometer.core.instrument.Tag STATUS_RESET  
      (package private) static io.micrometer.core.instrument.Tag STATUS_UNKNOWN  
      static io.micrometer.core.instrument.Tag URI_NOT_FOUND  
      static io.micrometer.core.instrument.Tag URI_REDIRECTION  
      static io.micrometer.core.instrument.Tag URI_ROOT  
      (package private) static io.micrometer.core.instrument.Tag URI_UNKNOWN  
    • Constructor Summary

      Constructors 
      Constructor Description
      HttpCommonTags()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static io.micrometer.core.instrument.Tag method​(String method)
      Creates an method Tag derived from the given HTTP method.
      static io.micrometer.core.instrument.Tag outcome​(int statusCode)
      Creates an outcome Tag derived from the given response code.
      static io.micrometer.core.instrument.Tag status​(int statusCode)
      Creates a status tag based on the status of the given response code.
      static io.micrometer.core.instrument.Tag uri​(String pathInfo, int code)
      Creates a uri tag based on the URI of the given request.
    • Field Detail

      • URI_NOT_FOUND

        public static final io.micrometer.core.instrument.Tag URI_NOT_FOUND
      • URI_REDIRECTION

        public static final io.micrometer.core.instrument.Tag URI_REDIRECTION
      • URI_ROOT

        public static final io.micrometer.core.instrument.Tag URI_ROOT
      • URI_UNKNOWN

        static final io.micrometer.core.instrument.Tag URI_UNKNOWN
      • STATUS_UNKNOWN

        static final io.micrometer.core.instrument.Tag STATUS_UNKNOWN
      • STATUS_RESET

        public static final io.micrometer.core.instrument.Tag STATUS_RESET
      • METHOD_UNKNOWN

        public static final io.micrometer.core.instrument.Tag METHOD_UNKNOWN
    • Constructor Detail

      • HttpCommonTags

        public HttpCommonTags()
    • Method Detail

      • method

        public static io.micrometer.core.instrument.Tag method​(String method)
        Creates an method Tag derived from the given HTTP method.
        Parameters:
        method - the HTTP method
        Returns:
        the method tag
      • status

        public static io.micrometer.core.instrument.Tag status​(int statusCode)
        Creates a status tag based on the status of the given response code.
        Parameters:
        statusCode - the HTTP response code
        Returns:
        the status tag derived from the status of the response
      • outcome

        public static io.micrometer.core.instrument.Tag outcome​(int statusCode)
        Creates an outcome Tag derived from the given response code.
        Parameters:
        statusCode - the HTTP response code
        Returns:
        the outcome tag
      • uri

        public static io.micrometer.core.instrument.Tag uri​(String pathInfo,
                                                            int code)
        Creates a uri tag based on the URI of the given request. Falling back to REDIRECTION for 3xx responses, NOT_FOUND for 404 responses, root for requests with no path info, and UNKNOWN for all other requests.
        Parameters:
        pathInfo - request path
        code - status code of the response
        Returns:
        the uri tag derived from the request