kin2.zipkin-storage-cassandra.3.4.1.source-code.zipkin2-schema-upgrade-2.cql Maven / Gradle / Ivy
CREATE TABLE IF NOT EXISTS zipkin2.remote_service_by_service (
service text,
remote_service text,
PRIMARY KEY (service, remote_service)
)
WITH compaction = {'class': 'org.apache.cassandra.db.compaction.LeveledCompactionStrategy', 'unchecked_tombstone_compaction': 'true', 'tombstone_threshold': '0.2'}
AND caching = {'rows_per_partition': 'ALL'}
AND default_time_to_live = 259200
AND gc_grace_seconds = 3600
AND read_repair_chance = 0
AND dclocal_read_repair_chance = 0
AND speculative_retry = '95percentile'
AND comment = 'Secondary table for looking up remote service names by a service name.';
CREATE TABLE IF NOT EXISTS zipkin2.trace_by_service_remote_service (
service text, //-- service name
remote_service text, //-- remote servie name
bucket int, //-- time bucket, calculated as ts/interval (in microseconds), for some pre-configured interval like 1 day.
ts timeuuid, //-- start timestamp of the span, truncated to millisecond precision
trace_id text, //-- trace ID
PRIMARY KEY ((service, remote_service, bucket), ts)
)
WITH CLUSTERING ORDER BY (ts DESC)
AND compaction = {'class': 'org.apache.cassandra.db.compaction.TimeWindowCompactionStrategy'}
AND default_time_to_live = 259200
AND gc_grace_seconds = 3600
AND read_repair_chance = 0
AND dclocal_read_repair_chance = 0
AND speculative_retry = '95percentile'
AND comment = 'Secondary table for looking up a trace by a remote service. bucket column adds time bucketing to the partition key, values are microseconds rounded to a pre-configured interval (typically one day). ts column is start timestamp of the span as time-uuid, truncated to millisecond precision.';