Open lockan opened 1 year ago
The same problem affects CloudwatchMetricsTarget.
CloudwatchMetricsTarget fixed in https://github.com/weaveworks/grafanalib/pull/560
Similar fix could be used for Elasticsearch
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?