all the changes
This commit is contained in:
1 parent
94f30165f9
commit
f30adf05af
35 files changed
+2979
-1607
No files matched your search
@@ -153,6 +153,9 @@ func NewClickHouseStore(ctx context.Context, cfg ClickHouseConfig) (*ClickHouseS
|
||||
// initSchema creates the raw entries table and the materialized hourly
|
||||
// rollup used by the stats endpoints. Idempotent.
|
||||
func (s *ClickHouseStore) initSchema(ctx context.Context) error {
|
||||
if err := EnsureNormalizedSchema(ctx, s.conn, s.db); err != nil {
|
||||
return fmt.Errorf("normalized schema: %w", err)
|
||||
}
|
||||
if err := s.conn.Exec(ctx, fmt.Sprintf(`CREATE TABLE IF NOT EXISTS %s.entries (
|
||||
timestamp DateTime64(9, 'UTC') NOT NULL,
|
||||
type LowCardinality(String) NOT NULL,
|
||||
@@ -361,6 +364,7 @@ func (s *ClickHouseStore) Append(ctx context.Context, entry websocket.HistoryEnt
|
||||
if err := s.appendSpanFacts(ctx, ts, facts); err != nil {
|
||||
return fmt.Errorf("clickhouse span facts: %w", err)
|
||||
}
|
||||
s.appendNormalized(ctx, entry)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user