mirror of
https://github.com/coder/coder.git
synced 2025-07-06 15:41:45 +00:00
* feat: Add anonymized telemetry to report product usage This adds a background service to report telemetry to a Coder server for usage data. There will be realtime event data sent in the future, but for now usage will report on a CRON. * Fix flake and requested changes * Add reporting options for setup * Add reporting for workspaces * Add resources as they are reported * Track API key usage * Ensure telemetry is tracked prior to exit
25 lines
466 B
SQL
25 lines
466 B
SQL
-- name: GetWorkspaceResourceByID :one
|
|
SELECT
|
|
*
|
|
FROM
|
|
workspace_resources
|
|
WHERE
|
|
id = $1;
|
|
|
|
-- name: GetWorkspaceResourcesByJobID :many
|
|
SELECT
|
|
*
|
|
FROM
|
|
workspace_resources
|
|
WHERE
|
|
job_id = $1;
|
|
|
|
-- name: GetWorkspaceResourcesCreatedAfter :many
|
|
SELECT * FROM workspace_resources WHERE created_at > $1;
|
|
|
|
-- name: InsertWorkspaceResource :one
|
|
INSERT INTO
|
|
workspace_resources (id, created_at, job_id, transition, type, name)
|
|
VALUES
|
|
($1, $2, $3, $4, $5, $6) RETURNING *;
|