Skip to content

Draft: Add SpanAttributes to tracing query table

Mat Appelman requested to merge mat/add-span-attrs-to-tracing-mv into main

Stores SpanAttributes in our traces query table which is populated by a materialized view.

Closes #2454 (closed)

Relates to https://gitlab.com/gitlab-org/opstrace/opstrace/-/issues/2388

After:

cluster-0-0-0.cluster-0-0.default.svc.cluster.local :) describe table tracing.gl_traces_rolled_local

DESCRIBE TABLE tracing.gl_traces_rolled_local

Query id: 272e9360-54bf-4e8e-a3a4-a793b72ae1fd

┌─name───────────┬─type────────────────────────────────┬─default_type─┬─default_expression─┬─comment─┬─codec_expression──┬─ttl_expression─┐
│ ProjectId      │ String                              │              │                    │         │ ZSTD(1)           │                │
│ TraceId        │ FixedString(16)                     │              │                    │         │ ZSTD(1)           │                │
│ SpanId         │ FixedString(8)                      │              │                    │         │ ZSTD(1)           │                │
│ Start          │ DateTime64(9)                       │              │                    │         │ Delta(8), ZSTD(1) │                │
│ ServiceName    │ String                              │              │                    │         │ ZSTD(1)           │                │
│ SpanName       │ String                              │              │                    │         │ ZSTD(1)           │                │
│ StatusCode     │ LowCardinality(String)              │              │                    │         │ ZSTD(1)           │                │
│ ParentSpanId   │ FixedString(8)                      │              │                    │         │ ZSTD(1)           │                │
│ Duration       │ Int64                               │              │                    │         │ ZSTD(1)           │                │
│ SpanAttributes │ Map(LowCardinality(String), String) │              │                    │         │ ZSTD(1)           │                │
└────────────────┴─────────────────────────────────────┴──────────────┴────────────────────┴─────────┴───────────────────┴────────────────┘

10 rows in set. Elapsed: 0.001 sec.
Edited by Mat Appelman

Merge request reports