From 8f836c8633139d2451032dfac472dafe3d2f7712 Mon Sep 17 00:00:00 2001 From: Ashwani Singh Date: Tue, 13 Aug 2024 00:00:29 +0530 Subject: [PATCH] Datasource --- charts/pga/Chart.yaml | 5 +- .../alertmanager/config/alertmanager.yaml | 52 + .../alerts/alertmanager/kustomization.yaml | 17 + .../pga/grafana/dashboards/kustomization.yaml | 4 +- .../dashboards/opentelemetry-apm/apm.json | 2162 +++++++++-------- .../datasources/pga}/alertmanager.yaml | 0 .../datasources/pga/kustomization.yaml | 8 + charts/pga/grafana/datasources/pga/loki.yaml | 2 +- .../grafana/datasources/pga/prometheus.yaml | 3 +- .../datasources/thanos/kustomization.yaml | 1 - charts/pga/templates/datasources/loki.yaml | 33 - .../pga/templates/datasources/prometheus.yaml | 30 - charts/pga/templates/datasources/tempo.yaml | 34 - charts/pga/templates/datasources/thanos.yaml | 29 - charts/pga/values.yaml | 1 + 15 files changed, 1176 insertions(+), 1205 deletions(-) create mode 100644 charts/pga/alerts/alertmanager/config/alertmanager.yaml create mode 100644 charts/pga/alerts/alertmanager/kustomization.yaml rename charts/pga/{templates/datasources => grafana/datasources/pga}/alertmanager.yaml (100%) create mode 100644 charts/pga/grafana/datasources/pga/kustomization.yaml delete mode 100644 charts/pga/templates/datasources/loki.yaml delete mode 100644 charts/pga/templates/datasources/prometheus.yaml delete mode 100644 charts/pga/templates/datasources/tempo.yaml delete mode 100644 charts/pga/templates/datasources/thanos.yaml diff --git a/charts/pga/Chart.yaml b/charts/pga/Chart.yaml index 353086cc..bcca83ef 100644 --- a/charts/pga/Chart.yaml +++ b/charts/pga/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: pga description: A Helm chart for prometheus, grafana and alertmanager type: application -version: 1.0.0 -appVersion: 1.0.0 +version: 1.0.1 +appVersion: 1.0.1 maintainers: - name: ashwani-opstree @@ -22,6 +22,7 @@ dependencies: alias: kube tags: - monitoring + condition: kube.enabled - name: prometheus-adapter version: 4.10.0 diff --git a/charts/pga/alerts/alertmanager/config/alertmanager.yaml b/charts/pga/alerts/alertmanager/config/alertmanager.yaml new file mode 100644 index 00000000..0e84f18e --- /dev/null +++ b/charts/pga/alerts/alertmanager/config/alertmanager.yaml @@ -0,0 +1,52 @@ +global: + resolve_timeout: 5m +route: + group_wait: 30s + group_interval: 5m + repeat_interval: 30m + receiver: "null" + group_by: + - job + - alertname + - severity + routes: + - receiver: "null" + match: + alertname: Watchdog + - receiver: "alerts-infra" + group_wait: 10s + continue: true + match_re: + severity: warning|high + channel: slack + team: devops +receivers: + - name: "null" + # - name: "email" + # email_configs: + # - to: '' + # from: '' + # smarthost: '' + # auth_username: '' + # auth_password: '' + # require_tls: yes + # send_resolved: true + - name: "alerts-infra" + slack_configs: + - api_url: 'https://hooks.slack.com/services/' + send_resolved: true + channel: '#alerts-infra' + icon_url: https://avatars3.githubusercontent.com/u/3380462 + title: '[{{ .Status | toUpper }}{{ if eq .Status "firing" }}:{{ .Alerts.Firing | len }}{{ end }}] {{ .CommonLabels.alertname }}' + text: >- + {{ range .Alerts }} + *Alert:* {{ .Annotations.description }} - `{{ .Labels.severity }}` + + *Description:* {{ .Annotations.description }} + + *Graph:* <{{ .GeneratorURL }}|:chart_with_upwards_trend:> *Runbook:* <{{ .Annotations.runbook }}|:spiral_note_pad:> + + *Details:* + {{ range .Labels.SortedPairs }} • *{{ .Name }}:* `{{ .Value }}` + {{ end }} + {{ end }} \ No newline at end of file diff --git a/charts/pga/alerts/alertmanager/kustomization.yaml b/charts/pga/alerts/alertmanager/kustomization.yaml new file mode 100644 index 00000000..26ec97e9 --- /dev/null +++ b/charts/pga/alerts/alertmanager/kustomization.yaml @@ -0,0 +1,17 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namePrefix: alertmanager- +namespace: monitoring +commonLabels: + app: kube-alertmanager + release: kube + prometheus: kube + +generatorOptions: + disableNameSuffixHash: true + +secretGenerator: + - name: kube-alertmanager + files: + - config/alertmanager.yaml + type: Opaque diff --git a/charts/pga/grafana/dashboards/kustomization.yaml b/charts/pga/grafana/dashboards/kustomization.yaml index b3780909..bd9d2fc6 100644 --- a/charts/pga/grafana/dashboards/kustomization.yaml +++ b/charts/pga/grafana/dashboards/kustomization.yaml @@ -3,5 +3,5 @@ kind: Kustomization namespace: monitoring nameSuffix: -grafana-dashboard -bases: - - opentelmetry-apm +resources: +- opentelemetry-apm diff --git a/charts/pga/grafana/dashboards/opentelemetry-apm/apm.json b/charts/pga/grafana/dashboards/opentelemetry-apm/apm.json index 01ff4729..e41e9ad4 100644 --- a/charts/pga/grafana/dashboards/opentelemetry-apm/apm.json +++ b/charts/pga/grafana/dashboards/opentelemetry-apm/apm.json @@ -1,1174 +1,1194 @@ { - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": { - "type": "grafana", - "uid": "-- Grafana --" - }, - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "description": "A language-agnostic application performance management(APM) with OpenTelemetry, Grafana, and Prometheus.", - "editable": true, - "fiscalYearStartMonth": 0, - "gnetId": 19419, - "graphTooltip": 0, - "id": 29, - "links": [], - "liveNow": false, - "panels": [ + "annotations": { + "list": [ { + "builtIn": 1, "datasource": { - "type": "prometheus", - "uid": "prometheus" + "type": "grafana", + "uid": "-- Grafana --" }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "fixedColor": "green", - "mode": "fixed" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] - }, - "unit": "short" + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "description": "A language-agnostic application performance management(APM) with OpenTelemetry, Grafana, and Prometheus.", + "editable": true, + "fiscalYearStartMonth": 0, + "gnetId": 19419, + "graphTooltip": 0, + "id": 24, + "links": [], + "liveNow": false, + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "green", + "mode": "fixed" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] }, - "overrides": [] + "unit": "short" }, - "gridPos": { - "h": 4, - "w": 6, - "x": 0, - "y": 0 + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 6, + "x": 0, + "y": 0 + }, + "id": 2, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false }, - "id": 2, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "percentChangeColorMode": "standard", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "11.1.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true + "editorMode": "code", + "expr": "sum(duration_milliseconds_count{span_kind=\"SPAN_KIND_SERVER\", service_name=\"$app\", http_route=~\"$route\"}) by(service_name)", + "instant": false, + "legendFormat": "{{label_name}}", + "range": true, + "refId": "A" }, - "pluginVersion": "11.1.0", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "editorMode": "code", - "expr": "sum(duration_milliseconds_count{span_kind=\"SPAN_KIND_SERVER\", service_name=\"$app\", http_route=~\"$route\"}) by(service_name)", - "instant": false, - "legendFormat": "{{label_name}}", - "range": true, - "refId": "A" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "editorMode": "code", - "exemplar": false, - "expr": "sum(duration_milliseconds_count{span_kind=\"SPAN_KIND_SERVER\", service_name=\"$app\", http_route=~\"$route\"}) by(service_name)", - "hide": false, - "instant": true, - "legendFormat": "__auto", - "range": false, - "refId": "B" - } - ], - "title": "Total Request", - "transformations": [ - { - "id": "seriesToRows", - "options": {} + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" }, - { - "id": "sortBy", - "options": { - "fields": {}, - "sort": [ - { - "field": "Time" - } - ] - } + "editorMode": "code", + "exemplar": false, + "expr": "sum(duration_milliseconds_count{span_kind=\"SPAN_KIND_SERVER\", service_name=\"$app\", http_route=~\"$route\"}) by(service_name)", + "hide": false, + "instant": true, + "legendFormat": "__auto", + "range": false, + "refId": "B" + } + ], + "title": "Total Request", + "transformations": [ + { + "id": "seriesToRows", + "options": {} + }, + { + "id": "sortBy", + "options": { + "fields": {}, + "sort": [ + { + "field": "Time" + } + ] } - ], - "type": "stat" + } + ], + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] - }, - "unit": "short" + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" }, - "overrides": [] + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "short" }, - "gridPos": { - "h": 8, - "w": 6, - "x": 6, - "y": 0 + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 6, + "y": 0 + }, + "id": 3, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false }, - "id": 3, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "percentChangeColorMode": "standard", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "11.1.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true + "editorMode": "code", + "exemplar": false, + "expr": "sum(duration_milliseconds_count{service_name=\"$app\", span_kind=\"SPAN_KIND_SERVER\", http_status_code=~\"^2.*\", http_route=~\"$route\"}) by(http_status_code)", + "format": "time_series", + "instant": false, + "legendFormat": "Http Status 2XX", + "range": true, + "refId": "2XX" }, - "pluginVersion": "11.1.0", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "editorMode": "code", - "exemplar": false, - "expr": "sum(duration_milliseconds_count{service_name=\"$app\", span_kind=\"SPAN_KIND_SERVER\", http_status_code=~\"^2.*\", http_route=~\"$route\"}) by(http_status_code)", - "format": "time_series", - "instant": false, - "legendFormat": "Http Status 2XX", - "range": true, - "refId": "2XX" + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "editorMode": "code", - "exemplar": false, - "expr": "sum(duration_milliseconds_count{service_name=\"$app\", span_kind=\"SPAN_KIND_SERVER\", http_status_code=~\"^3.*\", http_route=~\"$route\"}) by(http_status_code)", - "format": "time_series", - "hide": false, - "instant": false, - "legendFormat": "Http Status 3XX", - "range": true, - "refId": "3XX" + "editorMode": "code", + "exemplar": false, + "expr": "sum(duration_milliseconds_count{service_name=\"$app\", span_kind=\"SPAN_KIND_SERVER\", http_status_code=~\"^3.*\", http_route=~\"$route\"}) by(http_status_code)", + "format": "time_series", + "hide": false, + "instant": false, + "legendFormat": "Http Status 3XX", + "range": true, + "refId": "3XX" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "editorMode": "code", - "exemplar": false, - "expr": "sum(duration_milliseconds_count{service_name=\"$app\", span_kind=\"SPAN_KIND_SERVER\", http_status_code=~\"^4.*\", http_route=~\"$route\"}) by(http_status_code)", - "format": "time_series", - "hide": false, - "instant": false, - "legendFormat": "Http Status 4XX", - "range": true, - "refId": "4XX" + "editorMode": "code", + "exemplar": false, + "expr": "sum(duration_milliseconds_count{service_name=\"$app\", span_kind=\"SPAN_KIND_SERVER\", http_status_code=~\"^4.*\", http_route=~\"$route\"}) by(http_status_code)", + "format": "time_series", + "hide": false, + "instant": false, + "legendFormat": "Http Status 4XX", + "range": true, + "refId": "4XX" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "editorMode": "code", - "exemplar": false, - "expr": "sum(duration_milliseconds_count{service_name=\"$app\", span_kind=\"SPAN_KIND_SERVER\", http_status_code=~\"^5.*\", http_route=~\"$route\"}) by(http_status_code)", - "format": "time_series", - "hide": false, - "instant": false, - "legendFormat": "Http Status 5XX", - "range": true, - "refId": "5XX" + "editorMode": "code", + "exemplar": false, + "expr": "sum(duration_milliseconds_count{service_name=\"$app\", span_kind=\"SPAN_KIND_SERVER\", http_status_code=~\"^5.*\", http_route=~\"$route\"}) by(http_status_code)", + "format": "time_series", + "hide": false, + "instant": false, + "legendFormat": "Http Status 5XX", + "range": true, + "refId": "5XX" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "editorMode": "code", - "exemplar": false, - "expr": "sum(duration_milliseconds_count{service_name=\"$app\", span_kind=\"SPAN_KIND_SERVER\", http_status_code=~\"^2.*\", http_route=~\"$route\"}) by(http_status_code)", - "format": "time_series", - "hide": false, - "instant": true, - "legendFormat": "Http Status 2XX", - "range": false, - "refId": "2XX-instant" + "editorMode": "code", + "exemplar": false, + "expr": "sum(duration_milliseconds_count{service_name=\"$app\", span_kind=\"SPAN_KIND_SERVER\", http_status_code=~\"^2.*\", http_route=~\"$route\"}) by(http_status_code)", + "format": "time_series", + "hide": false, + "instant": true, + "legendFormat": "Http Status 2XX", + "range": false, + "refId": "2XX-instant" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "editorMode": "code", - "exemplar": false, - "expr": "sum(duration_milliseconds_count{service_name=\"$app\", span_kind=\"SPAN_KIND_SERVER\", http_status_code=~\"^3.*\", http_route=~\"$route\"}) by(http_status_code)", - "format": "time_series", - "hide": false, - "instant": false, - "legendFormat": "Http Status 3XX", - "range": true, - "refId": "3XX-instant" + "editorMode": "code", + "exemplar": false, + "expr": "sum(duration_milliseconds_count{service_name=\"$app\", span_kind=\"SPAN_KIND_SERVER\", http_status_code=~\"^3.*\", http_route=~\"$route\"}) by(http_status_code)", + "format": "time_series", + "hide": false, + "instant": false, + "legendFormat": "Http Status 3XX", + "range": true, + "refId": "3XX-instant" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "editorMode": "code", - "exemplar": false, - "expr": "sum(duration_milliseconds_count{service_name=\"$app\", span_kind=\"SPAN_KIND_SERVER\", http_status_code=~\"^4.*\", http_route=~\"$route\"}) by(http_status_code)", - "format": "time_series", - "hide": false, - "instant": false, - "legendFormat": "Http Status 4XX", - "range": true, - "refId": "4XX-instant" + "editorMode": "code", + "exemplar": false, + "expr": "sum(duration_milliseconds_count{service_name=\"$app\", span_kind=\"SPAN_KIND_SERVER\", http_status_code=~\"^4.*\", http_route=~\"$route\"}) by(http_status_code)", + "format": "time_series", + "hide": false, + "instant": false, + "legendFormat": "Http Status 4XX", + "range": true, + "refId": "4XX-instant" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "editorMode": "code", - "exemplar": false, - "expr": "sum(duration_milliseconds_count{service_name=\"$app\", span_kind=\"SPAN_KIND_SERVER\", http_status_code=~\"^5.*\", http_route=~\"$route\"}) by(http_status_code)", - "format": "time_series", - "hide": false, - "instant": false, - "legendFormat": "Http Status 5XX", - "range": true, - "refId": "5XX-instant" + "editorMode": "code", + "exemplar": false, + "expr": "sum(duration_milliseconds_count{service_name=\"$app\", span_kind=\"SPAN_KIND_SERVER\", http_status_code=~\"^5.*\", http_route=~\"$route\"}) by(http_status_code)", + "format": "time_series", + "hide": false, + "instant": false, + "legendFormat": "Http Status 5XX", + "range": true, + "refId": "5XX-instant" + } + ], + "title": "Requests Count", + "transformations": [ + { + "id": "seriesToRows", + "options": {} + }, + { + "id": "sortBy", + "options": { + "fields": {}, + "sort": [ + { + "field": "Time" + } + ] } - ], - "title": "Requests Count", - "transformations": [ - { - "id": "seriesToRows", - "options": {} + }, + { + "id": "partitionByValues", + "options": { + "fields": [ + "Metric" + ], + "keepFields": false + } + } + ], + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "description": "request amount distribution", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" }, - { - "id": "sortBy", - "options": { - "fields": {}, - "sort": [ - { - "field": "Time" - } - ] + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false } }, - { - "id": "partitionByValues", - "options": { - "fields": [ - "Metric" - ], - "keepFields": false - } - } - ], - "type": "stat" + "mappings": [], + "unit": "short" + }, + "overrides": [] }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" + "gridPos": { + "h": 8, + "w": 6, + "x": 12, + "y": 0 + }, + "id": 4, + "options": { + "displayLabels": [ + "percent" + ], + "legend": { + "displayMode": "list", + "placement": "right", + "showLegend": true, + "values": [ + "percent" + ] }, - "description": "request amount distribution", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - } - }, - "mappings": [], - "unit": "short" - }, - "overrides": [] + "pieType": "donut", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false }, - "gridPos": { - "h": 8, - "w": 6, - "x": 12, - "y": 0 + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "editorMode": "code", + "expr": "sum(duration_milliseconds_count{span_kind=\"SPAN_KIND_SERVER\", service_name=\"$app\", http_route=~\"$route\"}) by(span_name)", + "instant": false, + "legendFormat": "{{label_name}}", + "range": true, + "refId": "A" + } + ], + "title": "Request Distribution", + "type": "piechart" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "description": "cumulative latency distribution", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } + }, + "mappings": [], + "unit": "ms" }, - "id": 4, - "options": { - "displayLabels": [ + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 6, + "x": 18, + "y": 0 + }, + "id": 7, + "options": { + "displayLabels": [ + "percent" + ], + "legend": { + "displayMode": "list", + "placement": "right", + "showLegend": true, + "values": [ "percent" + ] + }, + "pieType": "donut", + "reduceOptions": { + "calcs": [ + "lastNotNull" ], - "legend": { - "displayMode": "list", - "placement": "right", - "showLegend": true, - "values": [ - "percent" - ] + "fields": "", + "values": false + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" }, - "pieType": "donut", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false + "editorMode": "code", + "exemplar": false, + "expr": "sum(duration_milliseconds_sum{span_kind=\"SPAN_KIND_SERVER\", service_name=\"$app\", http_route=~\"$route\"}) by(span_name)", + "instant": true, + "legendFormat": "{{label_name}}", + "range": false, + "refId": "A" + } + ], + "title": "Loading Distribution", + "type": "piechart" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "description": "overall request rate per minute over last 3 minutes", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" }, - "tooltip": { - "mode": "single", - "sort": "none" - } + "mappings": [], + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "reqpm" }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "editorMode": "code", - "expr": "sum(duration_milliseconds_count{span_kind=\"SPAN_KIND_SERVER\", service_name=\"$app\", http_route=~\"$route\"}) by(span_name)", - "instant": false, - "legendFormat": "{{label_name}}", - "range": true, - "refId": "A" - } - ], - "title": "Request Distribution", - "type": "piechart" + "overrides": [] }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" + "gridPos": { + "h": 4, + "w": 3, + "x": 0, + "y": 4 + }, + "id": 8, + "options": { + "minVizHeight": 75, + "minVizWidth": 75, + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false }, - "description": "cumulative latency distribution", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false + "showThresholdLabels": false, + "showThresholdMarkers": true, + "sizing": "auto" + }, + "pluginVersion": "11.1.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "editorMode": "code", + "expr": "sum(rate(duration_milliseconds_count{span_kind=\"SPAN_KIND_SERVER\", service_name=\"$app\", http_route=~\"$route\"}[3m])*60)", + "hide": false, + "instant": false, + "range": true, + "refId": "B" + } + ], + "title": "Overall Request Rate", + "type": "gauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "description": "percentage of HTTP status 5xx in all requests", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 10 } - }, - "mappings": [], - "unit": "ms" + ] }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 6, - "x": 18, - "y": 0 + "unit": "percentunit" }, - "id": 7, - "options": { - "displayLabels": [ - "percent" + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 3, + "x": 3, + "y": 4 + }, + "id": 9, + "options": { + "minVizHeight": 75, + "minVizWidth": 75, + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" ], - "legend": { - "displayMode": "list", - "placement": "right", - "showLegend": true, - "values": [ - "percent" - ] + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true, + "sizing": "auto" + }, + "pluginVersion": "11.1.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" }, - "pieType": "donut", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false + "editorMode": "code", + "expr": "sum(duration_milliseconds_count{span_kind=\"SPAN_KIND_SERVER\", service_name=\"$app\", http_status_code=~\"5.*|\", http_route=~\"$route\"})/sum(duration_milliseconds_count{span_kind=\"SPAN_KIND_SERVER\", service_name=\"$app\", http_route=~\"$route\"})", + "instant": false, + "range": true, + "refId": "A" + } + ], + "title": "Overall Error Rate", + "type": "gauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "description": "request rate per minute over last 3 minutes", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false }, - "editorMode": "code", - "exemplar": false, - "expr": "sum(duration_milliseconds_sum{span_kind=\"SPAN_KIND_SERVER\", service_name=\"$app\", http_route=~\"$route\"}) by(span_name)", - "instant": true, - "legendFormat": "{{label_name}}", - "range": false, - "refId": "A" - } - ], - "title": "Loading Distribution", - "type": "piechart" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "description": "overall request rate per minute over last 3 minutes", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" }, - "mappings": [], - "thresholds": { - "mode": "percentage", - "steps": [ - { - "color": "green", - "value": null - } - ] + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" }, - "unit": "reqpm" + "thresholdsStyle": { + "mode": "off" + } }, - "overrides": [] - }, - "gridPos": { - "h": 4, - "w": 3, - "x": 0, - "y": 4 - }, - "id": 8, - "options": { - "minVizHeight": 75, - "minVizWidth": 75, - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] }, - "showThresholdLabels": false, - "showThresholdMarkers": true, - "sizing": "auto" + "unit": "reqpm" }, - "pluginVersion": "11.1.0", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "editorMode": "code", - "expr": "sum(rate(duration_milliseconds_count{span_kind=\"SPAN_KIND_SERVER\", service_name=\"$app\", http_route=~\"$route\"}[3m])*60)", - "hide": false, - "instant": false, - "range": true, - "refId": "B" - } - ], - "title": "Overall Request Rate", - "type": "gauge" + "overrides": [] }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" + "gridPos": { + "h": 8, + "w": 8, + "x": 0, + "y": 8 + }, + "id": 1, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true }, - "description": "percentage of HTTP status 5xx in all requests", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "percentage", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 10 - } - ] - }, - "unit": "percentunit" + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "10.0.2", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" }, - "overrides": [] - }, - "gridPos": { - "h": 4, - "w": 3, - "x": 3, - "y": 4 - }, - "id": 9, - "options": { - "minVizHeight": 75, - "minVizWidth": 75, - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false + "editorMode": "code", + "expr": "sum(rate(duration_milliseconds_count{service_name=\"$app\", span_kind=\"SPAN_KIND_SERVER\", http_route=~\"$route\"}[3m])*60) by(span_name)", + "hide": false, + "instant": false, + "legendFormat": "{{label_name}}", + "range": true, + "refId": "B" + } + ], + "title": "Request Rate", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "description": "PR95 latency over last 3 minutes", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" }, - "showThresholdLabels": false, - "showThresholdMarkers": true, - "sizing": "auto" - }, - "pluginVersion": "11.1.0", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false }, - "editorMode": "code", - "expr": "sum(duration_milliseconds_count{span_kind=\"SPAN_KIND_SERVER\", service_name=\"$app\", http_status_code=~\"5.*|\", http_route=~\"$route\"})/sum(duration_milliseconds_count{span_kind=\"SPAN_KIND_SERVER\", service_name=\"$app\", http_route=~\"$route\"})", - "instant": false, - "range": true, - "refId": "A" - } - ], - "title": "Overall Error Rate", - "type": "gauge" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "description": "request rate per minute over last 3 minutes", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null }, - "thresholdsStyle": { - "mode": "off" + { + "color": "red", + "value": 80 } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "reqpm" + ] }, - "overrides": [] + "unit": "ms" }, - "gridPos": { - "h": 8, - "w": 8, - "x": 0, - "y": 8 + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 8, + "y": 8 + }, + "id": 5, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true }, - "id": 1, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "10.0.2", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "editorMode": "code", - "expr": "sum(rate(duration_milliseconds_count{service_name=\"$app\", span_kind=\"SPAN_KIND_SERVER\", http_route=~\"$route\"}[3m])*60) by(span_name)", - "hide": false, - "instant": false, - "legendFormat": "{{label_name}}", - "range": true, - "refId": "B" - } - ], - "title": "Request Rate", - "type": "timeseries" + "editorMode": "code", + "expr": "histogram_quantile(0.95, sum(rate(duration_milliseconds_bucket{span_kind=\"SPAN_KIND_SERVER\", service_name=\"$app\", http_route=~\"$route\"}[3m])) by (le, span_name))", + "instant": false, + "legendFormat": "{{label_name}}", + "range": true, + "refId": "A" + } + ], + "title": "PR95 Latency", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "description": "PR95 latency over last 3 minutes", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" + "description": "by route and http status code", + "fieldConfig": { + "defaults": { + "color": { + "mode": "continuous-GrYlRd" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null }, - "thresholdsStyle": { - "mode": "off" + { + "color": "red", + "value": 80 } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "ms" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 8, - "x": 8, - "y": 8 - }, - "id": 5, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + ] }, - "tooltip": { - "mode": "single", - "sort": "none" - } + "unit": "ms" }, - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "editorMode": "code", - "expr": "histogram_quantile(0.95, sum(rate(duration_milliseconds_bucket{span_kind=\"SPAN_KIND_SERVER\", service_name=\"$app\", http_route=~\"$route\"}[3m])) by (le, span_name))", - "instant": false, - "legendFormat": "{{label_name}}", - "range": true, - "refId": "A" - } - ], - "title": "PR95 Latency", - "type": "timeseries" + "overrides": [] }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" + "gridPos": { + "h": 8, + "w": 8, + "x": 16, + "y": 8 + }, + "id": 6, + "options": { + "displayMode": "lcd", + "maxVizHeight": 300, + "minVizHeight": 10, + "minVizWidth": 0, + "namePlacement": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false }, - "description": "by route and http status code", - "fieldConfig": { - "defaults": { - "color": { - "mode": "continuous-GrYlRd" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "ms" + "showUnfilled": true, + "sizing": "auto", + "valueMode": "color" + }, + "pluginVersion": "11.1.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 8, - "x": 16, - "y": 8 - }, - "id": 6, - "options": { - "displayMode": "lcd", - "maxVizHeight": 300, - "minVizHeight": 10, - "minVizWidth": 0, - "namePlacement": "auto", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false + "editorMode": "code", + "exemplar": false, + "expr": "sort_desc(duration_milliseconds_sum{span_kind=\"SPAN_KIND_SERVER\", service_name=\"$app\", http_status_code!=\"\", http_route=~\"$route\"} / duration_milliseconds_count{span_kind=\"SPAN_KIND_SERVER\", service_name=\"$app\", http_status_code!=\"\", http_route=~\"$route\"})", + "instant": true, + "legendFormat": "[{{http_status_code}}] {{span_name}}", + "range": false, + "refId": "A" + } + ], + "title": "Average Latency", + "type": "bargauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "description": "Details of each API", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" }, - "showUnfilled": true, - "sizing": "auto", - "valueMode": "color" - }, - "pluginVersion": "11.1.0", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" }, - "editorMode": "code", - "exemplar": false, - "expr": "sort_desc(duration_milliseconds_sum{span_kind=\"SPAN_KIND_SERVER\", service_name=\"$app\", http_status_code!=\"\", http_route=~\"$route\"} / duration_milliseconds_count{span_kind=\"SPAN_KIND_SERVER\", service_name=\"$app\", http_status_code!=\"\", http_route=~\"$route\"})", - "instant": true, - "legendFormat": "[{{http_status_code}}] {{span_name}}", - "range": false, - "refId": "A" + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] } - ], - "title": "Average Latency", - "type": "bargauge" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" }, - "description": "Details of each API", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "custom": { - "align": "auto", - "cellOptions": { - "type": "auto" - }, - "inspect": false + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Request Rate" }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "Request Rate" - }, - "properties": [ - { - "id": "custom.cellOptions", - "value": { - "type": "sparkline" - } - }, - { - "id": "color", - "value": { - "mode": "palette-classic" - } - }, - { - "id": "unit", - "value": "reqpm" + "properties": [ + { + "id": "custom.cellOptions", + "value": { + "type": "sparkline" } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Error Rate" }, - "properties": [ - { - "id": "custom.cellOptions", - "value": { - "spanNulls": false, - "type": "sparkline" - } - }, - { - "id": "color", - "value": { - "mode": "palette-classic" - } - }, - { - "id": "unit", - "value": "percentunit" + { + "id": "color", + "value": { + "mode": "palette-classic" } - ] - }, - { - "matcher": { - "id": "byName", - "options": "PR95" }, - "properties": [ - { - "id": "custom.cellOptions", - "value": { - "hideValue": false, - "type": "sparkline" - } - }, - { - "id": "color", - "value": { - "mode": "palette-classic" - } - }, - { - "id": "unit", - "value": "ms" - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 24, - "x": 0, - "y": 16 - }, - "id": 10, - "options": { - "cellHeight": "sm", - "footer": { - "countRows": false, - "enablePagination": true, - "fields": "", - "reducer": [ - "sum" - ], - "show": false - }, - "showHeader": true, - "sortBy": [] - }, - "pluginVersion": "11.1.0", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "editorMode": "code", - "exemplar": false, - "expr": "sum(rate(duration_milliseconds_count{service_name=\"$app\", http_route=~\"$route\", span_kind=\"SPAN_KIND_SERVER\"}[3m])*60) by(service_name, http_method, http_route)", - "format": "time_series", - "hide": false, - "instant": false, - "range": true, - "refId": "Request Rate" + { + "id": "unit", + "value": "reqpm" + } + ] }, { - "datasource": { - "type": "prometheus", - "uid": "prometheus" + "matcher": { + "id": "byName", + "options": "Error Rate" }, - "editorMode": "code", - "expr": "histogram_quantile(0.95, sum(rate(duration_milliseconds_bucket{service_name=\"$app\", http_route=~\"$route\", span_kind=\"SPAN_KIND_SERVER\"}[3m])) by (le, service_name, http_method, http_route))", - "hide": false, - "instant": false, - "range": true, - "refId": "PR95" + "properties": [ + { + "id": "custom.cellOptions", + "value": { + "spanNulls": false, + "type": "sparkline" + } + }, + { + "id": "color", + "value": { + "mode": "palette-classic" + } + }, + { + "id": "unit", + "value": "percentunit" + } + ] }, { - "datasource": { - "type": "prometheus", - "uid": "prometheus" + "matcher": { + "id": "byName", + "options": "PR95" }, - "editorMode": "code", - "exemplar": false, - "expr": "sum(duration_milliseconds_count{service_name=\"$app\", http_route=~\"$route\", span_kind=\"SPAN_KIND_SERVER\", http_status_code!~\"2.*|3.*\"}) by(service_name, http_method, http_route) / sum(duration_milliseconds_count{service_name=\"$app\", http_route=~\"$route\", span_kind=\"SPAN_KIND_SERVER\"}) by(service_name, http_method, http_route)", - "format": "time_series", - "hide": false, - "instant": false, - "range": true, - "refId": "Error Rate" - } - ], - "title": "Details", - "transformations": [ - { - "id": "timeSeriesTable", - "options": {} - }, - { - "id": "merge", - "options": {} - }, - { - "id": "organize", - "options": { - "excludeByName": { - "Time": true + "properties": [ + { + "id": "custom.cellOptions", + "value": { + "hideValue": false, + "type": "sparkline" + } }, - "includeByName": {}, - "indexByName": { - "Time": 0, - "Trend #PR95 Trend": 7, - "Trend #Request Rate Trend": 5, - "Value #PR95": 8, - "Value #Request Rate": 6, - "http_method": 3, - "http_route": 2, - "http_status_code": 4, - "service_name": 1 + { + "id": "color", + "value": { + "mode": "palette-classic" + } }, - "renameByName": { - "Trend": "Request Rate Trend", - "Trend #Error Rate": "Error Rate", - "Trend #Error Rate Trend": "Error Rate Trend", - "Trend #PR95": "PR95", - "Trend #PR95 Trend": "PR95 Latency Trend", - "Trend #Request Rate": "Request Rate", - "Trend #Request Rate Trend": "Request Rate Trend", - "Value": "Request Rate", - "Value #A": "Error Rate", - "Value #Error Rate": "Error Rate", - "Value #PR95": "PR95 Latency", - "Value #Request Rate": "Request Rate", - "http_method": "Method", - "http_route": "Route", - "http_status_code": "Status Code", - "service_name": "Application" + { + "id": "unit", + "value": "ms" } - } + ] } - ], - "type": "table" - } - ], - "refresh": "30s", - "schemaVersion": 39, - "tags": [], - "templating": { - "list": [ + ] + }, + "gridPos": { + "h": 10, + "w": 24, + "x": 0, + "y": 16 + }, + "id": 10, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "enablePagination": true, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [] + }, + "pluginVersion": "11.1.0", + "targets": [ { - "current": { - "selected": false, - "text": "traya-api-server-dev-dev", - "value": "traya-api-server-dev-dev" - }, "datasource": { "type": "prometheus", "uid": "prometheus" }, - "definition": "label_values(service_name)", - "hide": 0, - "includeAll": false, - "label": "Application", - "multi": false, - "name": "app", - "options": [], - "query": { - "query": "label_values(service_name)", - "refId": "PrometheusVariableQueryEditor-VariableQuery" - }, - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "type": "query" + "editorMode": "code", + "exemplar": false, + "expr": "sum(rate(duration_milliseconds_count{service_name=\"$app\", http_route=~\"$route\", span_kind=\"SPAN_KIND_SERVER\"}[3m])*60) by(service_name, http_method, http_route)", + "format": "time_series", + "hide": false, + "instant": false, + "range": true, + "refId": "Request Rate" }, { - "current": { - "selected": false, - "text": [ - "All" - ], - "value": [ - "$__all" - ] - }, "datasource": { "type": "prometheus", "uid": "prometheus" }, - "definition": "label_values(http_route)", - "hide": 0, - "includeAll": true, - "label": "Route", - "multi": true, - "name": "route", - "options": [], - "query": { - "query": "label_values(http_route)", - "refId": "PrometheusVariableQueryEditor-VariableQuery" + "editorMode": "code", + "expr": "histogram_quantile(0.95, sum(rate(duration_milliseconds_bucket{service_name=\"$app\", http_route=~\"$route\", span_kind=\"SPAN_KIND_SERVER\"}[3m])) by (le, service_name, http_method, http_route))", + "hide": false, + "instant": false, + "range": true, + "refId": "PR95" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" }, - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "type": "query" + "editorMode": "code", + "exemplar": false, + "expr": "sum(duration_milliseconds_count{service_name=\"$app\", http_route=~\"$route\", span_kind=\"SPAN_KIND_SERVER\", http_status_code!~\"2.*|3.*\"}) by(service_name, http_method, http_route) / sum(duration_milliseconds_count{service_name=\"$app\", http_route=~\"$route\", span_kind=\"SPAN_KIND_SERVER\"}) by(service_name, http_method, http_route)", + "format": "time_series", + "hide": false, + "instant": false, + "range": true, + "refId": "Error Rate" } - ] - }, - "time": { - "from": "now-6h", - "to": "now" - }, - "timepicker": {}, - "timezone": "", - "title": "OpenTelemetry APM", - "uid": "opentelemetry-apm", - "version": 2, - "weekStart": "" - } - \ No newline at end of file + ], + "title": "Details", + "transformations": [ + { + "id": "timeSeriesTable", + "options": {} + }, + { + "id": "merge", + "options": {} + }, + { + "id": "organize", + "options": { + "excludeByName": { + "Time": true + }, + "includeByName": {}, + "indexByName": { + "Time": 0, + "Trend #PR95 Trend": 7, + "Trend #Request Rate Trend": 5, + "Value #PR95": 8, + "Value #Request Rate": 6, + "http_method": 3, + "http_route": 2, + "http_status_code": 4, + "service_name": 1 + }, + "renameByName": { + "Trend": "Request Rate Trend", + "Trend #Error Rate": "Error Rate", + "Trend #Error Rate Trend": "Error Rate Trend", + "Trend #PR95": "PR95", + "Trend #PR95 Trend": "PR95 Latency Trend", + "Trend #Request Rate": "Request Rate", + "Trend #Request Rate Trend": "Request Rate Trend", + "Value": "Request Rate", + "Value #A": "Error Rate", + "Value #Error Rate": "Error Rate", + "Value #PR95": "PR95 Latency", + "Value #Request Rate": "Request Rate", + "http_method": "Method", + "http_route": "Route", + "http_status_code": "Status Code", + "service_name": "Application" + } + } + } + ], + "type": "table" + } + ], + "refresh": "30s", + "schemaVersion": 39, + "tags": [ + "OpenTelemetry" + ], + "templating": { + "list": [ + { + "current": { + "selected": false, + "text": "kube-prom", + "value": "prometheus" + }, + "hide": 0, + "includeAll": false, + "label": "DataSource", + "multi": false, + "name": "datasource", + "options": [], + "query": "prometheus", + "refresh": 1, + "regex": "/^kube/", + "skipUrlSync": false, + "type": "datasource" + }, + { + "current": { + "isNone": true, + "selected": false, + "text": "None", + "value": "" + }, + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "definition": "label_values(service_name)", + "hide": 0, + "includeAll": false, + "label": "Application", + "multi": false, + "name": "app", + "options": [], + "query": { + "query": "label_values(service_name)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": { + "selected": true, + "text": [ + "All" + ], + "value": [ + "$__all" + ] + }, + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "definition": "label_values(http_route)", + "hide": 0, + "includeAll": true, + "label": "Route", + "multi": true, + "name": "route", + "options": [], + "query": { + "query": "label_values(http_route)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + } + ] + }, + "time": { + "from": "now-6h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "OpenTelemetry / APM", + "uid": "apm", + "version": 3, + "weekStart": "" +} \ No newline at end of file diff --git a/charts/pga/templates/datasources/alertmanager.yaml b/charts/pga/grafana/datasources/pga/alertmanager.yaml similarity index 100% rename from charts/pga/templates/datasources/alertmanager.yaml rename to charts/pga/grafana/datasources/pga/alertmanager.yaml diff --git a/charts/pga/grafana/datasources/pga/kustomization.yaml b/charts/pga/grafana/datasources/pga/kustomization.yaml new file mode 100644 index 00000000..72e25d48 --- /dev/null +++ b/charts/pga/grafana/datasources/pga/kustomization.yaml @@ -0,0 +1,8 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: +- loki.yaml +- prometheus.yaml +- tempo.yaml +- alertmanager.yaml diff --git a/charts/pga/grafana/datasources/pga/loki.yaml b/charts/pga/grafana/datasources/pga/loki.yaml index 66b839b4..70136336 100644 --- a/charts/pga/grafana/datasources/pga/loki.yaml +++ b/charts/pga/grafana/datasources/pga/loki.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: kube-loki-datasource - namespace: logging + namespace: monitoring labels: grafana_datasource: "1" app: kube-grafana diff --git a/charts/pga/grafana/datasources/pga/prometheus.yaml b/charts/pga/grafana/datasources/pga/prometheus.yaml index 0c9d5fbb..d0275201 100644 --- a/charts/pga/grafana/datasources/pga/prometheus.yaml +++ b/charts/pga/grafana/datasources/pga/prometheus.yaml @@ -11,7 +11,7 @@ data: kube-prometheus.yaml: |- apiVersion: 1 datasources: - - name: "kube" + - name: "kube-prom" type: prometheus uid: prometheus url: http://kube-prometheus.monitoring:9090/ @@ -23,6 +23,5 @@ data: exemplarTraceIdDestinations: - datasourceUid: tempo name: TraceID - httpMethod: POST readOnly: false editable: true diff --git a/charts/pga/grafana/datasources/thanos/kustomization.yaml b/charts/pga/grafana/datasources/thanos/kustomization.yaml index f45d4c38..7b3649cb 100644 --- a/charts/pga/grafana/datasources/thanos/kustomization.yaml +++ b/charts/pga/grafana/datasources/thanos/kustomization.yaml @@ -3,4 +3,3 @@ kind: Kustomization bases: - thanos.yaml - - \ No newline at end of file diff --git a/charts/pga/templates/datasources/loki.yaml b/charts/pga/templates/datasources/loki.yaml deleted file mode 100644 index fc87b5ad..00000000 --- a/charts/pga/templates/datasources/loki.yaml +++ /dev/null @@ -1,33 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: kube-loki-datasource - namespace: logging - labels: - grafana_datasource: "1" - app: kube-grafana - prometheus: kube -data: - kube-loki.yaml: |- - apiVersion: 1 - datasources: - - uid: logging - orgId: 1 - name: logging - type: loki - typeName: Loki - access: proxy - url: http://loki-logging-gateway.logging.svc - password: '' - user: '' - database: '' - basicAuth: false - isDefault: false - jsonData: - derivedFields: - - datasourceUid: tempo - matcherRegex: (?:trace_id)=(\w+) - name: TraceID - url: $${__value.raw} - readOnly: false - editable: true \ No newline at end of file diff --git a/charts/pga/templates/datasources/prometheus.yaml b/charts/pga/templates/datasources/prometheus.yaml deleted file mode 100644 index 4dea4883..00000000 --- a/charts/pga/templates/datasources/prometheus.yaml +++ /dev/null @@ -1,30 +0,0 @@ -{{- if not .Values.thanos.enabled }} -apiVersion: v1 -kind: ConfigMap -metadata: - name: kube-prometheus-datasource - namespace: monitoring - labels: - grafana_datasource: "1" - app: kube-grafana - prometheus: kube -data: - kube-prometheus.yaml: |- - apiVersion: 1 - datasources: - - name: "kube" - type: prometheus - uid: prometheus - url: http://kube-prometheus.monitoring:9090/ - access: proxy - isDefault: true - jsonData: - httpMethod: POST - timeInterval: 30s - exemplarTraceIdDestinations: - - datasourceUid: tempo - name: TraceID - httpMethod: POST - readOnly: false - editable: true -{{- end }} diff --git a/charts/pga/templates/datasources/tempo.yaml b/charts/pga/templates/datasources/tempo.yaml deleted file mode 100644 index e8b1442f..00000000 --- a/charts/pga/templates/datasources/tempo.yaml +++ /dev/null @@ -1,34 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: tempo-datasource - namespace: monitoring - labels: - grafana_datasource: "1" - app: kube-grafana - prometheus: kube -data: - tempo.yaml: |- - apiVersion: 1 - datasources: - - name: "tempo" - type: tempo - uid: tempo - url: http://tempo.observability.svc.cluster.local:3100/ - access: proxy - jsonData: - handleGrafanaManagedAlerts: false - implementation: prometheus - nodeGraph: - enabled: true - search: - hide: false - lokiSearch: - datasourceUid: loki - tracesToLogs: - datasourceUid: loki - filterBySpanID: false - filterByTraceID: true - mapTagNamesEnabled: false - tags: - - app \ No newline at end of file diff --git a/charts/pga/templates/datasources/thanos.yaml b/charts/pga/templates/datasources/thanos.yaml deleted file mode 100644 index 67e86e32..00000000 --- a/charts/pga/templates/datasources/thanos.yaml +++ /dev/null @@ -1,29 +0,0 @@ -{{- if .Values.thanos.enabled }} -apiVersion: v1 -kind: ConfigMap -metadata: - name: kube-thanos-datasource - namespace: monitoring - labels: - grafana_datasource: "1" - app: kube-grafana - prometheus: kube -data: - kube-thanos.yaml: |- - apiVersion: 1 - datasources: - - name: "kube-thanos" - type: prometheus - uid: thanos - url: http://monitoring-thanos-query-frontend.monitoring:9090/ - access: proxy - jsonData: - httpMethod: POST - timeInterval: 30s - exemplarTraceIdDestinations: - - datasourceUid: tempo - name: TraceID - httpMethod: POST - readOnly: false - editable: true -{{- end }} diff --git a/charts/pga/values.yaml b/charts/pga/values.yaml index 5aa399ed..980092b7 100644 --- a/charts/pga/values.yaml +++ b/charts/pga/values.yaml @@ -118,6 +118,7 @@ app: name: app-prometheus kube: + enabled: yes fullnameOverride: kube commonLabels: prometheus: kube