Skip to content

Build dashboard with pre-defined data source #90

@DifferentialOrange

Description

@DifferentialOrange

It's impossible to build json with fixed datasource since all dashboards choose target type based on template variable value

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

Labels

bugSomething isn't workingcode healthImprove code readability, simplify maintenance and so ondashboardRelated to dashboard template part of repo

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions