Skip to content

Commit

Permalink
feat: update clickhouse reader to support new trace schema (#6479)
Browse files Browse the repository at this point in the history
* feat: update clickhouse reader to support new trace schema

* fix: minor fixes

* fix: address comments

* fix: add changes to overview function

* fix: add changes to overview function

* fix: use hardcoded true

* fix: address comments
  • Loading branch information
nityanandagohain authored Nov 20, 2024
1 parent 5044861 commit d43adc2
Show file tree
Hide file tree
Showing 4 changed files with 525 additions and 24 deletions.
18 changes: 18 additions & 0 deletions pkg/query-service/app/clickhouseReader/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const (
defaultTraceDB string = "signoz_traces"
defaultOperationsTable string = "distributed_signoz_operations"
defaultIndexTable string = "distributed_signoz_index_v2"
defaultLocalIndexTable string = "signoz_index_v2"
defaultErrorTable string = "distributed_signoz_error_index_v2"
defaultDurationTable string = "distributed_durationSort"
defaultUsageExplorerTable string = "distributed_usage_explorer"
Expand All @@ -45,6 +46,11 @@ const (
defaultLogsTableV2 string = "distributed_logs_v2"
defaultLogsResourceLocalTableV2 string = "logs_v2_resource"
defaultLogsResourceTableV2 string = "distributed_logs_v2_resource"

defaultTraceIndexTableV3 string = "distributed_signoz_index_v3"
defaultTraceLocalTableName string = "signoz_index_v3"
defaultTraceResourceTableV3 string = "distributed_traces_v3_resource"
defaultTraceSummaryTable string = "distributed_trace_summary"
)

// NamespaceConfig is Clickhouse's internal configuration data
Expand All @@ -58,6 +64,7 @@ type namespaceConfig struct {
TraceDB string
OperationsTable string
IndexTable string
LocalIndexTable string
DurationTable string
UsageExplorerTable string
SpansTable string
Expand All @@ -82,6 +89,11 @@ type namespaceConfig struct {
LogsTableV2 string
LogsResourceLocalTableV2 string
LogsResourceTableV2 string

TraceIndexTableV3 string
TraceLocalTableNameV3 string
TraceResourceTableV3 string
TraceSummaryTable string
}

// Connecto defines how to connect to the database
Expand Down Expand Up @@ -150,6 +162,7 @@ func NewOptions(
TraceDB: defaultTraceDB,
OperationsTable: defaultOperationsTable,
IndexTable: defaultIndexTable,
LocalIndexTable: defaultLocalIndexTable,
ErrorTable: defaultErrorTable,
DurationTable: defaultDurationTable,
UsageExplorerTable: defaultUsageExplorerTable,
Expand All @@ -174,6 +187,11 @@ func NewOptions(
LogsLocalTableV2: defaultLogsLocalTableV2,
LogsResourceTableV2: defaultLogsResourceTableV2,
LogsResourceLocalTableV2: defaultLogsResourceLocalTableV2,

TraceIndexTableV3: defaultTraceIndexTableV3,
TraceLocalTableNameV3: defaultTraceLocalTableName,
TraceResourceTableV3: defaultTraceResourceTableV3,
TraceSummaryTable: defaultTraceSummaryTable,
},
others: make(map[string]*namespaceConfig, len(otherNamespaces)),
}
Expand Down
Loading

0 comments on commit d43adc2

Please sign in to comment.