- Notifications
You must be signed in to change notification settings - Fork 15
Closed
Labels
bugSomething isn't workingSomething isn't workingcode healthImprove code readability, simplify maintenance and so onImprove code readability, simplify maintenance and so ondashboardRelated to dashboard template part of repoRelated to dashboard template part of repo
Description
It's impossible to build json with fixed datasource since all dashboards choose target type based on template variable value
grafana-dashboard/dashboard/common.libsonnet
Lines 75 to 88 in 845e88c
| if datasource == '${DS_PROMETHEUS}' then | |
| prometheus.target( | |
| expr=std.format('rate(%s{job=~"%s"}[%s])', | |
| [metric_name, job, rate_time_range]), | |
| legendFormat='{{alias}}', | |
| ) | |
| else if datasource == '${DS_INFLUXDB}' then | |
| influxdb.target( | |
| policy=policy, | |
| measurement=measurement, | |
| group_tags=['label_pairs_alias'], | |
| alias='$tag_label_pairs_alias', | |
| ).where('metric_name', '=', metric_name) | |
| .selectField('value').addConverter('mean').addConverter('non_negative_derivative', ['1s']), |
If someone decides to build compiled dashboard with myinflux datasource, it won't work out.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingcode healthImprove code readability, simplify maintenance and so onImprove code readability, simplify maintenance and so ondashboardRelated to dashboard template part of repoRelated to dashboard template part of repo