Skip to content

loki

grafonnet.query.loki

Index

Fields

fn new

new(datasource, expr)

PARAMETERS:

  • datasource (string)
  • expr (string)

Creates a new loki 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 withExpr

withExpr(value)

PARAMETERS:

  • value (string)

The LogQL query.

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

@deprecated, now use queryType.

fn withLegendFormat

withLegendFormat(value)

PARAMETERS:

  • value (string)

Used to override the name of the series.

fn withMaxLines

withMaxLines(value)

PARAMETERS:

  • value (integer)

Used to limit the number of log rows returned.

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

@deprecated, now use queryType.

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 withResolution

withResolution(value)

PARAMETERS:

  • value (integer)

@deprecated, now use step.

fn withStep

withStep(value)

PARAMETERS:

  • value (string)

Used to set step value for range queries.