
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 }}"
Installation
Our standard Docker images already include this plugin. If you use a -slim image or another setup, install it with the following command:
kestractl plugins get io.kestra.plugin:plugin-metaplane --compatible-for $KESTRA_VERSION For kestractl, use your Kestra version with --compatible-for, or specify an exact plugin version.
For Kestra CLI, replace LATEST with a specific version or version range to pin the plugin version.
Properties
apiToken *string
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 *array
Monitor IDs to gate on
UUIDs of the Metaplane monitors to poll and evaluate. Must contain at least one ID.
assets
Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.
io.kestra.core.models.assets.AssetsDeclaration
IGNOREFAILWARNAsset failure behavior
Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.
Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.
The assets consumed as inputs.
io.kestra.core.models.assets.AssetIdentifier
1The assets produced as outputs.
io.kestra.plugin.ee.assets.Dataset
1150{}1150io.kestra.plugin.ee.assets.File
1150{}1150io.kestra.plugin.ee.assets.Table
1150{}1150io.kestra.plugin.ee.assets.VM
1150{}1150io.kestra.core.models.assets.External
1150{}1150io.kestra.core.models.assets.Custom
11501Custom asset type
{}1150baseUrl 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
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.
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.
REQUEST_HEADERSREQUEST_BODYRESPONSE_HEADERSRESPONSE_BODYThe enabled log.
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.
Retry strategy for HTTP requests.
retry is disabled by default.
Constant retry
Retry with a fixed delay between attempts.
durationRETRY_FAILED_TASKRETRY_FAILED_TASKCREATE_NEW_EXECUTION>= 1durationfalseExponential retry
Retry with exponentially increasing delays between attempts.
durationdurationRETRY_FAILED_TASKRETRY_FAILED_TASKCREATE_NEW_EXECUTION>= 1durationfalseRandom retry
Retry with a random delay within a configurable range between attempts.
durationdurationRETRY_FAILED_TASKRETRY_FAILED_TASKCREATE_NEW_EXECUTION>= 1durationfalse[502,503,504]HTTP status codes that should be retried.
Used for idempotent methods (GET, HEAD) without their own entry in retryOnStatusCodesByMethod. Non-idempotent methods are never retried on a status code unless listed in retryOnStatusCodesByMethod. Defaults to 502, 503 and 504 for idempotent methods (GET, HEAD) only.
Per-HTTP-method overrides for which status codes should be retried.
Keys are HTTP methods (e.g. GET, POST). A method with no entry here falls back to retryOnStatusCodes. This lets a caller retry more broadly for safe, read-only methods (for example, every 5xx and a 429 for GET/HEAD) while keeping a narrower list for methods that write, where retrying a request that may have already been processed by the origin risks duplicating the effect. Example: {GET: [429, 500, 502, 503, 504], HEAD: [429, 500, 502, 503, 504]}.
["GET","HEAD"]HTTP methods for which any transport-level failure may be retried.
A transport-level failure is a connection or timeout error rather than an HTTP response (e.g. a read timeout or a connection reset mid-request). For a method listed here, any such failure is retried. Defaults to GET and HEAD HTTP methods.
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.
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.