Skip to content

Instantly share code, notes, and snippets.

@tkaemming
Created July 19, 2019 18:57
Show Gist options
  • Save tkaemming/951bb0715fb7683ce243a1994b90dbea to your computer and use it in GitHub Desktop.
Save tkaemming/951bb0715fb7683ce243a1994b90dbea to your computer and use it in GitHub Desktop.
ClickHouse Table Schema for Tracking Call Timing and Similarity with Service Delegator
CREATE TABLE calls (
-- Kafka Message Details
timestamp DateTime,
partition UInt8,
offset UInt64,
-- Call Signature
service String,
method String,
arguments Nested (
name String,
value String
),
-- Call Results
results Nested (
backend String,
started Nullable(UInt64), -- millisecond timestamp
finished Nullable(UInt64), -- millisecond timestamp
status Enum8(
'success' = 0,
'failure' = 1
),
exception_type Nullable(String),
similarity Nullable(Float32) -- [0.0, 1.0] (not similar to exact same) compared to baseline (first) result
)
-- Additional Tags
tags Nested (
name String,
value String
)
) ENGINE = MergeTree
PARTITION BY toDate(timestamp)
ORDER BY (service, method, timestamp)
@JTCunning
Copy link

Good table, Ted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment