feat: make agent stats' cardinality configurable (#12468)

Closes #12221
This commit is contained in:
Danny Kopping
2024-03-11 16:04:08 +02:00
committed by GitHub
parent 0647ec1960
commit 21d1873d97
18 changed files with 747 additions and 85 deletions
+1
View File
@@ -317,6 +317,7 @@ curl -X GET http://coder-server:8080/api/v2/deployment/config \
"host": "string",
"port": "string"
},
"aggregate_agent_stats_by": ["string"],
"collect_agent_stats": true,
"collect_db_metrics": true,
"enable": true
+10 -6
View File
@@ -2786,6 +2786,7 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
"host": "string",
"port": "string"
},
"aggregate_agent_stats_by": ["string"],
"collect_agent_stats": true,
"collect_db_metrics": true,
"enable": true
@@ -3154,6 +3155,7 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
"host": "string",
"port": "string"
},
"aggregate_agent_stats_by": ["string"],
"collect_agent_stats": true,
"collect_db_metrics": true,
"enable": true
@@ -4783,6 +4785,7 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
"host": "string",
"port": "string"
},
"aggregate_agent_stats_by": ["string"],
"collect_agent_stats": true,
"collect_db_metrics": true,
"enable": true
@@ -4791,12 +4794,13 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
### Properties
| Name | Type | Required | Restrictions | Description |
| --------------------- | ------------------------------------ | -------- | ------------ | ----------- |
| `address` | [clibase.HostPort](#clibasehostport) | false | | |
| `collect_agent_stats` | boolean | false | | |
| `collect_db_metrics` | boolean | false | | |
| `enable` | boolean | false | | |
| Name | Type | Required | Restrictions | Description |
| -------------------------- | ------------------------------------ | -------- | ------------ | ----------- |
| `address` | [clibase.HostPort](#clibasehostport) | false | | |
| `aggregate_agent_stats_by` | array of string | false | | |
| `collect_agent_stats` | boolean | false | | |
| `collect_db_metrics` | boolean | false | | |
| `enable` | boolean | false | | |
## codersdk.ProvisionerConfig
+11
View File
@@ -742,6 +742,17 @@ URL of a PostgreSQL database. If empty, PostgreSQL binaries will be downloaded f
The bind address to serve prometheus metrics.
### --prometheus-aggregate-agent-stats-by
| | |
| ----------- | -------------------------------------------------------------- |
| Type | <code>string-array</code> |
| Environment | <code>$CODER_PROMETHEUS_AGGREGATE_AGENT_STATS_BY</code> |
| YAML | <code>introspection.prometheus.aggregate_agent_stats_by</code> |
| Default | <code>agent_name,template_name,username,workspace_name</code> |
When collecting agent stats, aggregate metrics by a given set of comma-separated labels to reduce cardinality. Accepted values are agent_name, template_name, username, workspace_name.
### --prometheus-collect-agent-stats
| | |