mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
chore: track terraform modules in telemetry (#15450)
Addresses https://github.com/coder/nexus/issues/35. This PR: - Adds a `workspace_modules` table to track modules used by the Terraform provisioner in provisioner jobs. - Adds a `module_path` column to the `workspace_resources` table, allowing to identify which module a resource originates from. - Starts pushing this new information into telemetry. For the person reviewing this PR, do not fret about the 1,500 new lines - ~1,000 of them are auto-generated.
This commit is contained in:
16
coderd/database/queries/workspacemodules.sql
Normal file
16
coderd/database/queries/workspacemodules.sql
Normal file
@ -0,0 +1,16 @@
|
||||
-- name: InsertWorkspaceModule :one
|
||||
INSERT INTO
|
||||
workspace_modules (id, job_id, transition, source, version, key, created_at)
|
||||
VALUES
|
||||
($1, $2, $3, $4, $5, $6, $7) RETURNING *;
|
||||
|
||||
-- name: GetWorkspaceModulesByJobID :many
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
workspace_modules
|
||||
WHERE
|
||||
job_id = $1;
|
||||
|
||||
-- name: GetWorkspaceModulesCreatedAfter :many
|
||||
SELECT * FROM workspace_modules WHERE created_at > $1;
|
@ -27,9 +27,9 @@ SELECT * FROM workspace_resources WHERE created_at > $1;
|
||||
|
||||
-- name: InsertWorkspaceResource :one
|
||||
INSERT INTO
|
||||
workspace_resources (id, created_at, job_id, transition, type, name, hide, icon, instance_type, daily_cost)
|
||||
workspace_resources (id, created_at, job_id, transition, type, name, hide, icon, instance_type, daily_cost, module_path)
|
||||
VALUES
|
||||
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING *;
|
||||
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) RETURNING *;
|
||||
|
||||
-- name: GetWorkspaceResourceMetadataByResourceIDs :many
|
||||
SELECT
|
||||
|
Reference in New Issue
Block a user