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:
Hugo Dutka
2024-11-16 21:56:19 +01:00
committed by GitHub
parent 968c52bc36
commit aa0dc2daa1
35 changed files with 1633 additions and 412 deletions
+432 -329
View File
File diff suppressed because it is too large Load Diff
+8
View File
@@ -204,6 +204,13 @@ message Resource {
string icon = 6;
string instance_type = 7;
int32 daily_cost = 8;
string module_path = 9;
}
message Module {
string source = 1;
string version = 2;
string key = 3;
}
// WorkspaceTransition is the desired outcome of a build
@@ -271,6 +278,7 @@ message PlanComplete {
repeated RichParameter parameters = 3;
repeated ExternalAuthProviderResource external_auth_providers = 4;
repeated Timing timings = 6;
repeated Module modules = 7;
}
// ApplyRequest asks the provisioner to apply the changes. Apply MUST be preceded by a successful plan request/response