Skip to content

prometheus

grafonnet.query.prometheus

Index

Fields

fn new

new(datasource, expr)

PARAMETERS:

  • datasource (string)
  • expr (string)

Creates a new prometheus query target for panels.

fn withDatasource

withDatasource(value)

PARAMETERS:

  • value (string)

Set the datasource for this query.

fn withEditorMode

withEditorMode(value)

PARAMETERS:

  • value (string)
    • valid values: "code", "builder"

fn withExemplar

withExemplar(value=true)

PARAMETERS:

  • value (boolean)
    • default value: true

Execute an additional query to identify interesting raw samples relevant for the given expr

fn withExpr

withExpr(value)

PARAMETERS:

  • value (string)

The actual expression/query that will be evaluated by Prometheus

fn withFormat

withFormat(value)

PARAMETERS:

  • value (string)
    • valid values: "time_series", "table", "heatmap"

fn withHide

withHide(value=true)

PARAMETERS:

  • value (boolean)
    • default value: true

true if query is disabled (ie should not be returned to the dashboard) Note this does not always imply that the query should not be executed since the results from a hidden query may be used as the input to other queries (SSE etc)

fn withInstant

withInstant(value=true)

PARAMETERS:

  • value (boolean)
    • default value: true

Returns only the latest value that Prometheus has scraped for the requested time series

fn withIntervalFactor

withIntervalFactor(value)

PARAMETERS:

  • value (string)

Set the interval factor for this query.

fn withLegendFormat

withLegendFormat(value)

PARAMETERS:

  • value (string)

Set the legend format for this query.

fn withQueryType

withQueryType(value)

PARAMETERS:

  • value (string)

Specify the query flavor TODO make this required and give it a default

fn withRange

withRange(value=true)

PARAMETERS:

  • value (boolean)
    • default value: true

Returns a Range vector, comprised of a set of time series containing a range of data points over time for each time series

fn withRefId

withRefId(value)

PARAMETERS:

  • value (string)

A unique identifier for the query within the list of targets. In server side expressions, the refId is used as a variable name to identify results. By default, the UI will assign A->Z; however setting meaningful names may be useful.

fn withScope

withScope(value)

PARAMETERS:

  • value (object)

fn withScopeMixin

withScopeMixin(value)

PARAMETERS:

  • value (object)

obj scope

fn scope.withMatchers

scope.withMatchers(value)

PARAMETERS:

  • value (string)