Class ConfluenceMonitoringNameGenerationRule

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

public class ConfluenceMonitoringNameGenerationRule extends Object
  • Constructor Details

    • ConfluenceMonitoringNameGenerationRule

      public ConfluenceMonitoringNameGenerationRule(String regex)
    • ConfluenceMonitoringNameGenerationRule

      public ConfluenceMonitoringNameGenerationRule(String regex, String nameToGenerate)
    • ConfluenceMonitoringNameGenerationRule

      public ConfluenceMonitoringNameGenerationRule(Pattern patternToMatch)
    • ConfluenceMonitoringNameGenerationRule

      public ConfluenceMonitoringNameGenerationRule(Pattern pattern, String nameToGenerate)
  • Method Details

    • generateName

      public String generateName(String input)
      Attempts to generate a low-cardinality monitoring name for the provided input by applying this rule's pattern.

      Behavior depends on how this rule was constructed:

      • Default rule (regex only): when the pattern matches, the first capturing group is used as the base name, and the method returns "group-1.%". The pattern MUST define at least one capturing group.
      • Named rule (regex + name): when the pattern matches, the provided constant name is used as the base name, and the method returns "name.%".
      If the pattern does not match, the original input is returned unchanged so that callers may fall back or try additional rules.
      Parameters:
      input - the request path (context-path stripped) to classify; must not be null
      Returns:
      a normalized monitoring name such as "download.%" or "display.SPACE.%" if this rule matches; otherwise the original input
    • getNameGenerationStrategy

      public static ConfluenceMonitoringNameGenerationRule getNameGenerationStrategy(String regex)
    • getNameGenerationStrategy

      public static ConfluenceMonitoringNameGenerationRule getNameGenerationStrategy(String regex, String nameToGenerate)