Some targets (Influx for example) use alias instead of legendFormat (which is Prometheus "alias"). This commit setup both of them by current legendFormat.
Why is it a good idea?
For Influxdb SqlTarget isn't now possible to set "alias" via Target. Of course is possible to use InfluxDBTarget (https://github.com/weaveworks/grafanalib/blob/main/grafanalib/influxdb.py) but there missing other options (like hide, because it's not child of Target). So I've chosen solution to extend Target to support all needed for my influx.
Context
Questions
If you don't like this solution, I see other solutions
add new alias option - similar as #285
InfluxDBTarget class should be inherit from Target
What does this do?
Some targets (Influx for example) use
alias
instead oflegendFormat
(which is Prometheus "alias"). This commit setup both of them by currentlegendFormat
.Why is it a good idea?
For Influxdb
SqlTarget
isn't now possible to set "alias" viaTarget
. Of course is possible to useInfluxDBTarget
(https://github.com/weaveworks/grafanalib/blob/main/grafanalib/influxdb.py) but there missing other options (likehide
, because it's not child ofTarget
). So I've chosen solution to extendTarget
to support all needed for my influx.Context
Questions
If you don't like this solution, I see other solutions
alias
option - similar as #285Target