Skip to content

On va quand même pas tout faire tout seul ?

Estimated time to read: 2 minutes

La communauté

Grafana met à disposition des utilisateurs le site Grafana Dashboards qui regroupe des dashboards partagés par la communauté. Il est possible de les importer directement dans Grafana.

Menu d'import d'un dashboard

Il est possible de faire l'import soit directement au format JSON, soit en indiquant l'ID du dashboard qui est affiché sur le site de Grafana.

Les imports JSON

Pour exporter un de vos dashboards, il suffit de cliquer sur le bouton Export as JSON dans le menu Export du dashboard. Dashboard Export

Le bouton Export the dashboard to use in another instance permet de créer une zone input qui, lors de l'import du dashboard, va permettre de choisir les sources de données à utiliser pour le dashboard.

Cela permet de ne pas hardcoder les noms des datasources dans le JSON du dashboard mais de tout de même spécifier le type de datasource à utiliser.

Dashboard Var

Ici, lors de l'import, un formulaire est présenté pour choisir une datasource de type Prometheus.

Importez les dashboards suivants

On vous a préparé quelques dashboards exemples :

DashBoardMonitoring.json
    {
        "__inputs": [
          {
            "name": "DS_PROMETHEUS",
            "label": "prometheus",
            "description": "",
            "type": "datasource",
            "pluginId": "prometheus",
            "pluginName": "Prometheus"
          }
        ],
        "__elements": {},
        "__requires": [
          {
            "type": "grafana",
            "id": "grafana",
            "name": "Grafana",
            "version": "11.6.0"
          },
          {
            "type": "datasource",
            "id": "prometheus",
            "name": "Prometheus",
            "version": "1.0.0"
          },
          {
            "type": "panel",
            "id": "timeseries",
            "name": "Time series",
            "version": ""
          }
        ],
        "annotations": {
          "list": [
            {
              "builtIn": 1,
              "datasource": {
                "type": "prometheus",
                "uid": "${DS_PROMETHEUS}"
              },
              "enable": true,
              "hide": true,
              "iconColor": "rgba(0, 211, 255, 1)",
              "name": "Annotations & Alerts",
              "target": {
                "limit": 100,
                "matchAny": false,
                "tags": [],
                "type": "dashboard"
              },
              "type": "dashboard"
            }
          ]
        },
        "editable": true,
        "fiscalYearStartMonth": 0,
        "graphTooltip": 0,
        "id": null,
        "links": [],
        "panels": [
          {
            "collapsed": false,
            "gridPos": {
              "h": 1,
              "w": 24,
              "x": 0,
              "y": 0
            },
            "id": 4,
            "panels": [],
            "title": "Row title",
            "type": "row"
          },
          {
            "datasource": {
              "type": "prometheus",
              "uid": "${DS_PROMETHEUS}"
            },
            "fieldConfig": {
              "defaults": {
                "color": {
                  "mode": "palette-classic"
                },
                "custom": {
                  "axisBorderShow": false,
                  "axisCenteredZero": false,
                  "axisColorMode": "text",
                  "axisLabel": "",
                  "axisPlacement": "auto",
                  "barAlignment": 0,
                  "barWidthFactor": 0.6,
                  "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"
                  },
                  "thresholdsStyle": {
                    "mode": "off"
                  }
                },
                "mappings": [],
                "thresholds": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "green"
                    },
                    {
                      "color": "red",
                      "value": 80
                    }
                  ]
                },
                "unit": "decbytes"
              },
              "overrides": []
            },
            "gridPos": {
              "h": 8,
              "w": 10,
              "x": 0,
              "y": 1
            },
            "id": 1,
            "options": {
              "legend": {
                "calcs": [
                  "min",
                  "max"
                ],
                "displayMode": "table",
                "placement": "right",
                "showLegend": true
              },
              "tooltip": {
                "hideZeros": false,
                "mode": "single",
                "sort": "none"
              }
            },
            "pluginVersion": "11.6.0",
            "targets": [
              {
                "datasource": {
                  "type": "prometheus",
                  "uid": "${DS_PROMETHEUS}"
                },
                "disableTextWrap": false,
                "editorMode": "builder",
                "exemplar": false,
                "expr": "jvm_memory_used_bytes{service_name=\"lumbercamp\", jvm_memory_pool_name=\"Metaspace\"}",
                "format": "time_series",
                "fullMetaSearch": false,
                "includeNullMetadata": true,
                "instant": false,
                "interval": "",
                "legendFormat": "{{jvm_memory_type}}",
                "range": true,
                "refId": "A",
                "useBackend": false
              },
              {
                "datasource": {
                  "type": "prometheus",
                  "uid": "${DS_PROMETHEUS}"
                },
                "disableTextWrap": false,
                "editorMode": "builder",
                "exemplar": false,
                "expr": "sum(jvm_memory_used_bytes{service_name=\"lumbercamp\", jvm_memory_type=\"heap\"})",
                "format": "time_series",
                "fullMetaSearch": false,
                "hide": false,
                "includeNullMetadata": true,
                "instant": false,
                "interval": "",
                "legendFormat": "heap",
                "range": true,
                "refId": "C",
                "useBackend": false
              }
            ],
            "title": "Memory Usage Lumbercamp",
            "type": "timeseries"
          },
          {
            "datasource": {
              "type": "prometheus",
              "uid": "${DS_PROMETHEUS}"
            },
            "fieldConfig": {
              "defaults": {
                "color": {
                  "mode": "palette-classic"
                },
                "custom": {
                  "axisBorderShow": false,
                  "axisCenteredZero": false,
                  "axisColorMode": "text",
                  "axisLabel": "",
                  "axisPlacement": "auto",
                  "barAlignment": 0,
                  "barWidthFactor": 0.6,
                  "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"
                  },
                  "thresholdsStyle": {
                    "mode": "off"
                  }
                },
                "mappings": [],
                "thresholds": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "green"
                    },
                    {
                      "color": "red",
                      "value": 80
                    }
                  ]
                },
                "unit": "s"
              },
              "overrides": []
            },
            "gridPos": {
              "h": 8,
              "w": 14,
              "x": 10,
              "y": 1
            },
            "id": 3,
            "options": {
              "legend": {
                "calcs": [
                  "min",
                  "max"
                ],
                "displayMode": "table",
                "placement": "right",
                "showLegend": true
              },
              "tooltip": {
                "hideZeros": false,
                "mode": "multi",
                "sort": "none"
              }
            },
            "pluginVersion": "11.6.0",
            "targets": [
              {
                "datasource": {
                  "type": "prometheus",
                  "uid": "${DS_PROMETHEUS}"
                },
                "disableTextWrap": false,
                "editorMode": "code",
                "exemplar": false,
                "expr": "rate(jvm_cpu_time_seconds_total{service_name=\"lumbercamp\"}[1m])",
                "format": "time_series",
                "fullMetaSearch": false,
                "includeNullMetadata": true,
                "instant": false,
                "interval": "",
                "legendFormat": "CPU top 1m",
                "range": true,
                "refId": "A",
                "useBackend": false
              },
              {
                "datasource": {
                  "type": "prometheus",
                  "uid": "${DS_PROMETHEUS}"
                },
                "disableTextWrap": false,
                "editorMode": "code",
                "exemplar": false,
                "expr": "rate(jvm_cpu_time_seconds_total{service_name=\"lumbercamp\"}[5m])",
                "format": "time_series",
                "fullMetaSearch": false,
                "hide": false,
                "includeNullMetadata": true,
                "instant": false,
                "interval": "",
                "legendFormat": "CPU top 5m",
                "range": true,
                "refId": "B",
                "useBackend": false
              },
              {
                "datasource": {
                  "type": "prometheus",
                  "uid": "${DS_PROMETHEUS}"
                },
                "disableTextWrap": false,
                "editorMode": "code",
                "exemplar": false,
                "expr": "rate(jvm_cpu_time_seconds_total{service_name=\"lumbercamp\"}[15m])",
                "format": "time_series",
                "fullMetaSearch": false,
                "hide": false,
                "includeNullMetadata": true,
                "instant": false,
                "interval": "",
                "legendFormat": "CPU top 5m",
                "range": true,
                "refId": "C",
                "useBackend": false
              }
            ],
            "title": "CPU Usage Lumbercamp",
            "type": "timeseries"
          },
          {
            "collapsed": false,
            "gridPos": {
              "h": 1,
              "w": 24,
              "x": 0,
              "y": 9
            },
            "id": 2,
            "panels": [],
            "repeat": "service_name",
            "title": "${service_name}",
            "type": "row"
          },
          {
            "datasource": {
              "type": "prometheus",
              "uid": "${DS_PROMETHEUS}"
            },
            "fieldConfig": {
              "defaults": {
                "color": {
                  "mode": "palette-classic"
                },
                "custom": {
                  "axisBorderShow": false,
                  "axisCenteredZero": false,
                  "axisColorMode": "text",
                  "axisLabel": "",
                  "axisPlacement": "auto",
                  "barAlignment": 0,
                  "barWidthFactor": 0.6,
                  "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"
                  },
                  "thresholdsStyle": {
                    "mode": "off"
                  }
                },
                "mappings": [],
                "thresholds": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "green"
                    },
                    {
                      "color": "red",
                      "value": 80
                    }
                  ]
                },
                "unit": "decbytes"
              },
              "overrides": []
            },
            "gridPos": {
              "h": 8,
              "w": 10,
              "x": 0,
              "y": 10
            },
            "id": 7,
            "options": {
              "legend": {
                "calcs": [
                  "min",
                  "max"
                ],
                "displayMode": "table",
                "placement": "right",
                "showLegend": true
              },
              "tooltip": {
                "hideZeros": false,
                "mode": "single",
                "sort": "none"
              }
            },
            "pluginVersion": "11.6.0",
            "targets": [
              {
                "datasource": {
                  "type": "prometheus",
                  "uid": "${DS_PROMETHEUS}"
                },
                "disableTextWrap": false,
                "editorMode": "builder",
                "exemplar": false,
                "expr": "jvm_memory_used_bytes{service_name=\"$service_name\", jvm_memory_pool_name=\"Metaspace\"}",
                "format": "time_series",
                "fullMetaSearch": false,
                "includeNullMetadata": true,
                "instant": false,
                "interval": "",
                "legendFormat": "{{jvm_memory_type}}",
                "range": true,
                "refId": "A",
                "useBackend": false
              },
              {
                "datasource": {
                  "type": "prometheus",
                  "uid": "${DS_PROMETHEUS}"
                },
                "disableTextWrap": false,
                "editorMode": "builder",
                "exemplar": false,
                "expr": "sum(jvm_memory_used_bytes{service_name=\"$service_name\", jvm_memory_type=\"heap\"})",
                "format": "time_series",
                "fullMetaSearch": false,
                "hide": false,
                "includeNullMetadata": true,
                "instant": false,
                "interval": "",
                "legendFormat": "heap",
                "range": true,
                "refId": "C",
                "useBackend": false
              }
            ],
            "title": "Memory Usage ${service_name}",
            "type": "timeseries"
          },
          {
            "datasource": {
              "type": "prometheus",
              "uid": "${DS_PROMETHEUS}"
            },
            "fieldConfig": {
              "defaults": {
                "color": {
                  "mode": "palette-classic"
                },
                "custom": {
                  "axisBorderShow": false,
                  "axisCenteredZero": false,
                  "axisColorMode": "text",
                  "axisLabel": "",
                  "axisPlacement": "auto",
                  "barAlignment": 0,
                  "barWidthFactor": 0.6,
                  "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"
                  },
                  "thresholdsStyle": {
                    "mode": "off"
                  }
                },
                "mappings": [],
                "thresholds": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "green"
                    },
                    {
                      "color": "red",
                      "value": 80
                    }
                  ]
                },
                "unit": "s"
              },
              "overrides": []
            },
            "gridPos": {
              "h": 8,
              "w": 14,
              "x": 10,
              "y": 10
            },
            "id": 6,
            "options": {
              "legend": {
                "calcs": [
                  "min",
                  "max"
                ],
                "displayMode": "table",
                "placement": "right",
                "showLegend": true
              },
              "tooltip": {
                "hideZeros": false,
                "mode": "multi",
                "sort": "none"
              }
            },
            "pluginVersion": "11.6.0",
            "targets": [
              {
                "datasource": {
                  "type": "prometheus",
                  "uid": "${DS_PROMETHEUS}"
                },
                "disableTextWrap": false,
                "editorMode": "code",
                "exemplar": false,
                "expr": "rate(jvm_cpu_time_seconds_total{service_name=\"${service_name}\"}[1m])",
                "format": "time_series",
                "fullMetaSearch": false,
                "includeNullMetadata": true,
                "instant": false,
                "interval": "",
                "legendFormat": "CPU top 1m",
                "range": true,
                "refId": "A",
                "useBackend": false
              },
              {
                "datasource": {
                  "type": "prometheus",
                  "uid": "${DS_PROMETHEUS}"
                },
                "disableTextWrap": false,
                "editorMode": "code",
                "exemplar": false,
                "expr": "rate(jvm_cpu_time_seconds_total{service_name=\"${service_name}\"}[5m])",
                "format": "time_series",
                "fullMetaSearch": false,
                "hide": false,
                "includeNullMetadata": true,
                "instant": false,
                "interval": "",
                "legendFormat": "CPU top 5m",
                "range": true,
                "refId": "B",
                "useBackend": false
              },
              {
                "datasource": {
                  "type": "prometheus",
                  "uid": "${DS_PROMETHEUS}"
                },
                "disableTextWrap": false,
                "editorMode": "code",
                "exemplar": false,
                "expr": "rate(jvm_cpu_time_seconds_total{service_name=\"${service_name}\"}[15m])",
                "format": "time_series",
                "fullMetaSearch": false,
                "hide": false,
                "includeNullMetadata": true,
                "instant": false,
                "interval": "",
                "legendFormat": "CPU top 5m",
                "range": true,
                "refId": "C",
                "useBackend": false
              }
            ],
            "title": "CPU Usage ${service_name}",
            "type": "timeseries"
          }
        ],
        "schemaVersion": 41,
        "tags": [],
        "templating": {
          "list": [
            {
              "current": {},
              "definition": "label_values(jvm_cpu_count,service_name)",
              "includeAll": false,
              "label": "Service",
              "multi": true,
              "name": "service_name",
              "options": [],
              "query": {
                "qryType": 1,
                "query": "label_values(jvm_cpu_count,service_name)",
                "refId": "PrometheusVariableQueryEditor-VariableQuery"
              },
              "refresh": 1,
              "regex": "",
              "type": "query"
            }
          ]
        },
        "time": {
          "from": "now-6h",
          "to": "now"
        },
        "timepicker": {},
        "timezone": "browser",
        "title": "Dashboard de monitoring",
        "uid": "aeanhk9oqs7skxsc",
        "version": 1,
        "weekStart": ""
      }
