Prometheus Trigger

Prometheus Trigger

Certified

Poll Prometheus until query returns data

Runs a PromQL query on a fixed interval (default PT60S) and starts an Execution once results are non-empty. Reuses Query task options including auth, headers, fetchType, and time

yaml
type: io.kestra.plugin.prometheus.Trigger

Trigger when a Prometheus query returns results

yaml
id: prometheus_trigger
namespace: company.team
tasks:
  - id: each
    type: io.kestra.plugin.core.flow.ForEach
    values: "{{ trigger.metrics }}"
    tasks:
      - id: return
        type: io.kestra.plugin.core.debug.Return
        format: "{{ fromJson(taskrun.value) }}"
triggers:
  - id: watch
    type: io.kestra.plugin.prometheus.Trigger
    interval: "PT30S"
    url: "http://localhost:9090"
    query: "kestra_test_metric > 100"
    fetchType: FETCH
Properties

PromQL query to execute on each poll

Prometheus server URL

Defaultfalse

Specifies whether a trigger is allowed to start a new execution even if a previous run is still in progress.

DefaultNONE
Possible Values
STOREFETCHFETCH_ONENONE

How to fetch the query result

Additional HTTP headers to send with the request

DefaultPT1M
Formatduration

Polling interval

Delay between two polls of the Prometheus query; defaults to PT60S

Password for basic authentication

SubTypestring
Possible Values
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTED

List of execution states after which a trigger should be stopped (a.k.a. disabled).

Evaluation timestamp for the query

Username for basic authentication

Defaulttrue

A condition that determines whether the trigger should run.

A Pebble expression evaluated at trigger time. The trigger fires only when the expression evaluates to a truthy value (true, a non-empty string, a non-zero number). Use this to gate trigger execution on dynamic runtime values such as execution labels, flow variables, or environment conditions.

First row of fetched data

Only populated if using fetchType=FETCH_ONE

Definitions
labelsobject
SubTypestring
timestampnumber
Default0
valuestring

Prometheus metrics

List of metrics returned by the query

Definitions
labelsobject
SubTypestring
timestampnumber
Default0
valuestring

Result type

Type of Prometheus result (vector, matrix, scalar, string)

The number of rows fetched

Default0

Total results

Total number of metric results

Formaturi

The URI of the stored data

Only populated if using fetchType=STORE