Skip to content

Commit 11caedc

Browse files
committed
lets include codes
1 parent f10ef4f commit 11caedc

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/migrations/src/clickhouse-actions/015-otel-trace.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ export const action: Action = async exec => {
103103
, "graphql_operation_name" String CODEC(ZSTD(1))
104104
, "graphql_operation_type" LowCardinality(String) CODEC(ZSTD(1))
105105
, "graphql_operation_document" String CODEC(ZSTD(1))
106+
, "graphql_error_count" UInt32 CODEC(T64, ZSTD(1))
107+
, "graphql_error_codes" Array(LowCardinality(String)) CODEC(ZSTD(1))
106108
, "subgraph_names" Array(LowCardinality(String)) CODEC(ZSTD(1))
107109
, INDEX "idx_duration" "duration" TYPE minmax GRANULARITY 1
108110
, INDEX "idx_http_status_code" "http_status_code" TYPE bloom_filter(0.01) GRANULARITY 1
@@ -114,6 +116,7 @@ export const action: Action = async exec => {
114116
, INDEX "idx_client_version" "client_version" TYPE bloom_filter(0.01) GRANULARITY 1
115117
, INDEX "idx_graphql_operation_name" "graphql_operation_name" TYPE bloom_filter(0.01) GRANULARITY 1
116118
, INDEX "idx_graphql_operation_type" "graphql_operation_type" TYPE bloom_filter(0.01) GRANULARITY 1
119+
, INDEX "idx_graphql_error_codes" "graphql_error_codes" TYPE bloom_filter(0.01) GRANULARITY 1
117120
, INDEX "idx_subgraph_names" "subgraph_names" TYPE bloom_filter(0.01) GRANULARITY 1
118121
)
119122
ENGINE = MergeTree
@@ -142,6 +145,8 @@ export const action: Action = async exec => {
142145
, "graphql_operation_name" String
143146
, "graphql_operation_type" LowCardinality(String)
144147
, "graphql_operation_document" String
148+
, "graphql_error_count" UInt32
149+
, "graphql_error_codes" Array(LowCardinality(String))
145150
, "subgraph_names" Array(String)
146151
)
147152
AS (
@@ -161,6 +166,8 @@ export const action: Action = async exec => {
161166
, "SpanAttributes"['graphql.operation.name'] AS "graphql_operation_name"
162167
, toLowCardinality("SpanAttributes"['graphql.operation.type']) AS "graphql_operation_type"
163168
, "SpanAttributes"['graphql.operation.document'] AS "graphql_operation_document"
169+
, "SpanAttributes"['graphql.error.count'] AS "graphql_errors_count"
170+
, arrayMap(x -> toLowCardinality(x), splitByChar(',', "SpanAttributes"['graphql.error.codes'])) AS "graphql_error_codes"
164171
, arrayMap(x -> toLowCardinality(x), splitByChar(',', "SpanAttributes"['hive.subgraph.names'])) AS "subgraph_names"
165172
FROM
166173
"otel_traces"

0 commit comments

Comments
 (0)