Skip to content

Commit

Permalink
Merge pull request #142 from vbelouso/grafana-datasource-filter
Browse files Browse the repository at this point in the history
add grafana datasource filter
  • Loading branch information
vbelouso authored Sep 6, 2023
2 parents 96aae13 + 8ebb76c commit c079e1b
Showing 1 changed file with 51 additions and 16 deletions.
67 changes: 51 additions & 16 deletions dashboards/grafana-dashboard-exhort.configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,43 @@ apiVersion: v1
data:
exhort-dashboard.json: |-
{
"__inputs": [
{
"name": "DS_APP-SRE-STAGE-01-PROMETHEUS",
"label": "app-sre-stage-01-prometheus",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}
],
"__elements": {},
"__requires": [
{
"type": "grafana",
"id": "grafana",
"name": "Grafana",
"version": "9.3.8"
},
{
"type": "datasource",
"id": "prometheus",
"name": "Prometheus",
"version": "1.0.0"
},
{
"type": "panel",
"id": "stat",
"name": "Stat",
"version": ""
},
{
"type": "panel",
"id": "timeseries",
"name": "Time series",
"version": ""
}
],
"annotations": {
"list": [
{
Expand All @@ -28,13 +65,14 @@ data:
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 173924,
"id": null,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
"uid": "${DS_APP-SRE-STAGE-01-PROMETHEUS}"
},
"fieldConfig": {
"defaults": {
Expand Down Expand Up @@ -84,7 +122,7 @@ data:
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
"uid": "${DS_APP-SRE-STAGE-01-PROMETHEUS}"
},
"editorMode": "code",
"expr": "sum(rate(http_server_requests_seconds_count{status!~\"[4-5].*\", namespace=\"exhort-stage\", job=\"exhort\"}[2m])) / \n(sum(rate(http_server_requests_seconds_count{namespace=\"exhort-stage\", job=\"exhort\"}[2m])) - \n(sum(rate(http_server_requests_seconds_count{status=~\"404|499\", namespace=\"exhort-stage\", job=\"exhort\"}[2m])) or vector(0)))",
Expand All @@ -99,7 +137,7 @@ data:
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
"uid": "${DS_APP-SRE-STAGE-01-PROMETHEUS}"
},
"description": "",
"fieldConfig": {
Expand Down Expand Up @@ -182,7 +220,7 @@ data:
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
"uid": "${DS_APP-SRE-STAGE-01-PROMETHEUS}"
},
"editorMode": "code",
"expr": "sum(rate(http_server_requests_seconds_count{namespace=\"exhort-stage\", job=\"exhort\"}[2m]))",
Expand All @@ -199,7 +237,7 @@ data:
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
"uid": "${DS_APP-SRE-STAGE-01-PROMETHEUS}"
},
"description": "",
"fieldConfig": {
Expand Down Expand Up @@ -282,7 +320,7 @@ data:
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
"uid": "${DS_APP-SRE-STAGE-01-PROMETHEUS}"
},
"editorMode": "code",
"expr": "sum(rate(http_server_requests_seconds_count{namespace=\"exhort-stage\", job=\"exhort\"}[2m])) by (uri)",
Expand All @@ -298,7 +336,7 @@ data:
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
"uid": "${DS_APP-SRE-STAGE-01-PROMETHEUS}"
},
"description": "",
"fieldConfig": {
Expand Down Expand Up @@ -382,7 +420,7 @@ data:
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
"uid": "${DS_APP-SRE-STAGE-01-PROMETHEUS}"
},
"editorMode": "code",
"expr": "sum(rate(http_server_requests_seconds_count{namespace=~\"exhort-stage\", job=\"exhort\", status!~\"5..\"}[7d]))\n/\nsum(rate(http_server_requests_seconds_count{namespace=~\"exhort-stage\", job=\"exhort\"}[7d]))",
Expand All @@ -397,7 +435,7 @@ data:
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
"uid": "${DS_APP-SRE-STAGE-01-PROMETHEUS}"
},
"description": "",
"fieldConfig": {
Expand Down Expand Up @@ -479,7 +517,7 @@ data:
{
"datasource": {
"type": "prometheus",
"uid": "${datasource}"
"uid": "${DS_APP-SRE-STAGE-01-PROMETHEUS}"
},
"editorMode": "code",
"expr": "sum(rate(http_server_requests_seconds_count{namespace=~\"exhort-stage\", job=\"exhort\", status!~\"5..\"}[7d]))\n/\nsum(rate(http_server_requests_seconds_count{namespace=~\"exhort-stage\", job=\"exhort\"}[7d]))",
Expand Down Expand Up @@ -515,7 +553,7 @@ data:
"query": "prometheus",
"queryValue": "",
"refresh": 1,
"regex": "",
"regex": "app-sre-stage-01-prometheus|app-sre-prod-01-prometheus",
"skipUrlSync": false,
"type": "datasource"
}
Expand Down Expand Up @@ -558,8 +596,5 @@ data:
}
kind: ConfigMap
metadata:
creationTimestamp: null
name: grafana-dashboard-exhort
labels:
grafana_dashboard: "true"
annotations:
grafana-folder: /grafana-dashboard-definitions/Trusted-Content

0 comments on commit c079e1b

Please sign in to comment.