Open
Description
What happened?
Setting up a cloudwatch alert on metric. But when I am opening the alert in grafana. Getting below error.
but when I re-select the same datasource from the list(done in UI) again, it worked.
How to reproduce it?
Below is the code I am using to setup alert.
cloudwatch_alert = AlertRulev9(
title="Test Alert",
condition="B",
triggers=[
CloudwatchMetricsTarget(
datasource="fO0jguEGk",
refId="A",
dimensions={
"ClusterName": "test-cluster-qa",
"ServiceName":"test-cluster-qa-jamuna"
},
metricName = "RunningTaskCount",
namespace="ECS/ContainerInsights"
),
AlertExpression(
refId="B",
expressionType=EXP_TYPE_CLASSIC,
expression='A',
conditions=[
AlertCondition(
evaluator=LowerThan(1),
operator=OP_AND,
reducerType=RTYPE_MIN
)
]
)
],
evaluateFor="3m",
)
# An AlertGroup is one group contained in an alert folder.
alertgroup = AlertGroup(
name="test-alert-group",
rules=[
cloudwatch_alert
]
)
my_alergroup_json = json.dumps(alertgroup.to_json_data())
Metadata
Assignees
Labels
No labels