Skip to content

feat: make agent stats' cardinality configurable #12535

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Appeasing CI
Signed-off-by: Danny Kopping <danny@coder.com>
  • Loading branch information
dannykopping committed Mar 11, 2024
commit 661f5c24d856e85ee11cb7bd8c853a06918ec4dc
5 changes: 5 additions & 0 deletions cli/testdata/server-config.yaml.golden
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,11 @@ introspection:
# Collect database metrics (may increase charges for metrics storage).
# (default: false, type: bool)
collect_db_metrics: false
# When collecting agent stats, aggregate metrics by a given set of comma-separated
# labels to reduce cardinality. Accepted values are template_name, agent_name,
# username, workspace_name.
# (default: <unset>, type: string-array)
aggregate_agent_stats_by: []
pprof:
# Serve pprof metrics on the address defined by pprof address.
# (default: <unset>, type: bool)
Expand Down
4 changes: 2 additions & 2 deletions coderd/prometheusmetrics/aggregator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,6 @@ func TestUpdateMetrics_MetricsExpire(t *testing.T) {
}

func TestLabelsAggregation(t *testing.T) {
t.Parallel()

type statCollection struct {
labels prometheusmetrics.AgentMetricLabels
metrics []*agentproto.Stats_Metric
Expand Down Expand Up @@ -561,6 +559,8 @@ func TestLabelsAggregation(t *testing.T) {
}

for _, tc := range tests {
t.Parallel()

t.Run(tc.name, func(t *testing.T) {
// given
registry := prometheus.NewRegistry()
Expand Down