{
  "description": "Application performance monitoring dashboard using distributed traces and metrics",
  "tags": ["application", "performance", "traces", "apm"],
  "name": "bakery-ia-application-performance",
  "title": "Bakery IA - Application Performance (APM)",
  "uploadedGrafana": false,
  "uuid": "bakery-ia-apm-01",
  "version": "v4",
  "collapsableRowsMigrated": true,
  "layout": [
    {
      "x": 0,
      "y": 0,
      "w": 6,
      "h": 3,
      "i": "latency-p99",
      "moved": false,
      "static": false
    },
    {
      "x": 6,
      "y": 0,
      "w": 6,
      "h": 3,
      "i": "request-rate",
      "moved": false,
      "static": false
    },
    {
      "x": 0,
      "y": 3,
      "w": 6,
      "h": 3,
      "i": "error-rate",
      "moved": false,
      "static": false
    },
    {
      "x": 6,
      "y": 3,
      "w": 6,
      "h": 3,
      "i": "avg-duration",
      "moved": false,
      "static": false
    }
  ],
  "variables": {
    "service_name": {
      "id": "service-var",
      "name": "service_name",
      "description": "Filter by service name",
      "type": "QUERY",
      "queryValue": "SELECT DISTINCT(serviceName) FROM signoz_traces.distributed_signoz_index_v2 ORDER BY serviceName",
      "customValue": "",
      "textboxValue": "",
      "showALLOption": true,
      "multiSelect": false,
      "order": 1,
      "modificationUUID": "",
      "sort": "ASC",
      "selectedValue": null
    }
  },
  "widgets": [
    {
      "id": "latency-p99",
      "title": "P99 Latency",
      "description": "99th percentile latency for selected service",
      "isStacked": false,
      "nullZeroValues": "zero",
      "opacity": "1",
      "panelTypes": "graph",
      "query": {
        "builder": {
          "queryData": [
            {
              "dataSource": "traces",
              "queryName": "A",
              "aggregateOperator": "p99",
              "aggregateAttribute": {
                "key": "duration_ns",
                "dataType": "float64",
                "type": "",
                "isColumn": true
              },
              "timeAggregation": "avg",
              "spaceAggregation": "p99",
              "functions": [],
              "filters": {
                "items": [
                  {
                    "key": {
                      "key": "serviceName",
                      "dataType": "string",
                      "type": "tag",
                      "isColumn": true
                    },
                    "op": "=",
                    "value": "{{.service_name}}"
                  }
                ],
                "op": "AND"
              },
              "expression": "A",
              "disabled": false,
              "having": [],
              "stepInterval": 60,
              "limit": null,
              "orderBy": [],
              "groupBy": [
                {
                  "key": "serviceName",
                  "dataType": "string",
                  "type": "tag",
                  "isColumn": true
                }
              ],
              "legend": "{{serviceName}}",
              "reduceTo": "avg"
            }
          ],
          "queryFormulas": []
        },
        "queryType": "builder"
      },
      "fillSpans": false,
      "yAxisUnit": "ms"
    },
    {
      "id": "request-rate",
      "title": "Request Rate",
      "description": "Requests per second for the service",
      "isStacked": false,
      "nullZeroValues": "zero",
      "opacity": "1",
      "panelTypes": "graph",
      "query": {
        "builder": {
          "queryData": [
            {
              "dataSource": "traces",
              "queryName": "A",
              "aggregateOperator": "count",
              "aggregateAttribute": {
                "key": "",
                "dataType": "",
                "type": "",
                "isColumn": false
              },
              "timeAggregation": "rate",
              "spaceAggregation": "sum",
              "functions": [],
              "filters": {
                "items": [
                  {
                    "key": {
                      "key": "serviceName",
                      "dataType": "string",
                      "type": "tag",
                      "isColumn": true
                    },
                    "op": "=",
                    "value": "{{.service_name}}"
                  }
                ],
                "op": "AND"
              },
              "expression": "A",
              "disabled": false,
              "having": [],
              "stepInterval": 60,
              "limit": null,
              "orderBy": [],
              "groupBy": [
                {
                  "key": "serviceName",
                  "dataType": "string",
                  "type": "tag",
                  "isColumn": true
                }
              ],
              "legend": "{{serviceName}}",
              "reduceTo": "sum"
            }
          ],
          "queryFormulas": []
        },
        "queryType": "builder"
      },
      "fillSpans": false,
      "yAxisUnit": "reqps"
    },
    {
      "id": "error-rate",
      "title": "Error Rate",
      "description": "Error rate percentage for the service",
      "isStacked": false,
      "nullZeroValues": "zero",
      "opacity": "1",
      "panelTypes": "graph",
      "query": {
        "builder": {
          "queryData": [
            {
              "dataSource": "traces",
              "queryName": "A",
              "aggregateOperator": "count",
              "aggregateAttribute": {
                "key": "",
                "dataType": "",
                "type": "",
                "isColumn": false
              },
              "timeAggregation": "rate",
              "spaceAggregation": "sum",
              "functions": [],
              "filters": {
                "items": [
                  {
                    "key": {
                      "key": "serviceName",
                      "dataType": "string",
                      "type": "tag",
                      "isColumn": true
                    },
                    "op": "=",
                    "value": "{{.service_name}}"
                  },
                  {
                    "key": {
                      "key": "status_code",
                      "dataType": "string",
                      "type": "tag",
                      "isColumn": true
                    },
                    "op": "=",
                    "value": "STATUS_CODE_ERROR"
                  }
                ],
                "op": "AND"
              },
              "expression": "A",
              "disabled": false,
              "having": [],
              "stepInterval": 60,
              "limit": null,
              "orderBy": [],
              "groupBy": [
                {
                  "key": "serviceName",
                  "dataType": "string",
                  "type": "tag",
                  "isColumn": true
                }
              ],
              "legend": "{{serviceName}}",
              "reduceTo": "sum"
            }
          ],
          "queryFormulas": []
        },
        "queryType": "builder"
      },
      "fillSpans": false,
      "yAxisUnit": "reqps"
    },
    {
      "id": "avg-duration",
      "title": "Average Duration",
      "description": "Average request duration",
      "isStacked": false,
      "nullZeroValues": "zero",
      "opacity": "1",
      "panelTypes": "graph",
      "query": {
        "builder": {
          "queryData": [
            {
              "dataSource": "traces",
              "queryName": "A",
              "aggregateOperator": "avg",
              "aggregateAttribute": {
                "key": "duration_ns",
                "dataType": "float64",
                "type": "",
                "isColumn": true
              },
              "timeAggregation": "avg",
              "spaceAggregation": "avg",
              "functions": [],
              "filters": {
                "items": [
                  {
                    "key": {
                      "key": "serviceName",
                      "dataType": "string",
                      "type": "tag",
                      "isColumn": true
                    },
                    "op": "=",
                    "value": "{{.service_name}}"
                  }
                ],
                "op": "AND"
              },
              "expression": "A",
              "disabled": false,
              "having": [],
              "stepInterval": 60,
              "limit": null,
              "orderBy": [],
              "groupBy": [
                {
                  "key": "serviceName",
                  "dataType": "string",
                  "type": "tag",
                  "isColumn": true
                }
              ],
              "legend": "{{serviceName}}",
              "reduceTo": "avg"
            }
          ],
          "queryFormulas": []
        },
        "queryType": "builder"
      },
      "fillSpans": false,
      "yAxisUnit": "ms"
    }
  ]
}