Perf DB.json
    {
      "__inputs": [
        {
          "name": "DS_PROMETHEUS",
          "label": "prometheus",
          "description": "",
          "type": "datasource",
          "pluginId": "prometheus",
          "pluginName": "Prometheus"
        }
      ],
      "__elements": {},
      "__requires": [
        {
          "type": "panel",
          "id": "bargauge",
          "name": "Bar gauge",
          "version": ""
        },
        {
          "type": "grafana",
          "id": "grafana",
          "name": "Grafana",
          "version": "11.6.0"
        },
        {
          "type": "panel",
          "id": "piechart",
          "name": "Pie chart",
          "version": ""
        },
        {
          "type": "datasource",
          "id": "prometheus",
          "name": "Prometheus",
          "version": "1.0.0"
        }
      ],
      "annotations": {
        "list": [
          {
            "builtIn": 1,
            "datasource": {
              "type": "datasource",
              "uid": "grafana"
            },
            "enable": true,
            "hide": true,
            "iconColor": "rgba(0, 211, 255, 1)",
            "name": "Annotations & Alerts",
            "target": {
              "limit": 100,
              "matchAny": false,
              "tags": [],
              "type": "dashboard"
            },
            "type": "dashboard"
          }
        ]
      },
      "description": "Observe Spring Boot application with three pillars of observability: Traces (Tempo), Metrics (Prometheus), Logs (Loki) on Grafana through OpenTelemetry and OpenMetrics.",
      "editable": true,
      "fiscalYearStartMonth": 0,
      "graphTooltip": 0,
      "id": null,
      "links": [],
      "panels": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "fieldConfig": {
            "defaults": {
              "color": {
                "mode": "palette-classic"
              },
              "custom": {
                "hideFrom": {
                  "legend": false,
                  "tooltip": false,
                  "viz": false
                }
              },
              "mappings": [],
              "unit": "short"
            },
            "overrides": []
          },
          "gridPos": {
            "h": 9,
            "w": 9,
            "x": 0,
            "y": 0
          },
          "id": 16,
          "options": {
            "displayLabels": [
              "percent"
            ],
            "legend": {
              "displayMode": "list",
              "placement": "right",
              "showLegend": false,
              "values": []
            },
            "pieType": "pie",
            "reduceOptions": {
              "calcs": [
                "range"
              ],
              "fields": "",
              "values": false
            },
            "tooltip": {
              "hideZeros": false,
              "mode": "single",
              "sort": "none"
            }
          },
          "pluginVersion": "11.6.0",
          "targets": [
            {
              "datasource": {
                "type": "prometheus",
                "uid": "${DS_PROMETHEUS}"
              },
              "editorMode": "code",
              "exemplar": false,
              "expr": "sum by(service_name, db_sql_table ) (traces_span_metrics_duration_milliseconds_sum{service_name=\"$app_name\", db_sql_table=~\"$db_sql_table\"})",
              "instant": false,
              "interval": "",
              "legendFormat": "{{db_sql_table}}",
              "range": true,
              "refId": "A"
            }
          ],
          "title": "Requests Count",
          "type": "piechart"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "fieldConfig": {
            "defaults": {
              "color": {
                "fixedColor": "blue",
                "mode": "fixed"
              },
              "mappings": [],
              "thresholds": {
                "mode": "absolute",
                "steps": [
                  {
                    "color": "green"
                  }
                ]
              },
              "unit": "reqps"
            },
            "overrides": []
          },
          "gridPos": {
            "h": 9,
            "w": 15,
            "x": 9,
            "y": 0
          },
          "id": 12,
          "options": {
            "displayMode": "basic",
            "legend": {
              "calcs": [],
              "displayMode": "list",
              "placement": "bottom",
              "showLegend": false
            },
            "maxVizHeight": 300,
            "minVizHeight": 10,
            "minVizWidth": 0,
            "namePlacement": "auto",
            "orientation": "horizontal",
            "reduceOptions": {
              "calcs": [
                "range"
              ],
              "fields": "",
              "values": false
            },
            "showUnfilled": true,
            "sizing": "auto",
            "valueMode": "color"
          },
          "pluginVersion": "11.6.0",
          "targets": [
            {
              "datasource": {
                "type": "prometheus",
                "uid": "${DS_PROMETHEUS}"
              },
              "editorMode": "code",
              "exemplar": true,
              "expr": "sum by(service_name, db_sql_table) (traces_span_metrics_duration_milliseconds_sum{service_name=\"$app_name\", db_sql_table=~\"$db_sql_table\"})",
              "interval": "",
              "legendFormat": "{{db_sql_table}}",
              "range": true,
              "refId": "A"
            }
          ],
          "title": "Request Per Sec",
          "type": "bargauge"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "fieldConfig": {
            "defaults": {
              "color": {
                "fixedColor": "blue",
                "mode": "fixed"
              },
              "mappings": [],
              "thresholds": {
                "mode": "absolute",
                "steps": [
                  {
                    "color": "green"
                  }
                ]
              },
              "unit": "ms"
            },
            "overrides": []
          },
          "gridPos": {
            "h": 7,
            "w": 24,
            "x": 0,
            "y": 9
          },
          "id": 6,
          "options": {
            "displayMode": "basic",
            "legend": {
              "calcs": [],
              "displayMode": "list",
              "placement": "bottom",
              "showLegend": false
            },
            "maxVizHeight": 300,
            "minVizHeight": 10,
            "minVizWidth": 0,
            "namePlacement": "auto",
            "orientation": "horizontal",
            "reduceOptions": {
              "calcs": [
                "range"
              ],
              "fields": "",
              "values": false
            },
            "showUnfilled": true,
            "sizing": "auto",
            "valueMode": "color"
          },
          "pluginVersion": "11.6.0",
          "targets": [
            {
              "datasource": {
                "type": "prometheus",
                "uid": "${DS_PROMETHEUS}"
              },
              "editorMode": "code",
              "exemplar": true,
              "expr": "sum by(db_sql_table)(traces_span_metrics_duration_milliseconds_sum{service_name=\"$app_name\", db_sql_table=~\"$db_sql_table\"}) / \r\nsum by(db_sql_table)(traces_span_metrics_duration_milliseconds_count{service_name=\"$app_name\", db_sql_table=~\"$db_sql_table\"})",
              "interval": "",
              "legendFormat": "{{ span_kind}}",
              "range": true,
              "refId": "A"
            }
          ],
          "title": "Requests Average Duration",
          "type": "bargauge"
        }
      ],
      "refresh": "",
      "schemaVersion": 41,
      "tags": [],
      "templating": {
        "list": [
          {
            "current": {},
            "datasource": {
              "type": "prometheus",
              "uid": "${DS_PROMETHEUS}"
            },
            "definition": "label_values(traces_span_metrics_duration_milliseconds_sum{db_sql_table!=\"\"},service_name)",
            "includeAll": false,
            "label": "Application Name",
            "name": "app_name",
            "options": [],
            "query": {
              "qryType": 1,
              "query": "label_values(traces_span_metrics_duration_milliseconds_sum{db_sql_table!=\"\"},service_name)",
              "refId": "PrometheusVariableQueryEditor-VariableQuery"
            },
            "refresh": 1,
            "regex": "",
            "type": "query"
          },
          {
            "current": {},
            "datasource": {
              "type": "prometheus",
              "uid": "${DS_PROMETHEUS}"
            },
            "definition": "label_values(traces_span_metrics_duration_milliseconds_sum{service_name=\"$app_name\", db_sql_table!=\"\"},db_sql_table)",
            "includeAll": true,
            "label": "Table",
            "multi": true,
            "name": "db_sql_table",
            "options": [],
            "query": {
              "qryType": 1,
              "query": "label_values(traces_span_metrics_duration_milliseconds_sum{service_name=\"$app_name\", db_sql_table!=\"\"},db_sql_table)",
              "refId": "PrometheusVariableQueryEditor-VariableQuery"
            },
            "refresh": 1,
            "regex": "",
            "type": "query"
          }
        ]
      },
      "time": {
        "from": "now-30m",
        "to": "now"
      },
      "timepicker": {},
      "timezone": "",
      "title": "Perf DB",
      "uid": "dLsDQIUnzbazzazeAAazeaa",
      "version": 1,
      "weekStart": ""
    }
