chore: track the first time html is served in telemetry (#16334)

Addresses https://github.com/coder/nexus/issues/175.

## Changes

- Adds the `telemetry_items` database table. It's a key value store for
telemetry events that don't fit any other database tables.
- Adds a telemetry report when HTML is served for the first time in
`site.go`.
This commit is contained in:
Hugo Dutka
2025-01-31 13:55:46 +01:00
committed by GitHub
parent f6e990ed87
commit 2ace044e0b
21 changed files with 521 additions and 12 deletions
@@ -0,0 +1 @@
DROP TABLE telemetry_items;
@@ -0,0 +1,6 @@
CREATE TABLE telemetry_items (
key TEXT NOT NULL PRIMARY KEY,
value TEXT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
@@ -0,0 +1,4 @@
INSERT INTO
telemetry_items (key, value)
VALUES
('example_key', 'example_value');