Skip to content

Commit

Permalink
Update dashboards setup in production mixin. (#685)
Browse files Browse the repository at this point in the history
This changes the following:
- fix `Scrape failures` queries to use the proper variables like the
  rest of queries
- add `grafana-agent-mixin` tag to all dashboards to allow easy link
  and discovery
  • Loading branch information
cristiangreco authored Jul 7, 2021
1 parent 693ab28 commit 14923ac
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
10 changes: 5 additions & 5 deletions production/grafana-agent-mixin/dashboards.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ local template = grafana.template;
.addPanel(
g.panel('Scrape failures') +
g.queryPanel([
'sum by (job) (rate(prometheus_target_scrapes_exceeded_sample_limit_total[1m]))',
'sum by (job) (rate(prometheus_target_scrapes_sample_duplicate_timestamp_total[1m]))',
'sum by (job) (rate(prometheus_target_scrapes_sample_out_of_bounds_total[1m]))',
'sum by (job) (rate(prometheus_target_scrapes_sample_out_of_order_total[1m]))',
'sum by (job) (rate(prometheus_target_scrapes_exceeded_sample_limit_total{cluster=~"$cluster", namespace=~"$namespace", container=~"$container"}[1m]))',
'sum by (job) (rate(prometheus_target_scrapes_sample_duplicate_timestamp_total{cluster=~"$cluster", namespace=~"$namespace", container=~"$container"}[1m]))',
'sum by (job) (rate(prometheus_target_scrapes_sample_out_of_bounds_total{cluster=~"$cluster", namespace=~"$namespace", container=~"$container"}[1m]))',
'sum by (job) (rate(prometheus_target_scrapes_sample_out_of_order_total{cluster=~"$cluster", namespace=~"$namespace", container=~"$container"}[1m]))',
], [
'exceeded sample limit: {{job}}',
'duplicate timestamp: {{job}}',
Expand Down Expand Up @@ -261,7 +261,7 @@ local template = grafana.template;
legendFormat='{{cluster}}:{{pod}}-{{instance_group_name}}-{{url}}',
));

dashboard.new('Agent Prometheus Remote Write', editable=true)
dashboard.new('Agent Prometheus Remote Write', tags=['grafana-agent-mixin'], editable=true)
.addTemplate(
{
hide: 0,
Expand Down
2 changes: 1 addition & 1 deletion production/grafana-agent-mixin/mixin.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ local dashboards = import 'dashboards.libsonnet';

{
grafanaDashboards+:: std.mapWithKey(function(field, obj) obj {
grafanaDashboardFolder: 'Agent',
grafanaDashboardFolder: 'Grafana Agent',
}, dashboards.grafanaDashboards),
}
1 change: 1 addition & 0 deletions production/grafana-agent-mixin/utils.libsonnet
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
injectUtils(dashboard):: dashboard {
tags: ['grafana-agent-mixin'],
addMultiTemplateWithAll(name, metric_name, label_name, all='.*', hide=0):: self {
templating+: {
list+: [{
Expand Down

0 comments on commit 14923ac

Please sign in to comment.