Replies: 1 comment
-
|
Maybe a custom script is an option.
import os
from wmill import Windmill
def format_metric(name, value, mtype="gauge", labels=None):
label_str = ""
if labels:
label_str = "{" + ",".join(f'{k}="{v}"' for k, v in labels.items()) + "}"
return f"# TYPE {name} {mtype}\n{name}{label_str} {value}\n"
def main():
client = Windmill()
workspace = os.environ["WM_WORKSPACE"]
result = client.get(
f"/w/{workspace}/jobs/list",
params={
"success": False,
"job_kinds": "flow",
},
)
jobs = result.json()
metrics = ""
metrics += format_metric(
"windmill_jobs_total",
len(jobs),
labels={"status": "failed", "kind": "flow"},
)
return {"windmill_content_type": "text/plain", "result": metrics} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi
We’re looking for a recommended way to detect whether a specific Flow has failed, in a scalable and future-proof way.
What we’ve checked so far
1. Metrics
Example:
This is useful for alerting and knowing that failures occurred, but:
2. Jobs API
Example:
This allows us to identify failed jobs and see flow/script paths and error messages.
However:
Ideally, we would prefer a push-based mechanism, where Windmill actively notifies us when a Flow or Job fails (e.g. via webhook or event), instead of us polling the Jobs API to find out what errored.
3. Error handling inside Flows
Handling errors inside Flows (try/catch, error branches, notifications) is helpful for expected errors, but:
Questions
What approach would you recommend for detecting failed Flows in a way that:
Thanks in advance 🙏
Beta Was this translation helpful? Give feedback.
All reactions