
Prometheus Trigger
CertifiedPoll Prometheus until query returns data
Prometheus Trigger
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
type: io.kestra.plugin.prometheus.TriggerExamples
Trigger when a Prometheus query returns results
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
query *Requiredstring
PromQL query to execute on each poll
url *Requiredstring
Prometheus server URL
allowConcurrent Non-dynamicboolean
falseSpecifies whether a trigger is allowed to start a new execution even if a previous run is still in progress.
fetchType string
NONESTOREFETCHFETCH_ONENONEHow to fetch the query result
headers object
Additional HTTP headers to send with the request
interval Non-dynamicstring
PT1MdurationPolling interval
Delay between two polls of the Prometheus query; defaults to PT60S
password string
Password for basic authentication
stopAfter Non-dynamicarray
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTEDList of execution states after which a trigger should be stopped (a.k.a. disabled).
time string
Evaluation timestamp for the query
username string
Username for basic authentication
when string
trueA 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.
Outputs
metric
First row of fetched data
Only populated if using fetchType=FETCH_ONE
io.kestra.plugin.prometheus.Query-PrometheusMetric
0metrics array
Prometheus metrics
List of metrics returned by the query
io.kestra.plugin.prometheus.Query-PrometheusMetric
0resultType string
Result type
Type of Prometheus result (vector, matrix, scalar, string)
size integer
The number of rows fetched
total integer
0Total results
Total number of metric results
uri string
uriThe URI of the stored data
Only populated if using fetchType=STORE