{
  "title": "Compliance Agent",
  "description": "API handlers, scan pipeline stages, and error tracking for compliance-agent",
  "tags": ["compliance", "agent"],
  "version": "v4",
  "panelMap": {},
  "uploadedGrafana": false,
  "variables": {
    "svc-var": {
      "id": "svc-var",
      "name": "service_name",
      "type": "CUSTOM",
      "customValue": "compliance-agent",
      "multiSelect": false,
      "showALLOption": false,
      "allSelected": false,
      "sort": "DISABLED",
      "order": 0,
      "textboxValue": "",
      "description": "Service name",
      "modificationUUID": ""
    }
  },
  "layout": [
    { "i": "row-overview",       "x": 0,  "y": 0,  "w": 24, "h": 1, "moved": false, "static": false },
    { "i": "request-rate",       "x": 0,  "y": 1,  "w": 8,  "h": 8, "moved": false, "static": false },
    { "i": "error-rate",         "x": 8,  "y": 1,  "w": 8,  "h": 8, "moved": false, "static": false },
    { "i": "p95-latency",        "x": 16, "y": 1,  "w": 8,  "h": 8, "moved": false, "static": false },
    { "i": "row-handlers",       "x": 0,  "y": 9,  "w": 24, "h": 1, "moved": false, "static": false },
    { "i": "handler-latency",    "x": 0,  "y": 10, "w": 12, "h": 9, "moved": false, "static": false },
    { "i": "handler-calls",      "x": 12, "y": 10, "w": 12, "h": 9, "moved": false, "static": false },
    { "i": "handler-errors",     "x": 0,  "y": 19, "w": 12, "h": 8, "moved": false, "static": false },
    { "i": "slow-requests",      "x": 12, "y": 19, "w": 12, "h": 8, "moved": false, "static": false },
    { "i": "row-pipeline",       "x": 0,  "y": 27, "w": 24, "h": 1, "moved": false, "static": false },
    { "i": "pipeline-duration",  "x": 0,  "y": 28, "w": 16, "h": 9, "moved": false, "static": false },
    { "i": "scan-count",         "x": 16, "y": 28, "w": 4,  "h": 9, "moved": false, "static": false },
    { "i": "scan-errors",        "x": 20, "y": 28, "w": 4,  "h": 9, "moved": false, "static": false },
    { "i": "pipeline-runs",      "x": 0,  "y": 37, "w": 24, "h": 8, "moved": false, "static": false },
    { "i": "row-subapis",        "x": 0,  "y": 45, "w": 24, "h": 1, "moved": false, "static": false },
    { "i": "graph-latency",      "x": 0,  "y": 46, "w": 8,  "h": 8, "moved": false, "static": false },
    { "i": "dast-latency",       "x": 8,  "y": 46, "w": 8,  "h": 8, "moved": false, "static": false },
    { "i": "chat-latency",       "x": 16, "y": 46, "w": 8,  "h": 8, "moved": false, "static": false },
    { "i": "row-logs",           "x": 0,  "y": 54, "w": 24, "h": 1, "moved": false, "static": false },
    { "i": "log-rate",           "x": 0,  "y": 55, "w": 12, "h": 8, "moved": false, "static": false },
    { "i": "error-logs",         "x": 12, "y": 55, "w": 12, "h": 8, "moved": false, "static": false }
  ],
  "widgets": [
    {
      "id": "row-overview",
      "title": "Overview",
      "panelTypes": "row",
      "description": "",
      "query": { "queryType": "builder", "builder": { "queryData": [], "queryFormulas": [] }, "promql": [], "clickhouse_sql": [] }
    },
    {
      "id": "request-rate",
      "title": "Request Rate (ops/s)",
      "panelTypes": "graph",
      "description": "Requests per second across all compliance-agent endpoints",
      "opacity": "1",
      "yAxisUnit": "none",
      "isStacked": false,
      "nullZeroValues": "zero",
      "fillSpans": false,
      "mergeAllActiveQueries": false,
      "timePreferance": "GLOBAL_TIME",
      "columnUnits": {},
      "thresholds": [],
      "softMin": 0,
      "softMax": 0,
      "bucketCount": 30,
      "bucketWidth": 0,
      "stackedBarChart": false,
      "selectedLogFields": [],
      "selectedTracesFields": [],
      "query": {
        "queryType": "builder",
        "builder": {
          "queryData": [
            {
              "queryName": "A",
              "expression": "A",
              "dataSource": "traces",
              "aggregateOperator": "rate",
              "aggregateAttribute": { "id": "------false", "key": "", "dataType": "", "type": "", "isColumn": false, "isJSON": false },
              "filters": {
                "op": "AND",
                "items": [
                  {
                    "id": "f-svc",
                    "key": { "id": "serviceName--string--tag--true", "key": "serviceName", "dataType": "string", "type": "tag", "isColumn": true, "isJSON": false },
                    "op": "=",
                    "value": "compliance-agent"
                  }
                ]
              },
              "functions": [],
              "groupBy": [],
              "having": [],
              "legend": "Requests/s",
              "disabled": false,
              "stepInterval": 60,
              "reduceTo": "avg",
              "spaceAggregation": "sum",
              "timeAggregation": "rate",
              "orderBy": [],
              "limit": null
            }
          ],
          "queryFormulas": []
        },
        "promql": [{ "name": "A", "query": "", "disabled": false, "legend": "" }],
        "clickhouse_sql": [{ "name": "A", "query": "", "disabled": false, "legend": "" }]
      }
    },
    {
      "id": "error-rate",
      "title": "Error Rate (%)",
      "panelTypes": "graph",
      "description": "Percentage of spans with errors",
      "opacity": "1",
      "yAxisUnit": "percent",
      "isStacked": false,
      "nullZeroValues": "zero",
      "fillSpans": false,
      "mergeAllActiveQueries": true,
      "timePreferance": "GLOBAL_TIME",
      "columnUnits": {},
      "thresholds": [],
      "softMin": 0,
      "softMax": 0,
      "bucketCount": 30,
      "bucketWidth": 0,
      "stackedBarChart": false,
      "selectedLogFields": [],
      "selectedTracesFields": [],
      "query": {
        "queryType": "builder",
        "builder": {
          "queryData": [
            {
              "queryName": "A",
              "expression": "A",
              "dataSource": "traces",
              "aggregateOperator": "count",
              "aggregateAttribute": { "id": "------false", "key": "", "dataType": "", "type": "", "isColumn": false, "isJSON": false },
              "filters": {
                "op": "AND",
                "items": [
                  {
                    "id": "f-svc",
                    "key": { "id": "serviceName--string--tag--true", "key": "serviceName", "dataType": "string", "type": "tag", "isColumn": true, "isJSON": false },
                    "op": "=",
                    "value": "compliance-agent"
                  },
                  {
                    "id": "f-err",
                    "key": { "id": "hasError--bool--tag--true", "key": "hasError", "dataType": "bool", "type": "tag", "isColumn": true, "isJSON": false },
                    "op": "=",
                    "value": "true"
                  }
                ]
              },
              "functions": [],
              "groupBy": [],
              "having": [],
              "legend": "Errors",
              "disabled": false,
              "stepInterval": 60,
              "reduceTo": "avg",
              "spaceAggregation": "sum",
              "timeAggregation": "rate",
              "orderBy": [],
              "limit": null
            },
            {
              "queryName": "B",
              "expression": "B",
              "dataSource": "traces",
              "aggregateOperator": "count",
              "aggregateAttribute": { "id": "------false", "key": "", "dataType": "", "type": "", "isColumn": false, "isJSON": false },
              "filters": {
                "op": "AND",
                "items": [
                  {
                    "id": "f-svc2",
                    "key": { "id": "serviceName--string--tag--true", "key": "serviceName", "dataType": "string", "type": "tag", "isColumn": true, "isJSON": false },
                    "op": "=",
                    "value": "compliance-agent"
                  }
                ]
              },
              "functions": [],
              "groupBy": [],
              "having": [],
              "legend": "Total",
              "disabled": false,
              "stepInterval": 60,
              "reduceTo": "avg",
              "spaceAggregation": "sum",
              "timeAggregation": "rate",
              "orderBy": [],
              "limit": null
            }
          ],
          "queryFormulas": [
            {
              "queryName": "F1",
              "expression": "A * 100 / B",
              "legend": "Error %",
              "disabled": false
            }
          ]
        },
        "promql": [{ "name": "A", "query": "", "disabled": false, "legend": "" }],
        "clickhouse_sql": [{ "name": "A", "query": "", "disabled": false, "legend": "" }]
      }
    },
    {
      "id": "p95-latency",
      "title": "Latency p50 / p95 / p99",
      "panelTypes": "graph",
      "description": "Response time percentiles for root spans",
      "opacity": "1",
      "yAxisUnit": "ns",
      "isStacked": false,
      "nullZeroValues": "zero",
      "fillSpans": false,
      "mergeAllActiveQueries": false,
      "timePreferance": "GLOBAL_TIME",
      "columnUnits": {},
      "thresholds": [],
      "softMin": 0,
      "softMax": 0,
      "bucketCount": 30,
      "bucketWidth": 0,
      "stackedBarChart": false,
      "selectedLogFields": [],
      "selectedTracesFields": [],
      "query": {
        "queryType": "builder",
        "builder": {
          "queryData": [
            {
              "queryName": "A",
              "expression": "A",
              "dataSource": "traces",
              "aggregateOperator": "p50",
              "aggregateAttribute": { "id": "durationNano--float64--tag--true", "key": "durationNano", "dataType": "float64", "type": "tag", "isColumn": true, "isJSON": false },
              "filters": {
                "op": "AND",
                "items": [
                  {
                    "id": "f-svc",
                    "key": { "id": "serviceName--string--tag--true", "key": "serviceName", "dataType": "string", "type": "tag", "isColumn": true, "isJSON": false },
                    "op": "=",
                    "value": "compliance-agent"
                  }
                ]
              },
              "functions": [],
              "groupBy": [],
              "having": [],
              "legend": "p50",
              "disabled": false,
              "stepInterval": 60,
              "reduceTo": "avg",
              "spaceAggregation": "sum",
              "timeAggregation": "avg",
              "orderBy": [],
              "limit": null
            },
            {
              "queryName": "B",
              "expression": "B",
              "dataSource": "traces",
              "aggregateOperator": "p95",
              "aggregateAttribute": { "id": "durationNano--float64--tag--true", "key": "durationNano", "dataType": "float64", "type": "tag", "isColumn": true, "isJSON": false },
              "filters": {
                "op": "AND",
                "items": [
                  {
                    "id": "f-svc",
                    "key": { "id": "serviceName--string--tag--true", "key": "serviceName", "dataType": "string", "type": "tag", "isColumn": true, "isJSON": false },
                    "op": "=",
                    "value": "compliance-agent"
                  }
                ]
              },
              "functions": [],
              "groupBy": [],
              "having": [],
              "legend": "p95",
              "disabled": false,
              "stepInterval": 60,
              "reduceTo": "avg",
              "spaceAggregation": "sum",
              "timeAggregation": "avg",
              "orderBy": [],
              "limit": null
            },
            {
              "queryName": "C",
              "expression": "C",
              "dataSource": "traces",
              "aggregateOperator": "p99",
              "aggregateAttribute": { "id": "durationNano--float64--tag--true", "key": "durationNano", "dataType": "float64", "type": "tag", "isColumn": true, "isJSON": false },
              "filters": {
                "op": "AND",
                "items": [
                  {
                    "id": "f-svc",
                    "key": { "id": "serviceName--string--tag--true", "key": "serviceName", "dataType": "string", "type": "tag", "isColumn": true, "isJSON": false },
                    "op": "=",
                    "value": "compliance-agent"
                  }
                ]
              },
              "functions": [],
              "groupBy": [],
              "having": [],
              "legend": "p99",
              "disabled": false,
              "stepInterval": 60,
              "reduceTo": "avg",
              "spaceAggregation": "sum",
              "timeAggregation": "avg",
              "orderBy": [],
              "limit": null
            }
          ],
          "queryFormulas": []
        },
        "promql": [{ "name": "A", "query": "", "disabled": false, "legend": "" }],
        "clickhouse_sql": [{ "name": "A", "query": "", "disabled": false, "legend": "" }]
      }
    },
    {
      "id": "row-handlers",
      "title": "API Handlers",
      "panelTypes": "row",
      "description": "",
      "query": { "queryType": "builder", "builder": { "queryData": [], "queryFormulas": [] }, "promql": [], "clickhouse_sql": [] }
    },
    {
      "id": "handler-latency",
      "title": "Handler p95 Latency by Operation",
      "panelTypes": "graph",
      "description": "p95 latency grouped by span name (handler function)",
      "opacity": "1",
      "yAxisUnit": "ns",
      "isStacked": false,
      "nullZeroValues": "zero",
      "fillSpans": false,
      "mergeAllActiveQueries": false,
      "timePreferance": "GLOBAL_TIME",
      "columnUnits": {},
      "thresholds": [],
      "softMin": 0,
      "softMax": 0,
      "bucketCount": 30,
      "bucketWidth": 0,
      "stackedBarChart": false,
      "selectedLogFields": [],
      "selectedTracesFields": [],
      "query": {
        "queryType": "builder",
        "builder": {
          "queryData": [
            {
              "queryName": "A",
              "expression": "A",
              "dataSource": "traces",
              "aggregateOperator": "p95",
              "aggregateAttribute": { "id": "durationNano--float64--tag--true", "key": "durationNano", "dataType": "float64", "type": "tag", "isColumn": true, "isJSON": false },
              "filters": {
                "op": "AND",
                "items": [
                  {
                    "id": "f-svc",
                    "key": { "id": "serviceName--string--tag--true", "key": "serviceName", "dataType": "string", "type": "tag", "isColumn": true, "isJSON": false },
                    "op": "=",
                    "value": "compliance-agent"
                  },
                  {
                    "id": "f-name",
                    "key": { "id": "name--string--tag--true", "key": "name", "dataType": "string", "type": "tag", "isColumn": true, "isJSON": false },
                    "op": "nin",
                    "value": ["run", "run_pipeline", "stage_sast", "stage_sbom_generation", "stage_cve_scanning", "stage_pattern_scanning", "stage_secret_detection", "stage_lint_scanning", "stage_code_review", "stage_graph_building", "clone_or_fetch", "clone_repo", "scan", "generate_lockfiles", "run_syft", "enrich_cargo_licenses", "run_cargo_audit"]
                  }
                ]
              },
              "functions": [],
              "groupBy": [
                { "id": "name--string--tag--true", "key": "name", "dataType": "string", "type": "tag", "isColumn": true, "isJSON": false }
              ],
              "having": [],
              "legend": "{{name}}",
              "disabled": false,
              "stepInterval": 60,
              "reduceTo": "avg",
              "spaceAggregation": "sum",
              "timeAggregation": "avg",
              "orderBy": [],
              "limit": 20
            }
          ],
          "queryFormulas": []
        },
        "promql": [{ "name": "A", "query": "", "disabled": false, "legend": "" }],
        "clickhouse_sql": [{ "name": "A", "query": "", "disabled": false, "legend": "" }]
      }
    },
    {
      "id": "handler-calls",
      "title": "Handler Call Volume",
      "panelTypes": "graph",
      "description": "Number of calls per handler over time",
      "opacity": "1",
      "yAxisUnit": "none",
      "isStacked": true,
      "nullZeroValues": "zero",
      "fillSpans": false,
      "mergeAllActiveQueries": false,
      "timePreferance": "GLOBAL_TIME",
      "columnUnits": {},
      "thresholds": [],
      "softMin": 0,
      "softMax": 0,
      "bucketCount": 30,
      "bucketWidth": 0,
      "stackedBarChart": false,
      "selectedLogFields": [],
      "selectedTracesFields": [],
      "query": {
        "queryType": "builder",
        "builder": {
          "queryData": [
            {
              "queryName": "A",
              "expression": "A",
              "dataSource": "traces",
              "aggregateOperator": "count",
              "aggregateAttribute": { "id": "------false", "key": "", "dataType": "", "type": "", "isColumn": false, "isJSON": false },
              "filters": {
                "op": "AND",
                "items": [
                  {
                    "id": "f-svc",
                    "key": { "id": "serviceName--string--tag--true", "key": "serviceName", "dataType": "string", "type": "tag", "isColumn": true, "isJSON": false },
                    "op": "=",
                    "value": "compliance-agent"
                  },
                  {
                    "id": "f-name",
                    "key": { "id": "name--string--tag--true", "key": "name", "dataType": "string", "type": "tag", "isColumn": true, "isJSON": false },
                    "op": "nin",
                    "value": ["run", "run_pipeline", "stage_sast", "stage_sbom_generation", "stage_cve_scanning", "stage_pattern_scanning", "stage_secret_detection", "stage_lint_scanning", "stage_code_review", "stage_graph_building", "clone_or_fetch", "clone_repo", "scan", "generate_lockfiles", "run_syft", "enrich_cargo_licenses", "run_cargo_audit"]
                  }
                ]
              },
              "functions": [],
              "groupBy": [
                { "id": "name--string--tag--true", "key": "name", "dataType": "string", "type": "tag", "isColumn": true, "isJSON": false }
              ],
              "having": [],
              "legend": "{{name}}",
              "disabled": false,
              "stepInterval": 60,
              "reduceTo": "avg",
              "spaceAggregation": "sum",
              "timeAggregation": "rate",
              "orderBy": [{ "columnName": "#SIGNOZ_VALUE", "order": "desc" }],
              "limit": 15
            }
          ],
          "queryFormulas": []
        },
        "promql": [{ "name": "A", "query": "", "disabled": false, "legend": "" }],
        "clickhouse_sql": [{ "name": "A", "query": "", "disabled": false, "legend": "" }]
      }
    },
    {
      "id": "handler-errors",
      "title": "Top Operations by Error Count",
      "panelTypes": "table",
      "description": "Operations with the most errors",
      "opacity": "1",
      "yAxisUnit": "none",
      "isStacked": false,
      "nullZeroValues": "zero",
      "fillSpans": false,
      "mergeAllActiveQueries": false,
      "timePreferance": "GLOBAL_TIME",
      "columnUnits": {},
      "thresholds": [],
      "softMin": 0,
      "softMax": 0,
      "bucketCount": 30,
      "bucketWidth": 0,
      "stackedBarChart": false,
      "selectedLogFields": [],
      "selectedTracesFields": [],
      "query": {
        "queryType": "builder",
        "builder": {
          "queryData": [
            {
              "queryName": "A",
              "expression": "A",
              "dataSource": "traces",
              "aggregateOperator": "count",
              "aggregateAttribute": { "id": "------false", "key": "", "dataType": "", "type": "", "isColumn": false, "isJSON": false },
              "filters": {
                "op": "AND",
                "items": [
                  {
                    "id": "f-svc",
                    "key": { "id": "serviceName--string--tag--true", "key": "serviceName", "dataType": "string", "type": "tag", "isColumn": true, "isJSON": false },
                    "op": "=",
                    "value": "compliance-agent"
                  },
                  {
                    "id": "f-err",
                    "key": { "id": "hasError--bool--tag--true", "key": "hasError", "dataType": "bool", "type": "tag", "isColumn": true, "isJSON": false },
                    "op": "=",
                    "value": "true"
                  }
                ]
              },
              "functions": [],
              "groupBy": [
                { "id": "name--string--tag--true", "key": "name", "dataType": "string", "type": "tag", "isColumn": true, "isJSON": false }
              ],
              "having": [],
              "legend": "Errors",
              "disabled": false,
              "stepInterval": 60,
              "reduceTo": "sum",
              "spaceAggregation": "sum",
              "timeAggregation": "rate",
              "orderBy": [{ "columnName": "#SIGNOZ_VALUE", "order": "desc" }],
              "limit": 20
            }
          ],
          "queryFormulas": []
        },
        "promql": [{ "name": "A", "query": "", "disabled": false, "legend": "" }],
        "clickhouse_sql": [{ "name": "A", "query": "", "disabled": false, "legend": "" }]
      }
    },
    {
      "id": "slow-requests",
      "title": "Slowest Traces",
      "panelTypes": "list",
      "description": "Individual traces ordered by duration (slowest first)",
      "opacity": "1",
      "yAxisUnit": "none",
      "isStacked": false,
      "nullZeroValues": "zero",
      "fillSpans": false,
      "mergeAllActiveQueries": false,
      "timePreferance": "GLOBAL_TIME",
      "columnUnits": {},
      "thresholds": [],
      "softMin": 0,
      "softMax": 0,
      "bucketCount": 30,
      "bucketWidth": 0,
      "stackedBarChart": false,
      "selectedLogFields": [],
      "selectedTracesFields": [
        { "id": "serviceName--string--tag--true", "key": "serviceName", "dataType": "string", "type": "tag", "isColumn": true, "isJSON": false },
        { "id": "name--string--tag--true", "key": "name", "dataType": "string", "type": "tag", "isColumn": true, "isJSON": false },
        { "id": "durationNano--float64--tag--true", "key": "durationNano", "dataType": "float64", "type": "tag", "isColumn": true, "isJSON": false },
        { "id": "hasError--bool--tag--true", "key": "hasError", "dataType": "bool", "type": "tag", "isColumn": true, "isJSON": false }
      ],
      "query": {
        "queryType": "builder",
        "builder": {
          "queryData": [
            {
              "queryName": "A",
              "expression": "A",
              "dataSource": "traces",
              "aggregateOperator": "noop",
              "aggregateAttribute": { "id": "------false", "key": "", "dataType": "", "type": "", "isColumn": false, "isJSON": false },
              "filters": {
                "op": "AND",
                "items": [
                  {
                    "id": "f-svc",
                    "key": { "id": "serviceName--string--tag--true", "key": "serviceName", "dataType": "string", "type": "tag", "isColumn": true, "isJSON": false },
                    "op": "=",
                    "value": "compliance-agent"
                  }
                ]
              },
              "functions": [],
              "groupBy": [],
              "having": [],
              "legend": "",
              "disabled": false,
              "stepInterval": 60,
              "reduceTo": "avg",
              "spaceAggregation": "sum",
              "timeAggregation": "rate",
              "orderBy": [{ "columnName": "durationNano", "order": "desc" }],
              "limit": null,
              "offset": 0,
              "pageSize": 10
            }
          ],
          "queryFormulas": []
        },
        "promql": [{ "name": "A", "query": "", "disabled": false, "legend": "" }],
        "clickhouse_sql": [{ "name": "A", "query": "", "disabled": false, "legend": "" }]
      }
    },
    {
      "id": "row-pipeline",
      "title": "Scan Pipeline",
      "panelTypes": "row",
      "description": "",
      "query": { "queryType": "builder", "builder": { "queryData": [], "queryFormulas": [] }, "promql": [], "clickhouse_sql": [] }
    },
    {
      "id": "pipeline-duration",
      "title": "Pipeline Stage Duration (p95)",
      "panelTypes": "graph",
      "description": "Time spent in each scan pipeline stage",
      "opacity": "1",
      "yAxisUnit": "ns",
      "isStacked": false,
      "nullZeroValues": "zero",
      "fillSpans": false,
      "mergeAllActiveQueries": false,
      "timePreferance": "GLOBAL_TIME",
      "columnUnits": {},
      "thresholds": [],
      "softMin": 0,
      "softMax": 0,
      "bucketCount": 30,
      "bucketWidth": 0,
      "stackedBarChart": false,
      "selectedLogFields": [],
      "selectedTracesFields": [],
      "query": {
        "queryType": "builder",
        "builder": {
          "queryData": [
            {
              "queryName": "A",
              "expression": "A",
              "dataSource": "traces",
              "aggregateOperator": "p95",
              "aggregateAttribute": { "id": "durationNano--float64--tag--true", "key": "durationNano", "dataType": "float64", "type": "tag", "isColumn": true, "isJSON": false },
              "filters": {
                "op": "AND",
                "items": [
                  {
                    "id": "f-svc",
                    "key": { "id": "serviceName--string--tag--true", "key": "serviceName", "dataType": "string", "type": "tag", "isColumn": true, "isJSON": false },
                    "op": "=",
                    "value": "compliance-agent"
                  },
                  {
                    "id": "f-stage",
                    "key": { "id": "name--string--tag--true", "key": "name", "dataType": "string", "type": "tag", "isColumn": true, "isJSON": false },
                    "op": "in",
                    "value": ["run_pipeline", "stage_sast", "stage_sbom_generation", "stage_cve_scanning", "stage_pattern_scanning", "stage_secret_detection", "stage_lint_scanning", "stage_code_review", "stage_graph_building"]
                  }
                ]
              },
              "functions": [],
              "groupBy": [
                { "id": "name--string--tag--true", "key": "name", "dataType": "string", "type": "tag", "isColumn": true, "isJSON": false }
              ],
              "having": [],
              "legend": "{{name}}",
              "disabled": false,
              "stepInterval": 60,
              "reduceTo": "avg",
              "spaceAggregation": "sum",
              "timeAggregation": "avg",
              "orderBy": [],
              "limit": null
            }
          ],
          "queryFormulas": []
        },
        "promql": [{ "name": "A", "query": "", "disabled": false, "legend": "" }],
        "clickhouse_sql": [{ "name": "A", "query": "", "disabled": false, "legend": "" }]
      }
    },
    {
      "id": "scan-count",
      "title": "Total Scans",
      "panelTypes": "value",
      "description": "Total pipeline runs in selected time range",
      "opacity": "1",
      "yAxisUnit": "none",
      "isStacked": false,
      "nullZeroValues": "zero",
      "fillSpans": false,
      "mergeAllActiveQueries": false,
      "timePreferance": "GLOBAL_TIME",
      "columnUnits": {},
      "thresholds": [],
      "softMin": 0,
      "softMax": 0,
      "bucketCount": 30,
      "bucketWidth": 0,
      "stackedBarChart": false,
      "selectedLogFields": [],
      "selectedTracesFields": [],
      "query": {
        "queryType": "builder",
        "builder": {
          "queryData": [
            {
              "queryName": "A",
              "expression": "A",
              "dataSource": "traces",
              "aggregateOperator": "count",
              "aggregateAttribute": { "id": "------false", "key": "", "dataType": "", "type": "", "isColumn": false, "isJSON": false },
              "filters": {
                "op": "AND",
                "items": [
                  {
                    "id": "f-svc",
                    "key": { "id": "serviceName--string--tag--true", "key": "serviceName", "dataType": "string", "type": "tag", "isColumn": true, "isJSON": false },
                    "op": "=",
                    "value": "compliance-agent"
                  },
                  {
                    "id": "f-run",
                    "key": { "id": "name--string--tag--true", "key": "name", "dataType": "string", "type": "tag", "isColumn": true, "isJSON": false },
                    "op": "=",
                    "value": "run"
                  }
                ]
              },
              "functions": [],
              "groupBy": [],
              "having": [],
              "legend": "Scans",
              "disabled": false,
              "stepInterval": 60,
              "reduceTo": "sum",
              "spaceAggregation": "sum",
              "timeAggregation": "rate",
              "orderBy": [],
              "limit": null
            }
          ],
          "queryFormulas": []
        },
        "promql": [{ "name": "A", "query": "", "disabled": false, "legend": "" }],
        "clickhouse_sql": [{ "name": "A", "query": "", "disabled": false, "legend": "" }]
      }
    },
    {
      "id": "scan-errors",
      "title": "Failed Scans",
      "panelTypes": "value",
      "description": "Pipeline runs that errored",
      "opacity": "1",
      "yAxisUnit": "none",
      "isStacked": false,
      "nullZeroValues": "zero",
      "fillSpans": false,
      "mergeAllActiveQueries": false,
      "timePreferance": "GLOBAL_TIME",
      "columnUnits": {},
      "thresholds": [],
      "softMin": 0,
      "softMax": 0,
      "bucketCount": 30,
      "bucketWidth": 0,
      "stackedBarChart": false,
      "selectedLogFields": [],
      "selectedTracesFields": [],
      "query": {
        "queryType": "builder",
        "builder": {
          "queryData": [
            {
              "queryName": "A",
              "expression": "A",
              "dataSource": "traces",
              "aggregateOperator": "count",
              "aggregateAttribute": { "id": "------false", "key": "", "dataType": "", "type": "", "isColumn": false, "isJSON": false },
              "filters": {
                "op": "AND",
                "items": [
                  {
                    "id": "f-svc",
                    "key": { "id": "serviceName--string--tag--true", "key": "serviceName", "dataType": "string", "type": "tag", "isColumn": true, "isJSON": false },
                    "op": "=",
                    "value": "compliance-agent"
                  },
                  {
                    "id": "f-run",
                    "key": { "id": "name--string--tag--true", "key": "name", "dataType": "string", "type": "tag", "isColumn": true, "isJSON": false },
                    "op": "=",
                    "value": "run"
                  },
                  {
                    "id": "f-err",
                    "key": { "id": "hasError--bool--tag--true", "key": "hasError", "dataType": "bool", "type": "tag", "isColumn": true, "isJSON": false },
                    "op": "=",
                    "value": "true"
                  }
                ]
              },
              "functions": [],
              "groupBy": [],
              "having": [],
              "legend": "Failed",
              "disabled": false,
              "stepInterval": 60,
              "reduceTo": "sum",
              "spaceAggregation": "sum",
              "timeAggregation": "rate",
              "orderBy": [],
              "limit": null
            }
          ],
          "queryFormulas": []
        },
        "promql": [{ "name": "A", "query": "", "disabled": false, "legend": "" }],
        "clickhouse_sql": [{ "name": "A", "query": "", "disabled": false, "legend": "" }]
      }
    },
    {
      "id": "pipeline-runs",
      "title": "Recent Pipeline Traces",
      "panelTypes": "list",
      "description": "Individual scan pipeline traces, most recent first",
      "opacity": "1",
      "yAxisUnit": "none",
      "isStacked": false,
      "nullZeroValues": "zero",
      "fillSpans": false,
      "mergeAllActiveQueries": false,
      "timePreferance": "GLOBAL_TIME",
      "columnUnits": { "A": "ns" },
      "thresholds": [],
      "softMin": 0,
      "softMax": 0,
      "bucketCount": 30,
      "bucketWidth": 0,
      "stackedBarChart": false,
      "selectedLogFields": [],
      "selectedTracesFields": [
        { "id": "serviceName--string--tag--true", "key": "serviceName", "dataType": "string", "type": "tag", "isColumn": true, "isJSON": false },
        { "id": "name--string--tag--true", "key": "name", "dataType": "string", "type": "tag", "isColumn": true, "isJSON": false },
        { "id": "durationNano--float64--tag--true", "key": "durationNano", "dataType": "float64", "type": "tag", "isColumn": true, "isJSON": false },
        { "id": "hasError--bool--tag--true", "key": "hasError", "dataType": "bool", "type": "tag", "isColumn": true, "isJSON": false }
      ],
      "query": {
        "queryType": "builder",
        "builder": {
          "queryData": [
            {
              "queryName": "A",
              "expression": "A",
              "dataSource": "traces",
              "aggregateOperator": "noop",
              "aggregateAttribute": { "id": "------false", "key": "", "dataType": "", "type": "", "isColumn": false, "isJSON": false },
              "filters": {
                "op": "AND",
                "items": [
                  {
                    "id": "f-svc",
                    "key": { "id": "serviceName--string--tag--true", "key": "serviceName", "dataType": "string", "type": "tag", "isColumn": true, "isJSON": false },
                    "op": "=",
                    "value": "compliance-agent"
                  },
                  {
                    "id": "f-run",
                    "key": { "id": "name--string--tag--true", "key": "name", "dataType": "string", "type": "tag", "isColumn": true, "isJSON": false },
                    "op": "in",
                    "value": ["run", "run_pipeline"]
                  }
                ]
              },
              "functions": [],
              "groupBy": [],
              "having": [],
              "legend": "",
              "disabled": false,
              "stepInterval": 60,
              "reduceTo": "avg",
              "spaceAggregation": "sum",
              "timeAggregation": "rate",
              "orderBy": [{ "columnName": "timestamp", "order": "desc" }],
              "limit": null,
              "offset": 0,
              "pageSize": 10
            }
          ],
          "queryFormulas": []
        },
        "promql": [{ "name": "A", "query": "", "disabled": false, "legend": "" }],
        "clickhouse_sql": [{ "name": "A", "query": "", "disabled": false, "legend": "" }]
      }
    },
    {
      "id": "row-subapis",
      "title": "Graph / DAST / Chat APIs",
      "panelTypes": "row",
      "description": "",
      "query": { "queryType": "builder", "builder": { "queryData": [], "queryFormulas": [] }, "promql": [], "clickhouse_sql": [] }
    },
    {
      "id": "graph-latency",
      "title": "Graph API p95 Latency",
      "panelTypes": "graph",
      "description": "Graph endpoint latency by operation",
      "opacity": "1",
      "yAxisUnit": "ns",
      "isStacked": false,
      "nullZeroValues": "zero",
      "fillSpans": false,
      "mergeAllActiveQueries": false,
      "timePreferance": "GLOBAL_TIME",
      "columnUnits": {},
      "thresholds": [],
      "softMin": 0,
      "softMax": 0,
      "bucketCount": 30,
      "bucketWidth": 0,
      "stackedBarChart": false,
      "selectedLogFields": [],
      "selectedTracesFields": [],
      "query": {
        "queryType": "builder",
        "builder": {
          "queryData": [
            {
              "queryName": "A",
              "expression": "A",
              "dataSource": "traces",
              "aggregateOperator": "p95",
              "aggregateAttribute": { "id": "durationNano--float64--tag--true", "key": "durationNano", "dataType": "float64", "type": "tag", "isColumn": true, "isJSON": false },
              "filters": {
                "op": "AND",
                "items": [
                  {
                    "id": "f-svc",
                    "key": { "id": "serviceName--string--tag--true", "key": "serviceName", "dataType": "string", "type": "tag", "isColumn": true, "isJSON": false },
                    "op": "=",
                    "value": "compliance-agent"
                  },
                  {
                    "id": "f-name",
                    "key": { "id": "name--string--tag--true", "key": "name", "dataType": "string", "type": "tag", "isColumn": true, "isJSON": false },
                    "op": "in",
                    "value": ["get_graph", "get_nodes", "get_communities", "get_impact", "search_symbols", "get_file_content", "trigger_build"]
                  }
                ]
              },
              "functions": [],
              "groupBy": [
                { "id": "name--string--tag--true", "key": "name", "dataType": "string", "type": "tag", "isColumn": true, "isJSON": false }
              ],
              "having": [],
              "legend": "{{name}}",
              "disabled": false,
              "stepInterval": 60,
              "reduceTo": "avg",
              "spaceAggregation": "sum",
              "timeAggregation": "avg",
              "orderBy": [],
              "limit": null
            }
          ],
          "queryFormulas": []
        },
        "promql": [{ "name": "A", "query": "", "disabled": false, "legend": "" }],
        "clickhouse_sql": [{ "name": "A", "query": "", "disabled": false, "legend": "" }]
      }
    },
    {
      "id": "dast-latency",
      "title": "DAST API p95 Latency",
      "panelTypes": "graph",
      "description": "DAST endpoint latency by operation",
      "opacity": "1",
      "yAxisUnit": "ns",
      "isStacked": false,
      "nullZeroValues": "zero",
      "fillSpans": false,
      "mergeAllActiveQueries": false,
      "timePreferance": "GLOBAL_TIME",
      "columnUnits": {},
      "thresholds": [],
      "softMin": 0,
      "softMax": 0,
      "bucketCount": 30,
      "bucketWidth": 0,
      "stackedBarChart": false,
      "selectedLogFields": [],
      "selectedTracesFields": [],
      "query": {
        "queryType": "builder",
        "builder": {
          "queryData": [
            {
              "queryName": "A",
              "expression": "A",
              "dataSource": "traces",
              "aggregateOperator": "p95",
              "aggregateAttribute": { "id": "durationNano--float64--tag--true", "key": "durationNano", "dataType": "float64", "type": "tag", "isColumn": true, "isJSON": false },
              "filters": {
                "op": "AND",
                "items": [
                  {
                    "id": "f-svc",
                    "key": { "id": "serviceName--string--tag--true", "key": "serviceName", "dataType": "string", "type": "tag", "isColumn": true, "isJSON": false },
                    "op": "=",
                    "value": "compliance-agent"
                  },
                  {
                    "id": "f-name",
                    "key": { "id": "name--string--tag--true", "key": "name", "dataType": "string", "type": "tag", "isColumn": true, "isJSON": false },
                    "op": "in",
                    "value": ["list_targets", "add_target", "list_scan_runs", "list_findings", "get_finding"]
                  }
                ]
              },
              "functions": [],
              "groupBy": [
                { "id": "name--string--tag--true", "key": "name", "dataType": "string", "type": "tag", "isColumn": true, "isJSON": false }
              ],
              "having": [],
              "legend": "{{name}}",
              "disabled": false,
              "stepInterval": 60,
              "reduceTo": "avg",
              "spaceAggregation": "sum",
              "timeAggregation": "avg",
              "orderBy": [],
              "limit": null
            }
          ],
          "queryFormulas": []
        },
        "promql": [{ "name": "A", "query": "", "disabled": false, "legend": "" }],
        "clickhouse_sql": [{ "name": "A", "query": "", "disabled": false, "legend": "" }]
      }
    },
    {
      "id": "chat-latency",
      "title": "Chat / RAG API p95 Latency",
      "panelTypes": "graph",
      "description": "Chat and embedding endpoint latency",
      "opacity": "1",
      "yAxisUnit": "ns",
      "isStacked": false,
      "nullZeroValues": "zero",
      "fillSpans": false,
      "mergeAllActiveQueries": false,
      "timePreferance": "GLOBAL_TIME",
      "columnUnits": {},
      "thresholds": [],
      "softMin": 0,
      "softMax": 0,
      "bucketCount": 30,
      "bucketWidth": 0,
      "stackedBarChart": false,
      "selectedLogFields": [],
      "selectedTracesFields": [],
      "query": {
        "queryType": "builder",
        "builder": {
          "queryData": [
            {
              "queryName": "A",
              "expression": "A",
              "dataSource": "traces",
              "aggregateOperator": "p95",
              "aggregateAttribute": { "id": "durationNano--float64--tag--true", "key": "durationNano", "dataType": "float64", "type": "tag", "isColumn": true, "isJSON": false },
              "filters": {
                "op": "AND",
                "items": [
                  {
                    "id": "f-svc",
                    "key": { "id": "serviceName--string--tag--true", "key": "serviceName", "dataType": "string", "type": "tag", "isColumn": true, "isJSON": false },
                    "op": "=",
                    "value": "compliance-agent"
                  },
                  {
                    "id": "f-name",
                    "key": { "id": "name--string--tag--true", "key": "name", "dataType": "string", "type": "tag", "isColumn": true, "isJSON": false },
                    "op": "in",
                    "value": ["chat", "build_embeddings", "embedding_status"]
                  }
                ]
              },
              "functions": [],
              "groupBy": [
                { "id": "name--string--tag--true", "key": "name", "dataType": "string", "type": "tag", "isColumn": true, "isJSON": false }
              ],
              "having": [],
              "legend": "{{name}}",
              "disabled": false,
              "stepInterval": 60,
              "reduceTo": "avg",
              "spaceAggregation": "sum",
              "timeAggregation": "avg",
              "orderBy": [],
              "limit": null
            }
          ],
          "queryFormulas": []
        },
        "promql": [{ "name": "A", "query": "", "disabled": false, "legend": "" }],
        "clickhouse_sql": [{ "name": "A", "query": "", "disabled": false, "legend": "" }]
      }
    },
    {
      "id": "row-logs",
      "title": "Logs & Warnings",
      "panelTypes": "row",
      "description": "",
      "query": { "queryType": "builder", "builder": { "queryData": [], "queryFormulas": [] }, "promql": [], "clickhouse_sql": [] }
    },
    {
      "id": "log-rate",
      "title": "WARN / ERROR Log Rate",
      "panelTypes": "graph",
      "description": "Warn and error log entries over time",
      "opacity": "1",
      "yAxisUnit": "none",
      "isStacked": true,
      "nullZeroValues": "zero",
      "fillSpans": false,
      "mergeAllActiveQueries": false,
      "timePreferance": "GLOBAL_TIME",
      "columnUnits": {},
      "thresholds": [],
      "softMin": 0,
      "softMax": 0,
      "bucketCount": 30,
      "bucketWidth": 0,
      "stackedBarChart": false,
      "selectedLogFields": [],
      "selectedTracesFields": [],
      "query": {
        "queryType": "builder",
        "builder": {
          "queryData": [
            {
              "queryName": "A",
              "expression": "A",
              "dataSource": "logs",
              "aggregateOperator": "count",
              "aggregateAttribute": { "id": "------false", "key": "", "dataType": "", "type": "", "isColumn": false, "isJSON": false },
              "filters": {
                "op": "AND",
                "items": [
                  {
                    "id": "f-svc",
                    "key": { "id": "service.name--string--resource--false", "key": "service.name", "dataType": "string", "type": "resource", "isColumn": false, "isJSON": false },
                    "op": "=",
                    "value": "compliance-agent"
                  },
                  {
                    "id": "f-level",
                    "key": { "id": "severity_text--string--tag--true", "key": "severity_text", "dataType": "string", "type": "tag", "isColumn": true, "isJSON": false },
                    "op": "in",
                    "value": ["WARN", "ERROR"]
                  }
                ]
              },
              "functions": [],
              "groupBy": [
                { "id": "severity_text--string--tag--true", "key": "severity_text", "dataType": "string", "type": "tag", "isColumn": true, "isJSON": false }
              ],
              "having": [],
              "legend": "{{severity_text}}",
              "disabled": false,
              "stepInterval": 60,
              "reduceTo": "avg",
              "spaceAggregation": "sum",
              "timeAggregation": "rate",
              "orderBy": [],
              "limit": null
            }
          ],
          "queryFormulas": []
        },
        "promql": [{ "name": "A", "query": "", "disabled": false, "legend": "" }],
        "clickhouse_sql": [{ "name": "A", "query": "", "disabled": false, "legend": "" }]
      }
    },
    {
      "id": "error-logs",
      "title": "Recent Error Logs",
      "panelTypes": "list",
      "description": "Latest ERROR-level log entries",
      "opacity": "1",
      "yAxisUnit": "none",
      "isStacked": false,
      "nullZeroValues": "zero",
      "fillSpans": false,
      "mergeAllActiveQueries": false,
      "timePreferance": "GLOBAL_TIME",
      "columnUnits": {},
      "thresholds": [],
      "softMin": 0,
      "softMax": 0,
      "bucketCount": 30,
      "bucketWidth": 0,
      "stackedBarChart": false,
      "selectedLogFields": [
        { "dataType": "string", "name": "body", "type": "" },
        { "dataType": "string", "name": "timestamp", "type": "" },
        { "dataType": "string", "name": "severity_text", "type": "" }
      ],
      "selectedTracesFields": [],
      "query": {
        "queryType": "builder",
        "builder": {
          "queryData": [
            {
              "queryName": "A",
              "expression": "A",
              "dataSource": "logs",
              "aggregateOperator": "noop",
              "aggregateAttribute": { "id": "------false", "key": "", "dataType": "", "type": "", "isColumn": false, "isJSON": false },
              "filters": {
                "op": "AND",
                "items": [
                  {
                    "id": "f-svc",
                    "key": { "id": "service.name--string--resource--false", "key": "service.name", "dataType": "string", "type": "resource", "isColumn": false, "isJSON": false },
                    "op": "=",
                    "value": "compliance-agent"
                  },
                  {
                    "id": "f-level",
                    "key": { "id": "severity_text--string--tag--true", "key": "severity_text", "dataType": "string", "type": "tag", "isColumn": true, "isJSON": false },
                    "op": "=",
                    "value": "ERROR"
                  }
                ]
              },
              "functions": [],
              "groupBy": [],
              "having": [],
              "legend": "",
              "disabled": false,
              "stepInterval": 60,
              "reduceTo": "avg",
              "spaceAggregation": "sum",
              "timeAggregation": "rate",
              "orderBy": [{ "columnName": "timestamp", "order": "desc" }],
              "limit": null,
              "offset": 0,
              "pageSize": 10
            }
          ],
          "queryFormulas": []
        },
        "promql": [{ "name": "A", "query": "", "disabled": false, "legend": "" }],
        "clickhouse_sql": [{ "name": "A", "query": "", "disabled": false, "legend": "" }]
      }
    }
  ]
}
