mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
chore: add aibridge data to telemetry (#20449)
- Adds a new table to keep track of which payloads have already been reported since we only report for the last clock hour - Adds a query to gather and aggregate all the data by provider/model/client Relates to https://github.com/coder/coder-telemetry-server/issues/27
This commit is contained in:
@@ -0,0 +1 @@
|
||||
DROP TABLE telemetry_locks;
|
||||
@@ -0,0 +1,12 @@
|
||||
CREATE TABLE telemetry_locks (
|
||||
event_type TEXT NOT NULL CONSTRAINT telemetry_lock_event_type_constraint CHECK (event_type IN ('aibridge_interceptions_summary')),
|
||||
period_ending_at TIMESTAMP WITH TIME ZONE NOT NULL,
|
||||
|
||||
PRIMARY KEY (event_type, period_ending_at)
|
||||
);
|
||||
|
||||
COMMENT ON TABLE telemetry_locks IS 'Telemetry lock tracking table for deduplication of heartbeat events across replicas.';
|
||||
COMMENT ON COLUMN telemetry_locks.event_type IS 'The type of event that was sent.';
|
||||
COMMENT ON COLUMN telemetry_locks.period_ending_at IS 'The heartbeat period end timestamp.';
|
||||
|
||||
CREATE INDEX idx_telemetry_locks_period_ending_at ON telemetry_locks (period_ending_at);
|
||||
@@ -0,0 +1,8 @@
|
||||
INSERT INTO telemetry_locks (
|
||||
event_type,
|
||||
period_ending_at
|
||||
)
|
||||
VALUES (
|
||||
'aibridge_interceptions_summary',
|
||||
'2025-01-01 00:00:00+00'::timestamptz
|
||||
);
|
||||
Reference in New Issue
Block a user