Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

206 update summary dashboard #207

Merged
merged 6 commits into from
Sep 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 61 additions & 35 deletions monitoring-as-code/src/dashboards/summary-dashboard.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,8 @@ local dashboard = grafana.dashboard;
local template = grafana.template;
local tablePanel = grafana.tablePanel;

local envMap = {
dev: 'dev',
test: 'test|qa',
stage: 'staging|stage',
prod: 'prod|live',
mgmt: 'mgmt',
};

// PromQL selector for environment label
local environmentLabelSelector = 'sli_environment="$environment"';
local environmentLabelSelector = 'sli_environment=~"$environment"';

// The panels for the summary dashboard
local panels = [
Expand Down Expand Up @@ -51,14 +43,6 @@ local panels = [
instant = true,
legendFormat = 'SLO Coverage',
),
).addTarget(
prometheus.target(
'(sum(sum_over_time(aggregated_alb_request_count_sum{%(environmentLabelSelector)s}[30d])) by (service))' %
environmentLabelSelector,
format = 'table',
instant = true,
legendFormat = 'Traffic',
),
).addTransformations(
[
{ id: 'labelsToFields' },
Expand All @@ -72,7 +56,6 @@ local panels = [
'Value #A': 'SLO Status',
'Value #B': '% Change',
'Value #C': 'SLO Coverage',
'Value #D': 'Traffic',
service: 'Service',
environment: 'Environment',
},
Expand Down Expand Up @@ -117,11 +100,7 @@ local panels = [
properties: [{ id: 'unit', value: 'percent' }],
},
{
matcher: { id: 'byName', options: 'Coverage' },
properties: [{ id: 'unit', value: 'none' }],
},
{
matcher: { id: 'byName', options: 'Traffic' },
matcher: { id: 'byName', options: 'SLO Coverage' },
properties: [{ id: 'unit', value: 'none' }],
},
{
Expand All @@ -144,13 +123,12 @@ local panels = [
},
},
} } + { gridPos: { w: 24, h: 10 } },

tablePanel.new(
title = 'SLO Status Aggregated by Service and SLI Category',
datasource = 'prometheus',
).addTarget(
prometheus.target(
'avg(avg_over_time(sli_percentage{%(environmentLabelSelector)s}[30d])) by (service, category) * 100' %
'avg(avg_over_time(sli_percentage{%(environmentLabelSelector)s}[30d])) by (service, sli_type) * 100' %
environmentLabelSelector,
format = 'time_series',
instant = true,
Expand All @@ -161,7 +139,7 @@ local panels = [
{
id: 'labelsToFields',
options: {
valueLabel: 'category',
valueLabel: 'sli_type',
},
},
{
Expand All @@ -173,16 +151,24 @@ local panels = [
Value: true,
},
indexByName: {
Availability: 3,
Latency: 4,
'Pipeline Correctness': 5,
'Pipeline Freshness': 6,
availability: 3,
latency: 4,
correctness: 5,
freshness: 6,
throughput: 7,
iops: 8,
Time: 0,
Value: 7,
Value: 9,
service: 2,
},
renameByName: {
service: 'Service',
availability: 'Availability',
latency: 'Latency',
correctness: 'Pipeline Correctness',
freshness: 'Pipeline Freshness',
throughput: 'Throughput',
iops: 'IOPS',
},
},
},
Expand All @@ -202,7 +188,45 @@ local panels = [
overrides+:
[
{
matcher: { id: 'byName', options: 'Availability' },
matcher: { id: 'byName', options: 'availability' },
properties: [
{ id: 'unit', value: 'percent' },
{ id: 'custom.displayMode', value: 'basic' },
{
id: 'thresholds',
value: {
mode: 'absolute',
steps: [
{ color: 'rgba(86, 166, 75, 0.01)', value: null },
{ color: 'red', value: 1 },
{ color: '#EAB839', value: 90 },
{ color: 'green', value: 95 },
],
},
},
],
},
{
matcher: { id: 'byName', options: 'latency' },
properties: [
{ id: 'unit', value: 'percent' },
{ id: 'custom.displayMode', value: 'basic' },
{
id: 'thresholds',
value: {
mode: 'absolute',
steps: [
{ color: 'rgba(86, 166, 75, 0.01)', value: null },
{ color: 'red', value: 1 },
{ color: '#EAB839', value: 90 },
{ color: 'green', value: 95 },
],
},
},
],
},
{
matcher: { id: 'byName', options: 'correctness' },
properties: [
{ id: 'unit', value: 'percent' },
{ id: 'custom.displayMode', value: 'basic' },
Expand All @@ -221,7 +245,7 @@ local panels = [
],
},
{
matcher: { id: 'byName', options: 'Latency' },
matcher: { id: 'byName', options: 'freshness' },
properties: [
{ id: 'unit', value: 'percent' },
{ id: 'custom.displayMode', value: 'basic' },
Expand All @@ -240,7 +264,7 @@ local panels = [
],
},
{
matcher: { id: 'byName', options: 'Pipeline Correctness' },
matcher: { id: 'byName', options: 'throughput' },
properties: [
{ id: 'unit', value: 'percent' },
{ id: 'custom.displayMode', value: 'basic' },
Expand All @@ -259,7 +283,7 @@ local panels = [
],
},
{
matcher: { id: 'byName', options: 'Pipeline Freshness' },
matcher: { id: 'byName', options: 'iops' },
properties: [
{ id: 'unit', value: 'percent' },
{ id: 'custom.displayMode', value: 'basic' },
Expand Down Expand Up @@ -329,6 +353,8 @@ local createSummaryDashboard(config) =
datasource = 'prometheus',
query = 'label_values(sli_value, sli_environment)',
refresh = 'load',
includeAll = true,
multi = true,
label = 'Environment',
)
).addPanels(std.prune(panels))
Expand Down