You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to define an AlertRulev9 object for use with an Elasticsearch data source the Elasticsearch helper classes should pass validation tests and correctly generate the JSON structure needed to provision a new working alert.
What happened?
Trying to the ElasticsearchTarget in the triggers block of the AlertRulev9 results in the error:
ValueError: triggers must either be a Target or AlertCondition
This appears to be because the validation check is looking for isinstance(Target) or ..., but the class ElasticsearchTarget inherits from Object, not Target.
I have also tried using the core Target class and passing the ElasticsearchTarget in to the target param.
e.g.
Target(
...
target=ElasticsearchTarget( ... ),
)
If I do this my code will execute and I can provision the alert. However the resulting alert fails to parse correctly in Grafana with an error:
Failed to execute conditions: [plugin.downstreamError] failed to query data: type assertion to string failed.
Hi! I noticed that the same issue is still happening. Has there been any progress on a fix? Also, I was wondering where do we specify the datasource UID when using ElasticsearchTarget?
Edit: I see that just changing the type of ElasticsearchTarget to be Target completely solves the issue and allows for the specification of a datasource. Maybe this change, along with the fix for CloudwatchMetricsTarget, can be pushed to the grafanalib package.
What you expected to happen?
Grafana 9.2.4
Grafanalib 0.7.0
When trying to define an AlertRulev9 object for use with an Elasticsearch data source the Elasticsearch helper classes should pass validation tests and correctly generate the JSON structure needed to provision a new working alert.
What happened?
Trying to the ElasticsearchTarget in the triggers block of the AlertRulev9 results in the error:
This appears to be because the validation check is looking for
isinstance(Target) or ...
, but theclass ElasticsearchTarget
inherits fromObject
, notTarget
.I have also tried using the core Target class and passing the ElasticsearchTarget in to the
target
param.e.g.
If I do this my code will execute and I can provision the alert. However the resulting alert fails to parse correctly in Grafana with an error:
How to reproduce it?
The text was updated successfully, but these errors were encountered: