-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: deprecate use of old columns in traces (#321)
* chore: deprecate use of old columns in traces * chore: add back externalHttpMethod and Url * chore: update httpRoute according to otel specs https://opentelemetry.io/docs/specs/semconv/attributes-registry/http/#http-deprecated-attributes * chore: update httpHost according to otel specs https://opentelemetry.io/docs/specs/semconv/attributes-registry/http/#http-deprecated-attributes
- Loading branch information
Showing
7 changed files
with
259 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
125 changes: 125 additions & 0 deletions
125
migrationmanager/migrators/traces/migrations/000028_drop_deprecated_columns.down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
|
||
DROP TABLE IF EXISTS signoz_traces.durationSortMV ON CLUSTER {{.SIGNOZ_CLUSTER}}; | ||
DROP VIEW IF EXISTS signoz_traces.dependency_graph_minutes_db_calls_mv ON CLUSTER {{.SIGNOZ_CLUSTER}}; | ||
DROP VIEW IF EXISTS signoz_traces.dependency_graph_minutes_messaging_calls_mv ON CLUSTER {{.SIGNOZ_CLUSTER}}; | ||
DROP VIEW IF EXISTS signoz_traces.dependency_graph_minutes_db_calls_mv_v2 ON CLUSTER {{.SIGNOZ_CLUSTER}}; | ||
DROP VIEW IF EXISTS signoz_traces.dependency_graph_minutes_messaging_calls_mv_v2 ON CLUSTER {{.SIGNOZ_CLUSTER}}; | ||
|
||
ALTER TABLE signoz_traces.signoz_index_v2 ON CLUSTER {{.SIGNOZ_CLUSTER}} | ||
ADD COLUMN IF NOT EXISTS tagMap Map(LowCardinality(String), String) CODEC(ZSTD(1)), | ||
ADD COLUMN IF NOT EXISTS gRPCCode LowCardinality(String) CODEC(ZSTD(1)), | ||
ADD COLUMN IF NOT EXISTS gRPCMethod LowCardinality(String) CODEC(ZSTD(1)), | ||
ADD COLUMN IF NOT EXISTS httpCode LowCardinality(String) CODEC(ZSTD(1)), | ||
ADD COLUMN IF NOT EXISTS component LowCardinality(String) CODEC(ZSTD(1)); | ||
|
||
ALTER TABLE signoz_traces.distributed_signoz_index_v2 ON CLUSTER {{.SIGNOZ_CLUSTER}} | ||
ADD COLUMN IF NOT EXISTS tagMap Map(LowCardinality(String), String) CODEC(ZSTD(1)), | ||
ADD COLUMN IF NOT EXISTS gRPCCode LowCardinality(String) CODEC(ZSTD(1)), | ||
ADD COLUMN IF NOT EXISTS gRPCMethod LowCardinality(String) CODEC(ZSTD(1)), | ||
ADD COLUMN IF NOT EXISTS httpCode LowCardinality(String) CODEC(ZSTD(1)), | ||
ADD COLUMN IF NOT EXISTS component LowCardinality(String) CODEC(ZSTD(1)); | ||
|
||
ALTER TABLE signoz_traces.durationSort ON CLUSTER {{.SIGNOZ_CLUSTER}} | ||
ADD COLUMN IF NOT EXISTS tagMap Map(LowCardinality(String), String) CODEC(ZSTD(1)), | ||
ADD COLUMN IF NOT EXISTS gRPCCode LowCardinality(String) CODEC(ZSTD(1)), | ||
ADD COLUMN IF NOT EXISTS gRPCMethod LowCardinality(String) CODEC(ZSTD(1)), | ||
ADD COLUMN IF NOT EXISTS httpCode LowCardinality(String) CODEC(ZSTD(1)), | ||
ADD COLUMN IF NOT EXISTS component LowCardinality(String) CODEC(ZSTD(1)); | ||
|
||
ALTER TABLE signoz_traces.distributed_durationSort ON CLUSTER {{.SIGNOZ_CLUSTER}} | ||
ADD COLUMN IF NOT EXISTS tagMap Map(LowCardinality(String), String) CODEC(ZSTD(1)), | ||
ADD COLUMN IF NOT EXISTS gRPCCode LowCardinality(String) CODEC(ZSTD(1)), | ||
ADD COLUMN IF NOT EXISTS gRPCMethod LowCardinality(String) CODEC(ZSTD(1)), | ||
ADD COLUMN IF NOT EXISTS httpCode LowCardinality(String) CODEC(ZSTD(1)), | ||
ADD COLUMN IF NOT EXISTS component LowCardinality(String) CODEC(ZSTD(1)); | ||
|
||
CREATE MATERIALIZED VIEW IF NOT EXISTS signoz_traces.durationSortMV ON CLUSTER {{.SIGNOZ_CLUSTER}} | ||
TO signoz_traces.durationSort | ||
AS SELECT | ||
timestamp, | ||
traceID, | ||
spanID, | ||
parentSpanID, | ||
serviceName, | ||
name, | ||
kind, | ||
durationNano, | ||
statusCode, | ||
component, | ||
httpMethod, | ||
httpUrl, | ||
httpCode, | ||
httpRoute, | ||
httpHost, | ||
gRPCCode, | ||
gRPCMethod, | ||
hasError, | ||
tagMap, | ||
rpcSystem, | ||
rpcService, | ||
rpcMethod, | ||
responseStatusCode, | ||
stringTagMap, | ||
numberTagMap, | ||
boolTagMap, | ||
isRemote | ||
FROM signoz_traces.signoz_index_v2 | ||
ORDER BY durationNano, timestamp; | ||
|
||
CREATE MATERIALIZED VIEW IF NOT EXISTS signoz_traces.dependency_graph_minutes_db_calls_mv ON CLUSTER {{.SIGNOZ_CLUSTER}} | ||
TO signoz_traces.dependency_graph_minutes AS | ||
SELECT | ||
serviceName as src, | ||
tagMap['db.system'] as dest, | ||
quantilesState(0.5, 0.75, 0.9, 0.95, 0.99)(toFloat64(durationNano)) as duration_quantiles_state, | ||
countIf(statusCode=2) as error_count, | ||
count(*) as total_count, | ||
toStartOfMinute(timestamp) as timestamp | ||
FROM signoz_traces.signoz_index_v2 | ||
WHERE dest != '' and kind != 2 | ||
GROUP BY timestamp, src, dest; | ||
|
||
CREATE MATERIALIZED VIEW IF NOT EXISTS signoz_traces.dependency_graph_minutes_messaging_calls_mv ON CLUSTER {{.SIGNOZ_CLUSTER}} | ||
TO signoz_traces.dependency_graph_minutes AS | ||
SELECT | ||
serviceName as src, | ||
tagMap[messaging.system] as dest, | ||
quantilesState(0.5, 0.75, 0.9, 0.95, 0.99)(toFloat64(durationNano)) as duration_quantiles_state, | ||
countIf(statusCode=2) as error_count, | ||
count(*) as total_count, | ||
toStartOfMinute(timestamp) as timestamp | ||
FROM signoz_traces.signoz_index_v2 | ||
WHERE dest != '' and kind != 2 | ||
GROUP BY timestamp, src, dest; | ||
|
||
CREATE MATERIALIZED VIEW IF NOT EXISTS signoz_traces.dependency_graph_minutes_db_calls_mv_v2 ON CLUSTER {{.SIGNOZ_CLUSTER}} | ||
TO signoz_traces.dependency_graph_minutes_v2 AS | ||
SELECT | ||
serviceName as src, | ||
tagMap['db.system'] as dest, | ||
quantilesState(0.5, 0.75, 0.9, 0.95, 0.99)(toFloat64(durationNano)) as duration_quantiles_state, | ||
countIf(statusCode=2) as error_count, | ||
count(*) as total_count, | ||
toStartOfMinute(timestamp) as timestamp, | ||
resourceTagsMap['deployment.environment'] as deployment_environment, | ||
resourceTagsMap['k8s.cluster.name'] as k8s_cluster_name, | ||
resourceTagsMap['k8s.namespace.name'] as k8s_namespace_name | ||
FROM signoz_traces.signoz_index_v2 | ||
WHERE dest != '' and kind != 2 | ||
GROUP BY timestamp, src, dest, deployment_environment, k8s_cluster_name, k8s_namespace_name; | ||
|
||
CREATE MATERIALIZED VIEW IF NOT EXISTS signoz_traces.dependency_graph_minutes_messaging_calls_mv_v2 ON CLUSTER {{.SIGNOZ_CLUSTER}} | ||
TO signoz_traces.dependency_graph_minutes_v2 AS | ||
SELECT | ||
serviceName as src, | ||
tagMap[messaging.system] as dest, | ||
quantilesState(0.5, 0.75, 0.9, 0.95, 0.99)(toFloat64(durationNano)) as duration_quantiles_state, | ||
countIf(statusCode=2) as error_count, | ||
count(*) as total_count, | ||
toStartOfMinute(timestamp) as timestamp, | ||
resourceTagsMap['deployment.environment'] as deployment_environment, | ||
resourceTagsMap['k8s.cluster.name'] as k8s_cluster_name, | ||
resourceTagsMap['k8s.namespace.name'] as k8s_namespace_name | ||
FROM signoz_traces.signoz_index_v2 | ||
WHERE dest != '' and kind != 2 | ||
GROUP BY timestamp, src, dest, deployment_environment, k8s_cluster_name, k8s_namespace_name; |
Oops, something went wrong.