Class ConfluenceMonitoringNameGenerationParser

java.lang.Object
com.atlassian.confluence.util.profiling.ConfluenceMonitoringNameGenerationParser

public class ConfluenceMonitoringNameGenerationParser extends Object
  • Constructor Details

    • ConfluenceMonitoringNameGenerationParser

      public ConfluenceMonitoringNameGenerationParser()
  • Method Details

    • parseRequestUriForMonitoringName

      public static String parseRequestUriForMonitoringName(String uri)
      Determines the monitoring bucket name for a given request URI.

      The parser applies a sequence of rules to derive a low-cardinality name suitable for metrics. Evaluation order:

      1. Prefix rule (PREFIX_STRATEGY): collapses well-known top-level paths (e.g. s, x, display/SPACE, download, images, plugins/servlet, questions, REST version/root, rpc/trackback) into a normalized form of the first matching prefix, returned as "prefix.%".
      2. Custom rules (e.g. user space and combined label browsing): if the prefix rule does not apply, each custom rule is evaluated in order; the first rule that matches returns its normalized name (either a captured group or a constant), also formatted as "name.%".
      If no rule matches, the original URI is returned unchanged so that upstream callers can decide how to post-process (e.g. replace '/' with '.').
      Parameters:
      uri - the request path (context-path stripped) to classify, beginning with '/'; must not be null
      Returns:
      a low-cardinality monitoring name such as "s.%", "display.SPACE.%", "label.tag.%" when a rule matches; otherwise the original uri