
Metaplane Gate
CertifiedGate a pipeline on one or more Metaplane monitors, synchronously
Metaplane Gate
Gate a pipeline on one or more Metaplane monitors, synchronously
Optionally enqueues one or more monitors to run, then polls their status until each result is fresh (its timestamp is at or after the moment this task started) or a bounded timeout elapses. Unlike Get, this task can fail the flow itself: it combines every monitor's effective status (escalating a stale result to FAIL when maxAge is set) using failStrategy to decide whether the gate passes.
When runFirst is false, no run is triggered: each monitor's current status is read once and, if maxAge is set, flagged stale when older than maxAge. When runFirst is true, a stale result can never occur since the polled result is always freshly produced after this task started.
Throws an actionable error naming the still-pending monitor(s) if the poll times out before every monitor becomes fresh.
For grouped monitors, set perGroup to evaluate each group on its own and drop stale "ghost" groups, so a dead group no longer fails the gate on its own.
type: io.kestra.plugin.metaplane.GateExamples
Run a Metaplane monitor and gate the pipeline synchronously on its fresh result
id: metaplane_sync_gate
namespace: company.team
tasks:
- id: quality_gate
type: io.kestra.plugin.metaplane.Gate
apiToken: "{{ secret('METAPLANE_API_TOKEN') }}"
monitorIds:
- "3fa85f64-5717-4562-b3fc-2c963f66afa6"
runFirst: true
pollInterval: PT10S
timeout: PT10M
failStrategy: FAIL_IF_ANY
- id: publish
type: io.kestra.plugin.core.log.Log
message: "Quality gate passed, publishing. Details: {{ outputs.quality_gate.monitors }}"
Batch-gate several monitors with a staleness check, without triggering a new run
id: metaplane_batch_gate
namespace: company.team
tasks:
- id: gate
type: io.kestra.plugin.metaplane.Gate
apiToken: "{{ secret('METAPLANE_API_TOKEN') }}"
monitorIds:
- "3fa85f64-5717-4562-b3fc-2c963f66afa6"
- "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"
runFirst: false
maxAge: PT6H
failStrategy: NONE
failOn:
- FAIL
- ERROR
- id: report
type: io.kestra.plugin.core.log.Log
message: "Gate passed={{ outputs.gate.passed }}, failed monitors={{ outputs.gate.failedMonitorIds }}"
Gate a grouped monitor per group, ignoring stale ghost groups older than maxAge
id: metaplane_grouped_gate
namespace: company.team
tasks:
- id: gate
type: io.kestra.plugin.metaplane.Gate
apiToken: "{{ secret('METAPLANE_API_TOKEN') }}"
monitorIds:
- "3fa85f64-5717-4562-b3fc-2c963f66afa6"
runFirst: false
perGroup: true
maxAge: PT6H
failStrategy: FAIL_IF_ANY
- id: report
type: io.kestra.plugin.core.log.Log
message: "Gate passed={{ outputs.gate.passed }}, groups={{ outputs.gate.monitors[0].groups }}"
Properties
apiToken *Requiredstring
Metaplane API token
API token used to authenticate against the Metaplane API. Generate one at https://app.metaplane.dev/account/manage-tokens and store it as a Kestra secret.
monitorIds *Requiredarray
Monitor IDs to gate on
UUIDs of the Metaplane monitors to poll and evaluate. Must contain at least one ID.
baseUrl string
https://dev.api.metaplane.devMetaplane API base URL
Base endpoint for all Metaplane API calls. Defaults to https://dev.api.metaplane.dev.
failOn array
["FAIL","ERROR"]PASSIN_TRAININGNOT_ENOUGH_DATAFAILED_TO_PREDICTINVALID_INPUTERRORFAILUNKNOWNStatuses considered failing
Monitor statuses whose presence counts as a failure for the fail strategy above. Defaults to FAIL and ERROR.
failStrategy string
FAIL_IF_ANYFAIL_FASTFAIL_IF_ANYFAIL_IF_ALLNONEMulti-monitor fail strategy
How the effective status of every monitor is combined into a single pass/fail decision:
- FAIL_FAST: stop polling as soon as one monitor's effective status is in failOn; monitors never reached are reported as pending, not fabricated.
- FAIL_IF_ANY: the gate fails if at least one monitor's effective status is in failOn. Default.
- FAIL_IF_ALL: the gate fails only if every monitor's effective status is in failOn.
- NONE: the gate never fails; failedMonitorIds is still populated for reporting.
maxAge string
Maximum acceptable age of a monitor's result
ISO-8601 duration. Only applied when runFirst is false: a monitor whose result is older than this age is flagged stale and its effective status is escalated to FAIL for the purposes of the gate, regardless of its reported status. Must be at most PT24H (24 hours). Optional, no staleness check is performed by default.
options Non-dynamic
HTTP client options
Optional HTTP configuration (timeouts, proxy, SSL) applied to every Metaplane API call.
io.kestra.core.http.client.configurations.HttpConfiguration
falseIf true, allow a failed response code (response code >= 400)
List of response code allowed for this request
The authentication to use.
io.kestra.core.http.client.configurations.BasicAuthConfiguration
The password for HTTP basic authentication.
The username for HTTP basic authentication.
io.kestra.core.http.client.configurations.BearerAuthConfiguration
The token for bearer token authentication.
io.kestra.core.http.client.configurations.DigestAuthConfiguration
The password for HTTP Digest authentication.
The username for HTTP Digest authentication.
The password for HTTP basic authentication. Deprecated, use auth property with a BasicAuthConfiguration instance instead.
The username for HTTP basic authentication. Deprecated, use auth property with a BasicAuthConfiguration instance instead.
durationThe time allowed to establish a connection to the server before failing.
durationThe time an idle connection can remain in the client's connection pool before being closed.
UTF-8The default charset for the request.
java.nio.charset.Charset
trueWhether to enable TCP Keep-Alive extended socket options (TCP_KEEPIDLE, TCP_KEEPINTERVAL, TCP_KEEPCOUNT).
Set to false when running on Windows workers, as these extended socket options are not supported by the Windows JDK and will cause connection failures.
trueWhether redirects should be followed automatically.
ALLTRACEDEBUGINFOWARNERROROFFNOT_SPECIFIEDThe log level for the HTTP client.
REQUEST_HEADERSREQUEST_BODYRESPONSE_HEADERSRESPONSE_BODYThe enabled log.
The maximum content length of the response.
The proxy configuration.
io.kestra.core.http.client.configurations.ProxyConfiguration
The address of the proxy server.
The password for proxy authentication.
The port of the proxy server.
DIRECTDIRECTHTTPSOCKSThe type of proxy to use.
The username for proxy authentication.
The address of the proxy server.
The password for proxy authentication.
The port of the proxy server.
DIRECTHTTPSOCKSThe type of proxy to use.
The username for proxy authentication.
durationThe time allowed for a read connection to remain idle before closing it.
durationThe maximum time allowed for reading data from the server before failing.
The SSL request options
io.kestra.core.http.client.configurations.SslOptions
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 timeout configuration.
io.kestra.core.http.client.configurations.TimeoutConfiguration
The time allowed to establish a connection to the server before failing.
PT5MThe time allowed for a read connection to remain idle before closing it.
perGroup booleanstring
falseEvaluate grouped monitors per group, excluding stale "ghost" groups
Evaluate each monitor group by group instead of on its single rolled-up status, and drop stale "ghost" groups so a dead group cannot fail the gate on its own. Only live groups are combined; a failing group-by query is ERROR, and an all-ghost monitor is treated as failing.
A group is a ghost when its latest evaluation is older than maxAge, or predates this task's start when runFirst is true. maxAge is therefore required when perGroup is true and runFirst is false.
Costs one extra API call per group per monitor, so it is opt-in. Defaults to false.
pluginDefaultsRef Non-dynamicstring
Reference (ref) of the pluginDefaults to apply to this task.
pollInterval string
PT10SDelay between two polls
ISO-8601 duration between poll rounds while runFirst is true and at least one monitor has not yet produced a fresh result. Must be strictly positive and at most PT1H (1 hour). Defaults to PT10S.
runFirst booleanstring
falseRun the monitors before gating
When true, enqueues every monitor to run (as Run does) before polling, and only accepts a result whose timestamp is at or after this task's start. When false, no run is triggered: each monitor's current status is read directly. Defaults to false.
timeout string
PT10MMaximum time to wait for a fresh result
ISO-8601 duration. The task fails with an actionable error naming the still-pending monitor(s) if this deadline elapses before every monitor has produced a fresh result. In perGroup mode it also bounds the per-group evaluation-history fan-out, which is checked against this deadline between group reads. Must be strictly positive and at most PT24H (24 hours), since this task blocks the flow execution for its whole duration. Note the actual wait may end up to one pollInterval short of this value, since the loop only starts a new poll round if it can complete before the deadline. Defaults to PT10M.
Outputs
failedMonitorIds array
IDs of the monitors whose effective status counted as failing
monitors array
Per-monitor result
One entry per monitorId, in the same order. A monitor never reached because of a timeout or a FAIL_FAST short-circuit only has monitorId set.
io.kestra.plugin.metaplane.Gate-MonitorResult
date-timeTimestamp of the monitor's result, if reported by the API
Per-group evaluation
Populated only when perGroup is true: one entry per group, with its latest evaluation timestamp and whether it was excluded from the gate decision as a stale ghost group. Null in the default monitor-level mode.
io.kestra.plugin.metaplane.Gate-GroupResult
date-timeTimestamp of this group's latest evaluation
Read from the monitor's evaluation history. Null when the group has no history.
falseWhether this group was excluded as a stale ghost group
True when the group's latest evaluation is older than the staleness threshold, so it did not count toward the monitor's effective status.
Group-by values identifying this group
Shape not documented by Metaplane, kept opaque, mirrors SeriesStatus.groups.
com.fasterxml.jackson.databind.JsonNode
PASSIN_TRAININGNOT_ENOUGH_DATAFAILED_TO_PREDICTINVALID_INPUTERRORFAILUNKNOWNLatest status reported for this group
Monitor ID
Per-series status
Status of each of the monitor's group-by series.
io.kestra.plugin.metaplane.SeriesStatus
Group-by values identifying this series
Shape not documented by Metaplane, kept opaque.
com.fasterxml.jackson.databind.JsonNode
Lower bound of the expected range for this series
IDs of incidents currently open for this series
Observed value for this series
PASSIN_TRAININGNOT_ENOUGH_DATAFAILED_TO_PREDICTINVALID_INPUTERRORFAILUNKNOWNStatus of this series
Upper bound of the expected range for this series
falseWhether this result is stale
In monitor-level mode, true when maxAge is set, runFirst is false, and the result is older than maxAge. In perGroup mode, true when every group is a ghost. Either way the effective status is escalated to FAIL for the gate's fail decision even though status stays truthful.
PASSIN_TRAININGNOT_ENOUGH_DATAFAILED_TO_PREDICTINVALID_INPUTERRORFAILUNKNOWNReported monitor status
The raw status as returned by the API, never escalated by staleness. Null if the monitor was never reached.
passed boolean
falseWhether the gate passed
Always true when failStrategy is NONE.