feat: add flag to disable template insights (#20940)

Closes #20399 

To summarize the original commit messages:

- Do not log stats to the database.
- Return errors on the insight endpoints.
- Update the frontend to show those errors.
- Also fixes an issue with getting the user status count via codersdk,
since I added a test to ensure it was not disabled by this flag and it
was sending the wrong payload.
This commit is contained in:
Asher
2025-12-14 03:00:03 +00:00
committed by GitHub
parent b9f8295845
commit 27f0413347
19 changed files with 1615 additions and 979 deletions
+3
View File
@@ -518,6 +518,9 @@ curl -X GET http://coder-server:8080/api/v2/deployment/config \
"user": {}
}
},
"template_insights": {
"enable": true
},
"terms_of_service_url": "string",
"tls": {
"address": {
+21
View File
@@ -3208,6 +3208,9 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o
"user": {}
}
},
"template_insights": {
"enable": true
},
"terms_of_service_url": "string",
"tls": {
"address": {
@@ -3733,6 +3736,9 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o
"user": {}
}
},
"template_insights": {
"enable": true
},
"terms_of_service_url": "string",
"tls": {
"address": {
@@ -3842,6 +3848,7 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o
| `support` | [codersdk.SupportConfig](#codersdksupportconfig) | false | | |
| `swagger` | [codersdk.SwaggerConfig](#codersdkswaggerconfig) | false | | |
| `telemetry` | [codersdk.TelemetryConfig](#codersdktelemetryconfig) | false | | |
| `template_insights` | [codersdk.TemplateInsightsConfig](#codersdktemplateinsightsconfig) | false | | |
| `terms_of_service_url` | string | false | | |
| `tls` | [codersdk.TLSConfig](#codersdktlsconfig) | false | | |
| `trace` | [codersdk.TraceConfig](#codersdktraceconfig) | false | | |
@@ -8517,6 +8524,20 @@ Restarts will only happen on weekdays in this list on weeks which line up with W
| `role` | `admin` |
| `role` | `use` |
## codersdk.TemplateInsightsConfig
```json
{
"enable": true
}
```
### Properties
| Name | Type | Required | Restrictions | Description |
|----------|---------|----------|--------------|-------------|
| `enable` | boolean | false | | |
## codersdk.TemplateInsightsIntervalReport
```json