MCPcopy Index your code
hub / github.com/coder/coder / filterAcceptableAgentLabels

Function filterAcceptableAgentLabels

coderd/prometheusmetrics/prometheusmetrics.go:680–689  ·  view source on GitHub ↗

filterAcceptableAgentLabels handles a slightly messy situation whereby `prometheus-aggregate-agent-stats-by` can control on which labels agent stats are aggregated, but for these specific metrics in this file there is no `template` label value, and therefore we have to exclude it from the list of ac

(labels []string)

Source from the content-addressed store, hash-verified

678// which labels agent stats are aggregated, but for these specific metrics in this file there is no `template` label value,
679// and therefore we have to exclude it from the list of acceptable labels.
680func filterAcceptableAgentLabels(labels []string) []string {
681 out := make([]string, 0, len(labels))
682 for _, label := range labels {
683 if label != agentmetrics.LabelTemplateName {
684 out = append(out, label)
685 }
686 }
687
688 return out
689}

Callers 2

AgentStatsFunction · 0.85

Calls

no outgoing calls

Tested by 1