Perf Code.json
    {
      "__inputs": [
        {
          "name": "DS_PROMETHEUS",
          "label": "prometheus",
          "description": "",
          "type": "datasource",
          "pluginId": "prometheus",
          "pluginName": "Prometheus"
        }
      ],
      "__elements": {},
      "__requires": [
        {
          "type": "panel",
          "id": "bargauge",
          "name": "Bar gauge",
          "version": ""
        },
        {
          "type": "grafana",
          "id": "grafana",
          "name": "Grafana",
          "version": "11.6.0"
        },
        {
          "type": "panel",
          "id": "piechart",
          "name": "Pie chart",
          "version": ""
        },
        {
          "type": "datasource",
          "id": "prometheus",
          "name": "Prometheus",
          "version": "1.0.0"
        }
      ],
      "annotations": {
        "list": [
          {
            "builtIn": 1,
            "datasource": {
              "type": "datasource",
              "uid": "grafana"
            },
            "enable": true,
            "hide": true,
            "iconColor": "rgba(0, 211, 255, 1)",
            "name": "Annotations & Alerts",
            "target": {
              "limit": 100,
              "matchAny": false,
              "tags": [],
              "type": "dashboard"
            },
            "type": "dashboard"
          }
        ]
      },
      "description": "Observe Spring Boot application with three pillars of observability: Traces (Tempo), Metrics (Prometheus), Logs (Loki) on Grafana through OpenTelemetry and OpenMetrics.",
      "editable": true,
      "fiscalYearStartMonth": 0,
      "graphTooltip": 0,
      "id": null,
      "links": [],
      "panels": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "fieldConfig": {
            "defaults": {
              "color": {
                "mode": "palette-classic"
              },
              "custom": {
                "hideFrom": {
                  "legend": false,
                  "tooltip": false,
                  "viz": false
                }
              },
              "mappings": [],
              "unit": "short"
            },
            "overrides": []
          },
          "gridPos": {
            "h": 9,
            "w": 9,
            "x": 0,
            "y": 0
          },
          "id": 16,
          "options": {
            "displayLabels": [
              "percent"
            ],
            "legend": {
              "displayMode": "list",
              "placement": "right",
              "showLegend": false,
              "values": []
            },
            "pieType": "pie",
            "reduceOptions": {
              "calcs": [
                "range"
              ],
              "fields": "",
              "values": false
            },
            "tooltip": {
              "hideZeros": false,
              "mode": "single",
              "sort": "none"
            }
          },
          "pluginVersion": "11.6.0",
          "targets": [
            {
              "datasource": {
                "type": "prometheus",
                "uid": "${DS_PROMETHEUS}"
              },
              "editorMode": "code",
              "exemplar": false,
              "expr": "sum by (service_name, code_function) (http_client_request_duration_seconds_count{service_name=\"$app_name\", http_response_status_code=~\"$code_function\"})",
              "instant": false,
              "interval": "",
              "legendFormat": "{{code_function}}",
              "range": true,
              "refId": "A"
            }
          ],
          "title": "Requests Count",
          "type": "piechart"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "fieldConfig": {
            "defaults": {
              "color": {
                "fixedColor": "blue",
                "mode": "fixed"
              },
              "mappings": [],
              "thresholds": {
                "mode": "absolute",
                "steps": [
                  {
                    "color": "green"
                  }
                ]
              },
              "unit": "reqps"
            },
            "overrides": []
          },
          "gridPos": {
            "h": 9,
            "w": 15,
            "x": 9,
            "y": 0
          },
          "id": 12,
          "options": {
            "displayMode": "basic",
            "legend": {
              "calcs": [],
              "displayMode": "list",
              "placement": "bottom",
              "showLegend": false
            },
            "maxVizHeight": 300,
            "minVizHeight": 10,
            "minVizWidth": 0,
            "namePlacement": "auto",
            "orientation": "horizontal",
            "reduceOptions": {
              "calcs": [
                "range"
              ],
              "fields": "",
              "values": false
            },
            "showUnfilled": true,
            "sizing": "auto",
            "valueMode": "color"
          },
          "pluginVersion": "11.6.0",
          "targets": [
            {
              "datasource": {
                "type": "prometheus",
                "uid": "${DS_PROMETHEUS}"
              },
              "editorMode": "code",
              "exemplar": true,
              "expr": "sum by (service_name, http_response_status_code) (http_client_request_duration_seconds_count{service_name=\"$app_name\", http_response_status_code=~\"$code_function\"})",
              "format": "time_series",
              "interval": "",
              "legendFormat": "{{http_response_status_code}}",
              "range": true,
              "refId": "A"
            }
          ],
          "title": "Request Per Sec",
          "type": "bargauge"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "fieldConfig": {
            "defaults": {
              "color": {
                "fixedColor": "blue",
                "mode": "fixed"
              },
              "mappings": [],
              "thresholds": {
                "mode": "absolute",
                "steps": [
                  {
                    "color": "green"
                  }
                ]
              },
              "unit": "ms"
            },
            "overrides": []
          },
          "gridPos": {
            "h": 7,
            "w": 24,
            "x": 0,
            "y": 9
          },
          "id": 6,
          "options": {
            "displayMode": "basic",
            "legend": {
              "calcs": [],
              "displayMode": "list",
              "placement": "bottom",
              "showLegend": false
            },
            "maxVizHeight": 300,
            "minVizHeight": 10,
            "minVizWidth": 0,
            "namePlacement": "auto",
            "orientation": "horizontal",
            "reduceOptions": {
              "calcs": [
                "range"
              ],
              "fields": "",
              "values": false
            },
            "showUnfilled": true,
            "sizing": "auto",
            "valueMode": "color"
          },
          "pluginVersion": "11.6.0",
          "targets": [
            {
              "datasource": {
                "type": "prometheus",
                "uid": "${DS_PROMETHEUS}"
              },
              "editorMode": "code",
              "exemplar": true,
              "expr": "sum by(http_response_status_code)(http_client_request_duration_seconds_count{service_name=\"$app_name\", http_response_status_code=~\"$code_function\"}) / \r\nsum by(http_response_status_code)(http_client_request_duration_seconds_count{service_name=\"$app_name\", http_response_status_code=~\"$code_function\"})",
              "interval": "",
              "legendFormat": "{{ span_kind}}",
              "range": true,
              "refId": "A"
            }
          ],
          "title": "Requests Average Duration",
          "type": "bargauge"
        }
      ],
      "refresh": "",
      "schemaVersion": 41,
      "tags": [],
      "templating": {
        "list": [
          {
            "current": {},
            "datasource": {
              "type": "prometheus",
              "uid": "${DS_PROMETHEUS}"
            },
            "definition": "label_values(http_client_request_duration_seconds_count,service_name)",
            "includeAll": false,
            "label": "Application Name",
            "name": "app_name",
            "options": [],
            "query": {
              "qryType": 1,
              "query": "label_values(http_client_request_duration_seconds_count,service_name)",
              "refId": "PrometheusVariableQueryEditor-VariableQuery"
            },
            "refresh": 1,
            "regex": "",
            "type": "query"
          },
          {
            "current": {},
            "datasource": {
              "type": "prometheus",
              "uid": "${DS_PROMETHEUS}"
            },
            "definition": "label_values(http_client_request_duration_seconds_count{service_name=\"$app_name\", http_response_status_code!=\"\"},http_response_status_code)",
            "description": "http_response_status_code=\"200\"",
            "includeAll": true,
            "label": "Function",
            "multi": true,
            "name": "code_function",
            "options": [],
            "query": {
              "qryType": 1,
              "query": "label_values(http_client_request_duration_seconds_count{service_name=\"$app_name\", http_response_status_code!=\"\"},http_response_status_code)",
              "refId": "PrometheusVariableQueryEditor-VariableQuery"
            },
            "refresh": 1,
            "regex": "",
            "type": "query"
          }
        ]
      },
      "time": {
        "from": "now-15m",
        "to": "now"
      },
      "timepicker": {},
      "timezone": "",
      "title": "Perf Code",
      "uid": "dLsDQIUnzbazzazeAAazeaaaa",
      "version": 1,
      "weekStart": ""
    }
