Simplify remote write dashboard in mixin.

Signed-off-by: Callum Styan <callumstyan@gmail.com>
This commit is contained in:
Callum Styan 2019-11-18 19:58:07 -08:00
parent 23c0299d85
commit f4fb6dc208
1 changed files with 40 additions and 32 deletions

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')