Query Prometheus metrics using PromQL.

Execute PromQL queries against Prometheus and return structured metric data.

yaml
type: "io.kestra.plugin.prometheus.Query"

Query CPU usage

yaml
id: prometheus-up-query
namespace: company.team

tasks:
  - id: check_up
    type: io.kestra.plugin.prometheus.Query
    url: "http://localhost:9090"
    query: "up"

Query a pushed custom metric

yaml
id: query-custom-metric
namespace: io.kestra.tests

tasks:
  - id: query_metric
    type: io.kestra.plugin.prometheus.Query
    url: "http://localhost:9090"
    query: "kestra_test_metric"
Properties

PromQL query

Prometheus query language expression

Default NONE
Possible Values
STOREFETCHFETCH_ONENONE

The way you want to store the data.

FETCH_ONE outputs the first row, FETCH outputs all the rows, STORE stores all rows in a file, NONE does nothing.

SubType string

HTTP headers

HTTP headers to include in the request

HTTP options

HTTP client configuration

Password

Optional basic auth password

Query time

Time for the query (RFC3339 or Unix timestamp). Defaults to current time.

Default http://localhost:9090

Base URL

Prometheus server URL

Username

Optional basic auth username

Format duration

The time allowed to establish a connection to the server before failing.

Default PT5M
Format duration

The time allowed for a read connection to remain idle before closing it.

The password for HTTP basic authentication.

The username for HTTP basic authentication.

Default false

If true, allow a failed response code (response code >= 400)

SubType integer

List of response code allowed for this request

The authentification to use.

Default UTF-8

The default charset for the request.

Default true

Whether redirects should be followed automatically.

SubType string
Possible Values
REQUEST_HEADERSREQUEST_BODYRESPONSE_HEADERSRESPONSE_BODY

The enabled log.

The proxy configuration.

The SSL request options

The timeout configuration.

The address of the proxy server.

The password for proxy authentication.

The port of the proxy server.

Default DIRECT
Possible Values
DIRECTHTTPSOCKS

The type of proxy to use.

The username for proxy authentication.

Whether to disable checking of the remote SSL certificate.

Only applies if no trust store is configured. Note: This makes the SSL connection insecure and should only be used for testing. If you are using a self-signed certificate, set up a trust store instead.

The token for bearer token authentication.