tsqtsq - v1.4.0
    Preparing search index...

    Function prettify

    • Pretty-prints a PromQL expression by breaking parenthesized groups and binary operations that exceed the maximum line width onto indented lines. Expressions that fit on a single line are returned unchanged.

      The expression is parsed with @prometheus-io/lezer-promql. Grafana template variables (e.g. $__rate_interval, ${cluster}) are supported even though they are not valid PromQL. Throws if the expression cannot be parsed or if the options are invalid.

      prettify({ expr: promql.sum({ expr: '...', by: ['cluster'] }) });
      

      Parameters

      Returns string