{
  "schema_version": "analysis.report.v1",
  "generated_at": "2026-06-16T23:00:00Z",
  "window": {
    "start": "2026-06-15T23:00:00Z",
    "end": "2026-06-16T23:00:00Z"
  },
  "config": {
    "config_path": "/etc/click-dog/click-dog.yaml",
    "clickhouse_host": "clickhouse-1",
    "use_cluster_queries": false,
    "lookback": "24h0m0s",
    "timeout": "2m0s",
    "redact_dimensions": true,
    "min_trace_duration_ms": 1000,
    "min_executions": 3,
    "family_limit": 200,
    "span_sample_limit": 1000,
    "query_preview_length": 500
  },
  "coverage": {
    "normalized_query_supported": true,
    "query_family_rollups_supported": true,
    "query_family_count": 42,
    "span_sample_available": true,
    "span_sample_size": 1000,
    "spans_with_query_id": 610,
    "query_id_ratio": 0.61,
    "query_log_by_id_lookback_days": 2,
    "attribution_family_count": 17
  },
  "findings": [
    {
      "schema_version": "analysis.finding.v1",
      "id": "coverage:query_id_ratio:6f4a1b2c3d4e",
      "analyzer": "coverage",
      "severity": "warning",
      "confidence": 1,
      "title": "Low clickhouse.query_id span coverage",
      "summary": "Only 61.0% of 1000 sampled spans carry clickhouse.query_id, limiting query_log enrichment and attribution analysis.",
      "window_start": "2026-06-15T23:00:00Z",
      "window_end": "2026-06-16T23:00:00Z",
      "evidence": {
        "span_sample_size": 1000,
        "spans_with_query_id": 610,
        "query_id_ratio": 0.61,
        "threshold": 0.8,
        "lookback": "24h0m0s"
      },
      "recommendation": "Run `click-dog check` and verify OpenTelemetry trace propagation so ClickHouse records query_id on query spans."
    },
    {
      "schema_version": "analysis.finding.v1",
      "id": "resource_hog:family:012345abcdef",
      "analyzer": "resource_hog",
      "severity": "warning",
      "confidence": 1,
      "title": "Query family p95 read_rows is 8.4x peer median",
      "summary": "p95 read_rows is 8.4x the peer-family median in this window (1 metric above threshold).",
      "family_id": "family_17",
      "normalized_query_hashes": ["123456789"],
      "representative_query": "SELECT count() FROM events WHERE timestamp >= ?",
      "window_start": "2026-06-15T23:00:00Z",
      "window_end": "2026-06-16T23:00:00Z",
      "evidence": {
        "execution_count": 120,
        "p95_read_rows": 84000000,
        "peer_median_p95_read_rows": 10000000,
        "p95_read_rows_ratio": 8.4
      },
      "recommendation": "Inspect predicates, partition pruning, joins, and table access pattern for this family, and check whether it is expected batch/reporting workload."
    }
  ],
  "analyzer_runs": [
    {
      "name": "coverage",
      "findings": 1,
      "duration_ms": 1
    },
    {
      "name": "resource_hog",
      "findings": 1,
      "duration_ms": 2
    },
    {
      "name": "attribution_gap",
      "findings": 0,
      "duration_ms": 1
    },
    {
      "name": "skew",
      "findings": 0,
      "duration_ms": 1
    }
  ]
}
