chore: rename flag to disable template insights (#21329)

Because this affects more than just the template insights
page (specifically it also affects the deployment stats endpoint which
is shown on bottom bar and Prometheus), the group is being renamed
generically to just "stats collection".  In the future if we need to
affect the other stats we can put those options here.

Then, because this change only affects a portion of stats, specifically
usage stats like connection and application time, bytes sent, etc, add a
new sub-group called "usage stats".

Then finally add back the "enable" flag.  This also gives us a place to
one day place an "anonymize" flag if we need to go that route.
This commit is contained in:
Asher
2026-01-05 11:44:06 -09:00
committed by GitHub
parent 5691d38db7
commit 4a97df3768
12 changed files with 154 additions and 103 deletions
+5 -3
View File
@@ -491,6 +491,11 @@ curl -X GET http://coder-server:8080/api/v2/deployment/config \
"refresh_default_duration": 0
},
"ssh_keygen_algorithm": "string",
"stats_collection": {
"usage_stats": {
"enable": true
}
},
"strict_transport_security": 0,
"strict_transport_security_options": [
"string"
@@ -527,9 +532,6 @@ curl -X GET http://coder-server:8080/api/v2/deployment/config \
"user": {}
}
},
"template_insights": {
"enable": true
},
"terms_of_service_url": "string",
"tls": {
"address": {
+41 -21
View File
@@ -2951,6 +2951,11 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o
"refresh_default_duration": 0
},
"ssh_keygen_algorithm": "string",
"stats_collection": {
"usage_stats": {
"enable": true
}
},
"strict_transport_security": 0,
"strict_transport_security_options": [
"string"
@@ -2987,9 +2992,6 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o
"user": {}
}
},
"template_insights": {
"enable": true
},
"terms_of_service_url": "string",
"tls": {
"address": {
@@ -3488,6 +3490,11 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o
"refresh_default_duration": 0
},
"ssh_keygen_algorithm": "string",
"stats_collection": {
"usage_stats": {
"enable": true
}
},
"strict_transport_security": 0,
"strict_transport_security_options": [
"string"
@@ -3524,9 +3531,6 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o
"user": {}
}
},
"template_insights": {
"enable": true
},
"terms_of_service_url": "string",
"tls": {
"address": {
@@ -3631,12 +3635,12 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o
| `scim_api_key` | string | false | | |
| `session_lifetime` | [codersdk.SessionLifetime](#codersdksessionlifetime) | false | | |
| `ssh_keygen_algorithm` | string | false | | |
| `stats_collection` | [codersdk.StatsCollectionConfig](#codersdkstatscollectionconfig) | false | | |
| `strict_transport_security` | integer | false | | |
| `strict_transport_security_options` | array of string | false | | |
| `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 | | |
@@ -7445,6 +7449,22 @@ Only certain features set these fields: - FeatureManagedAgentLimit|
| `name` | string | false | | |
| `organization_id` | string | false | | |
## codersdk.StatsCollectionConfig
```json
{
"usage_stats": {
"enable": true
}
}
```
### Properties
| Name | Type | Required | Restrictions | Description |
|---------------|--------------------------------------------------------|----------|--------------|-------------|
| `usage_stats` | [codersdk.UsageStatsConfig](#codersdkusagestatsconfig) | false | | |
## codersdk.SupportConfig
```json
@@ -8177,20 +8197,6 @@ Restarts will only happen on weekdays in this list on weeks which line up with W
|----------|----------------|
| `role` | `admin`, `use` |
## codersdk.TemplateInsightsConfig
```json
{
"enable": true
}
```
### Properties
| Name | Type | Required | Restrictions | Description |
|----------|---------|----------|--------------|-------------|
| `enable` | boolean | false | | |
## codersdk.TemplateInsightsIntervalReport
```json
@@ -9260,6 +9266,20 @@ If the schedule is empty, the user will be updated to use the default schedule.|
| `issued_at` | string | false | | |
| `start` | string | false | | |
## codersdk.UsageStatsConfig
```json
{
"enable": true
}
```
### Properties
| Name | Type | Required | Restrictions | Description |
|----------|---------|----------|--------------|-------------|
| `enable` | boolean | false | | |
## codersdk.User
```json
+8 -8
View File
@@ -269,16 +269,16 @@ URL to fetch a DERP mapping on startup. See: https://tailscale.com/kb/1118/custo
Path to read a DERP mapping from. See: https://tailscale.com/kb/1118/custom-derp-servers/.
### --template-insights-enable
### --stats-collection-usage-stats-enable
| | |
|-------------|----------------------------------------------------|
| Type | <code>bool</code> |
| Environment | <code>$CODER_TEMPLATE_INSIGHTS_ENABLE</code> |
| YAML | <code>introspection.templateInsights.enable</code> |
| Default | <code>true</code> |
| | |
|-------------|--------------------------------------------------------------|
| Type | <code>bool</code> |
| Environment | <code>$CODER_STATS_COLLECTION_USAGE_STATS_ENABLE</code> |
| YAML | <code>introspection.statsCollection.usageStats.enable</code> |
| Default | <code>true</code> |
Enable the collection and display of template insights along with the associated API endpoints. This will also enable aggregating these insights into daily active users, application usage, and transmission rates for overall deployment stats. When disabled, these values will be zero, which will also affect what the bottom deployment overview bar displays. Disabling will also prevent Prometheus collection of these values.
Enable the collection of application and workspace usage along with the associated API endpoints and the template insights page. Disabling this will also disable traffic and connection insights in the deployment stats shown to admins in the bottom bar of the Coder UI, and will prevent Prometheus collection of these values.
### --prometheus-enable