Merge pull request #6335 from cstyan/rw-dashboard-simplify

Simplify remote write dashboard in mixin.
This commit is contained in:
Björn Rabenstein 2019-11-20 02:43:26 +01:00 committed by GitHub
commit ba9332972c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -151,45 +151,56 @@ local template = grafana.template;
legendFormat='{{cluster}}:{{instance}}-{{queue}}' legendFormat='{{cluster}}:{{instance}}-{{queue}}'
)); ));
local shardsQueries = local currentShards =
graphPanel.new( graphPanel.new(
'Shards: $queue', 'Current Shards',
datasource='$datasource', datasource='$datasource',
span=12, span=12,
min_span=6, min_span=6,
repeat='queue' )
.addTarget(prometheus.target(
'prometheus_remote_storage_shards{cluster=~"$cluster", instance=~"$instance"}',
legendFormat='{{cluster}}:{{instance}}-{{queue}}'
));
local maxShards =
graphPanel.new(
'Max Shards',
datasource='$datasource',
span=4,
) )
.addTarget(prometheus.target( .addTarget(prometheus.target(
'prometheus_remote_storage_shards_max{cluster=~"$cluster", instance=~"$instance"}', 'prometheus_remote_storage_shards_max{cluster=~"$cluster", instance=~"$instance"}',
legendFormat='max_shards:{{queue}}' legendFormat='{{cluster}}:{{instance}}-{{queue}}'
)) ));
local minShards =
graphPanel.new(
'Min Shards',
datasource='$datasource',
span=4,
)
.addTarget(prometheus.target( .addTarget(prometheus.target(
'prometheus_remote_storage_shards_min{cluster=~"$cluster", instance=~"$instance"}', 'prometheus_remote_storage_shards_min{cluster=~"$cluster", instance=~"$instance"}',
legendFormat='min_shards:{{queue}}' legendFormat='{{cluster}}:{{instance}}-{{queue}}'
)) ));
local desiredShards =
graphPanel.new(
'Desired Shards',
datasource='$datasource',
span=4,
)
.addTarget(prometheus.target( .addTarget(prometheus.target(
'prometheus_remote_storage_shards_desired{cluster=~"$cluster", instance=~"$instance"}', 'prometheus_remote_storage_shards_desired{cluster=~"$cluster", instance=~"$instance"}',
legendFormat='desired_shards:{{queue}}' legendFormat='{{cluster}}:{{instance}}-{{queue}}'
)) ));
.addTarget(prometheus.target(
'prometheus_remote_storage_shards{cluster=~"$cluster", instance=~"$instance"}',
legendFormat='current_shards:{{queue}}'
)) +
{
seriesOverrides: [
{
alias: '/max_shards/',
yaxis: 2,
},
],
};
local shardsCapacity = local shardsCapacity =
graphPanel.new( graphPanel.new(
'Shard Capacity: $queue', 'Shard Capacity',
datasource='$datasource', datasource='$datasource',
span=6, span=6,
repeat='queue'
) )
.addTarget(prometheus.target( .addTarget(prometheus.target(
'prometheus_remote_storage_shard_capacity{cluster=~"$cluster", instance=~"$instance"}', 'prometheus_remote_storage_shard_capacity{cluster=~"$cluster", instance=~"$instance"}',
@ -199,10 +210,9 @@ local template = grafana.template;
local pendingSamples = local pendingSamples =
graphPanel.new( graphPanel.new(
'Pending Samples: $queue', 'Pending Samples',
datasource='$datasource', datasource='$datasource',
span=6, span=6,
repeat='queue'
) )
.addTarget(prometheus.target( .addTarget(prometheus.target(
'prometheus_remote_storage_pending_samples{cluster=~"$cluster", instance=~"$instance"}', 'prometheus_remote_storage_pending_samples{cluster=~"$cluster", instance=~"$instance"}',
@ -323,13 +333,8 @@ local template = grafana.template;
template.new( template.new(
'queue', 'queue',
'$datasource', '$datasource',
'label_values(prometheus_remote_storage_shards, queue)' % $._config, 'label_values(prometheus_remote_storage_shards{cluster=~"$cluster", instance=~"$instance"}, queue)' % $._config,
refresh='time', refresh='time',
current={
selected: true,
text: 'All',
value: '$__all',
},
includeAll=true, includeAll=true,
) )
) )
@ -345,7 +350,10 @@ local template = grafana.template;
.addRow( .addRow(
row.new('Shards' row.new('Shards'
) )
.addPanel(shardsQueries), .addPanel(currentShards)
.addPanel(maxShards)
.addPanel(minShards)
.addPanel(desiredShards)
) )
.addRow( .addRow(
row.new('Shard Details') row.new('Shard Details')