Perf API.json
    {
      "__inputs": [
        {
          "name": "DS_PROMETHEUS",
          "label": "prometheus",
          "description": "",
          "type": "datasource",
          "pluginId": "prometheus",
          "pluginName": "Prometheus"
        }
      ],
      "__elements": {},
      "__requires": [
        {
          "type": "panel",
          "id": "bargauge",
          "name": "Bar gauge",
          "version": ""
        },
        {
          "type": "grafana",
          "id": "grafana",
          "name": "Grafana",
          "version": "11.6.0"
        },
        {
          "type": "panel",
          "id": "piechart",
          "name": "Pie chart",
          "version": ""
        },
        {
          "type": "datasource",
          "id": "prometheus",
          "name": "Prometheus",
          "version": "1.0.0"
        },
        {
          "type": "panel",
          "id": "stat",
          "name": "Stat",
          "version": ""
        }
      ],
      "annotations": {
        "list": [
          {
            "builtIn": 1,
            "datasource": {
              "type": "datasource",
              "uid": "grafana"
            },
            "enable": true,
            "hide": true,
            "iconColor": "rgba(0, 211, 255, 1)",
            "name": "Annotations & Alerts",
            "target": {
              "limit": 100,
              "matchAny": false,
              "tags": [],
              "type": "dashboard"
            },
            "type": "dashboard"
          }
        ]
      },
      "description": "Observe Spring Boot application with three pillars of observability: Traces (Tempo), Metrics (Prometheus), Logs (Loki) on Grafana through OpenTelemetry and OpenMetrics.",
      "editable": true,
      "fiscalYearStartMonth": 0,
      "graphTooltip": 0,
      "id": null,
      "links": [],
      "panels": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "fieldConfig": {
            "defaults": {
              "color": {
                "mode": "palette-classic"
              },
              "custom": {
                "hideFrom": {
                  "legend": false,
                  "tooltip": false,
                  "viz": false
                }
              },
              "mappings": []
            },
            "overrides": []
          },
          "gridPos": {
            "h": 9,
            "w": 9,
            "x": 0,
            "y": 0
          },
          "id": 16,
          "options": {
            "displayLabels": [
              "percent"
            ],
            "legend": {
              "displayMode": "list",
              "placement": "right",
              "showLegend": true,
              "values": []
            },
            "pieType": "pie",
            "reduceOptions": {
              "calcs": [
                "range"
              ],
              "fields": "",
              "values": false
            },
            "tooltip": {
              "hideZeros": false,
              "mode": "single",
              "sort": "none"
            }
          },
          "pluginVersion": "11.6.0",
          "targets": [
            {
              "datasource": {
                "type": "prometheus",
                "uid": "${DS_PROMETHEUS}"
              },
              "editorMode": "code",
              "exemplar": false,
              "expr": "http_server_request_duration_seconds_count{service_name=\"$app_name\", http_route=~\"$http_route\"}",
              "instant": false,
              "interval": "",
              "legendFormat": "{{http_route}}",
              "range": true,
              "refId": "A"
            }
          ],
          "title": "Requests Count",
          "type": "piechart"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "fieldConfig": {
            "defaults": {
              "color": {
                "fixedColor": "blue",
                "mode": "fixed"
              },
              "mappings": [],
              "thresholds": {
                "mode": "absolute",
                "steps": [
                  {
                    "color": "green"
                  }
                ]
              },
              "unit": "short"
            },
            "overrides": []
          },
          "gridPos": {
            "h": 4,
            "w": 3,
            "x": 9,
            "y": 0
          },
          "id": 4,
          "options": {
            "colorMode": "value",
            "graphMode": "none",
            "justifyMode": "auto",
            "orientation": "auto",
            "percentChangeColorMode": "standard",
            "reduceOptions": {
              "calcs": [
                "range"
              ],
              "fields": "",
              "values": false
            },
            "showPercentChange": false,
            "textMode": "auto",
            "wideLayout": true
          },
          "pluginVersion": "11.6.0",
          "targets": [
            {
              "datasource": {
                "type": "prometheus",
                "uid": "${DS_PROMETHEUS}"
              },
              "editorMode": "code",
              "exemplar": true,
              "expr": "sum(http_server_request_duration_seconds_count{service_name=\"$app_name\", http_route=~\"$http_route\"})",
              "interval": "",
              "legendFormat": "{{span_kind}}",
              "range": true,
              "refId": "A"
            }
          ],
          "title": "Total Requests",
          "type": "stat"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "fieldConfig": {
            "defaults": {
              "color": {
                "fixedColor": "green",
                "mode": "fixed"
              },
              "mappings": [],
              "noValue": "0",
              "thresholds": {
                "mode": "absolute",
                "steps": [
                  {
                    "color": "green"
                  }
                ]
              },
              "unit": "short"
            },
            "overrides": []
          },
          "gridPos": {
            "h": 4,
            "w": 3,
            "x": 12,
            "y": 0
          },
          "id": 22,
          "options": {
            "colorMode": "value",
            "graphMode": "none",
            "justifyMode": "auto",
            "orientation": "auto",
            "percentChangeColorMode": "standard",
            "reduceOptions": {
              "calcs": [
                "range"
              ],
              "fields": "",
              "values": false
            },
            "showPercentChange": false,
            "textMode": "auto",
            "wideLayout": true
          },
          "pluginVersion": "11.6.0",
          "targets": [
            {
              "datasource": {
                "type": "prometheus",
                "uid": "${DS_PROMETHEUS}"
              },
              "editorMode": "code",
              "exemplar": true,
              "expr": "sum(http_server_request_duration_seconds_count{service_name=\"$app_name\", http_response_status_code=~\"2.*\",http_route=~\"$http_route\"})",
              "interval": "",
              "legendFormat": "",
              "range": true,
              "refId": "A"
            }
          ],
          "title": "Total OK( 2XX )",
          "type": "stat"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "fieldConfig": {
            "defaults": {
              "color": {
                "mode": "thresholds"
              },
              "mappings": [],
              "noValue": "0",
              "thresholds": {
                "mode": "absolute",
                "steps": [
                  {
                    "color": "green"
                  },
                  {
                    "color": "red",
                    "value": 1
                  }
                ]
              },
              "unit": "short"
            },
            "overrides": []
          },
          "gridPos": {
            "h": 4,
            "w": 3,
            "x": 15,
            "y": 0
          },
          "id": 31,
          "options": {
            "colorMode": "value",
            "graphMode": "area",
            "justifyMode": "auto",
            "orientation": "auto",
            "percentChangeColorMode": "standard",
            "reduceOptions": {
              "calcs": [
                "range"
              ],
              "fields": "",
              "values": false
            },
            "showPercentChange": false,
            "textMode": "auto",
            "wideLayout": true
          },
          "pluginVersion": "11.6.0",
          "targets": [
            {
              "datasource": {
                "type": "prometheus",
                "uid": "${DS_PROMETHEUS}"
              },
              "editorMode": "code",
              "exemplar": true,
              "expr": "sum(http_server_request_duration_seconds_count{service_name=\"$app_name\", http_response_status_code=~\"3.*\",http_route=~\"$http_route\"})",
              "interval": "",
              "legendFormat": "",
              "range": true,
              "refId": "A"
            }
          ],
          "title": "Total Exceptions ( 3XX )",
          "type": "stat"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "fieldConfig": {
            "defaults": {
              "color": {
                "mode": "thresholds"
              },
              "mappings": [],
              "noValue": "0",
              "thresholds": {
                "mode": "absolute",
                "steps": [
                  {
                    "color": "green"
                  },
                  {
                    "color": "red",
                    "value": 1
                  }
                ]
              },
              "unit": "short"
            },
            "overrides": []
          },
          "gridPos": {
            "h": 4,
            "w": 3,
            "x": 18,
            "y": 0
          },
          "id": 34,
          "options": {
            "colorMode": "value",
            "graphMode": "none",
            "justifyMode": "auto",
            "orientation": "auto",
            "percentChangeColorMode": "standard",
            "reduceOptions": {
              "calcs": [
                "range"
              ],
              "fields": "",
              "values": false
            },
            "showPercentChange": false,
            "textMode": "auto",
            "wideLayout": true
          },
          "pluginVersion": "11.6.0",
          "targets": [
            {
              "datasource": {
                "type": "prometheus",
                "uid": "${DS_PROMETHEUS}"
              },
              "editorMode": "code",
              "exemplar": true,
              "expr": "sum(http_server_request_duration_seconds_count{service_name=\"$app_name\", http_response_status_code=~\"4.*\", http_route=~\"$http_route\"})",
              "interval": "",
              "legendFormat": "",
              "range": true,
              "refId": "A"
            }
          ],
          "title": "Total Exceptions ( 4XX )",
          "type": "stat"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "fieldConfig": {
            "defaults": {
              "color": {
                "mode": "thresholds"
              },
              "mappings": [],
              "noValue": "0",
              "thresholds": {
                "mode": "absolute",
                "steps": [
                  {
                    "color": "green"
                  },
                  {
                    "color": "dark-red",
                    "value": 1
                  }
                ]
              },
              "unit": "short"
            },
            "overrides": []
          },
          "gridPos": {
            "h": 4,
            "w": 3,
            "x": 21,
            "y": 0
          },
          "id": 32,
          "options": {
            "colorMode": "value",
            "graphMode": "none",
            "justifyMode": "auto",
            "orientation": "auto",
            "percentChangeColorMode": "standard",
            "reduceOptions": {
              "calcs": [
                "range"
              ],
              "fields": "",
              "values": false
            },
            "showPercentChange": false,
            "textMode": "auto",
            "wideLayout": true
          },
          "pluginVersion": "11.6.0",
          "targets": [
            {
              "datasource": {
                "type": "prometheus",
                "uid": "${DS_PROMETHEUS}"
              },
              "editorMode": "code",
              "exemplar": true,
              "expr": "sum(rate(http_server_request_duration_seconds_count{service_name=\"$app_name\", http_response_status_code=~\"5.*\",http_route=~\"$http_route\"}[1m]))",
              "interval": "",
              "legendFormat": "",
              "range": true,
              "refId": "A"
            }
          ],
          "title": "Total Exceptions ( 5XX )",
          "type": "stat"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "fieldConfig": {
            "defaults": {
              "color": {
                "fixedColor": "blue",
                "mode": "fixed"
              },
              "mappings": [],
              "thresholds": {
                "mode": "absolute",
                "steps": [
                  {
                    "color": "green"
                  }
                ]
              },
              "unit": "ms"
            },
            "overrides": []
          },
          "gridPos": {
            "h": 5,
            "w": 15,
            "x": 9,
            "y": 4
          },
          "id": 6,
          "options": {
            "displayMode": "basic",
            "legend": {
              "calcs": [],
              "displayMode": "list",
              "placement": "bottom",
              "showLegend": false
            },
            "maxVizHeight": 300,
            "minVizHeight": 10,
            "minVizWidth": 0,
            "namePlacement": "auto",
            "orientation": "horizontal",
            "reduceOptions": {
              "calcs": [
                "range"
              ],
              "fields": "",
              "values": false
            },
            "showUnfilled": true,
            "sizing": "auto",
            "valueMode": "color"
          },
          "pluginVersion": "11.6.0",
          "targets": [
            {
              "datasource": {
                "type": "prometheus",
                "uid": "${DS_PROMETHEUS}"
              },
              "editorMode": "code",
              "exemplar": true,
              "expr": "sum by(http_route)(http_server_request_duration_seconds_sum{service_name=\"$app_name\", http_route=~\"$http_route\"}) / \r\nsum by(http_route)(http_server_request_duration_seconds_count{service_name=\"$app_name\", http_route=~\"$http_route\"})",
              "interval": "",
              "legendFormat": "{{ span_kind}}",
              "range": true,
              "refId": "A"
            }
          ],
          "title": "Requests Average Duration",
          "type": "bargauge"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "fieldConfig": {
            "defaults": {
              "color": {
                "fixedColor": "green",
                "mode": "fixed"
              },
              "mappings": [],
              "thresholds": {
                "mode": "percentage",
                "steps": [
                  {
                    "color": "green"
                  }
                ]
              },
              "unit": "short"
            },
            "overrides": []
          },
          "gridPos": {
            "h": 5,
            "w": 12,
            "x": 0,
            "y": 9
          },
          "id": 18,
          "options": {
            "displayMode": "basic",
            "legend": {
              "calcs": [],
              "displayMode": "list",
              "placement": "bottom",
              "showLegend": false
            },
            "maxVizHeight": 300,
            "minVizHeight": 10,
            "minVizWidth": 0,
            "namePlacement": "auto",
            "orientation": "horizontal",
            "reduceOptions": {
              "calcs": [
                "range"
              ],
              "fields": "",
              "values": false
            },
            "showUnfilled": true,
            "sizing": "auto",
            "valueMode": "color"
          },
          "pluginVersion": "11.6.0",
          "targets": [
            {
              "datasource": {
                "type": "prometheus",
                "uid": "${DS_PROMETHEUS}"
              },
              "editorMode": "code",
              "exemplar": true,
              "expr": "http_server_request_duration_seconds_count{service_name=\"$app_name\", http_response_status_code=~\"2.*\",  http_route=~\"$http_route\"} ",
              "interval": "",
              "legendFormat": "{{http_route}}",
              "range": true,
              "refId": "A"
            }
          ],
          "title": "Number of 2xx Requests",
          "type": "bargauge"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "fieldConfig": {
            "defaults": {
              "color": {
                "fixedColor": "blue",
                "mode": "fixed"
              },
              "mappings": [],
              "thresholds": {
                "mode": "absolute",
                "steps": [
                  {
                    "color": "green"
                  }
                ]
              },
              "unit": "none"
            },
            "overrides": []
          },
          "gridPos": {
            "h": 5,
            "w": 12,
            "x": 12,
            "y": 9
          },
          "id": 12,
          "options": {
            "displayMode": "basic",
            "legend": {
              "calcs": [],
              "displayMode": "list",
              "placement": "bottom",
              "showLegend": false
            },
            "maxVizHeight": 300,
            "minVizHeight": 10,
            "minVizWidth": 0,
            "namePlacement": "auto",
            "orientation": "horizontal",
            "reduceOptions": {
              "calcs": [
                "range"
              ],
              "fields": "",
              "values": false
            },
            "showUnfilled": true,
            "sizing": "auto",
            "valueMode": "color"
          },
          "pluginVersion": "11.6.0",
          "targets": [
            {
              "datasource": {
                "type": "prometheus",
                "uid": "${DS_PROMETHEUS}"
              },
              "editorMode": "code",
              "exemplar": false,
              "expr": "http_server_request_duration_seconds_count{service_name=\"$app_name\", http_route=~\"$http_route\"}",
              "instant": false,
              "interval": "",
              "legendFormat": "{{http_route}}",
              "range": true,
              "refId": "A"
            }
          ],
          "title": "Number of requests",
          "type": "bargauge"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "${DS_PROMETHEUS}"
          },
          "description": "",
          "fieldConfig": {
            "defaults": {
              "color": {
                "mode": "continuous-GrYlRd"
              },
              "mappings": [],
              "thresholds": {
                "mode": "percentage",
                "steps": [
                  {
                    "color": "red"
                  },
                  {
                    "color": "#EAB839",
                    "value": ""
                  }
                ]
              },
              "unit": "short"
            },
            "overrides": []
          },
          "gridPos": {
            "h": 5,
            "w": 24,
            "x": 0,
            "y": 14
          },
          "id": 33,
          "options": {
            "displayMode": "basic",
            "legend": {
              "calcs": [],
              "displayMode": "list",
              "placement": "bottom",
              "showLegend": false
            },
            "maxVizHeight": 300,
            "minVizHeight": 10,
            "minVizWidth": 0,
            "namePlacement": "auto",
            "orientation": "horizontal",
            "reduceOptions": {
              "calcs": [
                "range"
              ],
              "fields": "",
              "values": false
            },
            "showUnfilled": true,
            "sizing": "auto",
            "valueMode": "color"
          },
          "pluginVersion": "11.6.0",
          "targets": [
            {
              "datasource": {
                "type": "prometheus",
                "uid": "${DS_PROMETHEUS}"
              },
              "editorMode": "code",
              "exemplar": true,
              "expr": "http_server_request_duration_seconds_count{service_name=\"$app_name\", http_response_status_code!~\"2.*\", http_route=~\"$http_route\"} ",
              "interval": "",
              "legendFormat": "{{ http_route }} ",
              "range": true,
              "refId": "A"
            }
          ],
          "title": "Number of non 2xx Requests",
          "type": "bargauge"
        }
      ],
      "refresh": "30s",
      "schemaVersion": 41,
      "tags": [],
      "templating": {
        "list": [
          {
            "current": {},
            "datasource": {
              "type": "prometheus",
              "uid": "${DS_PROMETHEUS}"
            },
            "definition": "label_values(http_server_request_duration_seconds_count{http_route!=\"\"}, service_name)",
            "includeAll": false,
            "label": "Application Name",
            "name": "app_name",
            "options": [],
            "query": {
              "query": "label_values(http_server_request_duration_seconds_count{http_route!=\"\"}, service_name)",
              "refId": "StandardVariableQuery"
            },
            "refresh": 1,
            "regex": "",
            "type": "query"
          },
          {
            "current": {},
            "datasource": {
              "type": "prometheus",
              "uid": "${DS_PROMETHEUS}"
            },
            "definition": "label_values(http_server_request_duration_seconds_count{service_name=\"$app_name\", http_route!=\"\"}, http_route)",
            "includeAll": true,
            "label": "http_route",
            "multi": true,
            "name": "http_route",
            "options": [],
            "query": {
              "query": "label_values(http_server_request_duration_seconds_count{service_name=\"$app_name\", http_route!=\"\"}, http_route)",
              "refId": "StandardVariableQuery"
            },
            "refresh": 1,
            "regex": "",
            "type": "query"
          }
        ]
      },
      "time": {
        "from": "now-5m",
        "to": "now"
      },
      "timepicker": {},
      "timezone": "",
      "title": "Perf API",
      "uid": "bear6lw5niwhse",
      "version": 1,
      "weekStart": ""
    }

Quizz Perf API

Sur le Dashboard Perf API :

Pourquoi la visualization Number of request ne donne pas le meme nombre de requetes Order que sa voisine ?

Et pourquoi y a t'il 2 lignes Order ?

Inspecter les données

Il est possible d'inspecter les données envoyées par Grafana et reçues par la datasource en cliquant sur le bouton Inspect dans le menu du panel. Les exporter en CSV facilite la lecture. Inspect

Spoiler la solution est là

Si on regarde les labels retournée on à 2 séries différentes. L'une pour avec le label http_response_status_code="200" et l'autre avec http_response_status_code="418". On a donc 2 séries différentes pour la même requête.

la visualization Number of 2xx Requests filtre pour ne prendre que les requêtes avec le label http_response_status_code=~"2.*".

🛫 Prochaine étape : Otel (aka OpenTelemetry) ➡️