New to Kestra?
Use blueprints to kickstart your first workflows.
Query a Huawei Cloud CES metric, gate it against warning and critical thresholds, alert Slack on breach, and log a governance audit trail.
Huawei Cloud CES (Cloud Eye Service) is Huawei's equivalent of CloudWatch: it already collects system metrics for ECS, EVS, OBS and other services, and accepts custom metrics pushed by your own workloads. Nothing in Huawei Cloud turns a CES datapoint into a Slack page on its own, teams either poll the console or wire up Huawei's own alarm rules per metric. This blueprint is a portable, auditable alternative: one flow, driven by inputs, that reads a metric, judges it against thresholds you control, and keeps a record of every run in Kestra's execution history.
This blueprint was created by Mohit Jeswani.
query_metric (io.kestra.plugin.huawei.ces.Query) reads the datapoints CES already has
for the configured metric_namespace / metric_name / dimension, aggregated with
statistic over period buckets inside the window. Read-only, no Huawei resource is
touched.evaluate (io.kestra.plugin.core.output.OutputValues) takes the most recent datapoint
(datapoints are returned sorted oldest to newest, so the last entry is current) and
classifies it: OK below warning_threshold, WARNING at or above it, CRITICAL at or
above critical_threshold, and HIGH when CES returned zero datapoints at all, the same
signal you would get from an unreachable or misconfigured resource.route (io.kestra.plugin.core.flow.If):publish_check_gate (io.kestra.plugin.core.flow.If), off by default: when
publish_check_metric is true, publish_check (io.kestra.plugin.huawei.ces.Push) writes
a threshold_breach custom metric (0 or 1) back to CES under the KestraGovernance.CES
namespace. This only ever adds a new CES datapoint, it never modifies the monitored resource.summary logs the severity, value and whether the metric was published, closing out the
governance cycle.errors alerts Slack if the flow itself fails, for example on an expired AK/SK or an invalid
namespace.Push task and need a
threshold gate on top of them.ces.Query reading
datapoints and ces.Push writing them back.A CES alarm rule is static configuration hidden in a console: changing a threshold means clicking through the UI with no review and no history. Kestra keeps the thresholds as flow inputs, so every change is a diff, every run is logged with the exact value that triggered or didn't trigger an alert, and the same flow can be pointed at a different resource or metric just by changing inputs on a manual run, with no new code.
CES ReadOnlyAccess, and
CES FullAccess if publish_check_metric is enabled.SYS.ECS/cpu_util), or a custom metric already pushed into CES.This flow calls the Huawei Cloud CES API directly over HTTPS; there is no official local
Huawei Cloud emulator, so query_metric and publish_check cannot be exercised against a
local Docker container the way a self-hosted database or broker can. Point dimension_value
at a real resource in a trial account to test it end to end.
HUAWEI_AK: the IAM access key used by query_metric and publish_check. In Kestra OSS,
provide it as the base64-encoded environment variable SECRET_HUAWEI_AK.HUAWEI_SK: the IAM secret key paired with HUAWEI_AK. In Kestra OSS, provide it as the
base64-encoded environment variable SECRET_HUAWEI_SK.SLACK_WEBHOOK_URL: used by alert and the errors block. In Kestra OSS, provide it as the
base64-encoded environment variable SECRET_SLACK_WEBHOOK_URL.| Input | Type | Default | Purpose |
|---|---|---|---|
region |
STRING | eu-west-101 |
Huawei Cloud region used to sign CES requests |
metric_namespace |
STRING | SYS.ECS |
CES service.item namespace |
metric_name |
STRING | cpu_util |
Metric name inside the namespace |
dimension_name |
STRING | instance_id |
Dimension key identifying the resource |
dimension_value |
STRING | <your-ecs-instance-id> |
Dimension value, the actual resource ID |
statistic |
SELECT | AVERAGE |
AVERAGE, MAX, MIN, SUM or VARIANCE |
period |
SELECT | FIVE_MINUTES |
CES aggregation bucket size |
window |
STRING | PT1H |
ISO-8601 lookback duration, max P30D |
warning_threshold |
FLOAT | 80 |
Value at or above this is WARNING |
critical_threshold |
FLOAT | 95 |
Value at or above this is CRITICAL |
publish_check_metric |
BOOL | false |
Push the pass/fail result back to CES |
{{ outputs.query_metric.count }}: number of datapoints CES returned.{{ outputs.query_metric.series }}: the datapoints themselves, each with timestamp,
value and unit.{{ outputs.evaluate.values.severity }}: OK, WARNING, CRITICAL or HIGH.{{ outputs.evaluate.values.latest_value }}: the value that was judged.{{ outputs.publish_check.count }}: datapoints written back to CES, only present when
publish_check_metric is true.dimensions list on query_metric directly.window is capped at P30D by the CES API itself; a longer value fails the task rather than
silently truncating.ReadOnlyAccess, plus FullAccess
only if you turn on publish_check_metric).cpu_util
datapoint; an empty series right after boot is expected and reported as HIGH, not a flow
bug.SYS., that prefix is reserved for Huawei
system metrics and publish_check will fail validation if KestraGovernance.CES is changed
to start with it.HUAWEI_AK, HUAWEI_SK and SLACK_WEBHOOK_URL secrets.dimension_value to a real resource ID in your account, for example an ECS instance ID.summary logs a severity.warning_threshold below the current metric value to confirm the Slack alert fires.schedule_every_6_hours trigger once the thresholds match what you actually want paged on.query_metric for metrics that need 2 or 3 to identify the resource.io.kestra.plugin.core.flow.Loop to gate a
whole fleet in one run instead of one resource at a time.alert task with a Huawei Cloud SMN Publish task to page through Huawei's
own notification service instead.latest_value over time by always setting publish_check_metric to true and graphing
the KestraGovernance.CES namespace back in the Huawei Cloud console.