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

Function isIgnoredMetric

agent/metrics.go:132–141  ·  view source on GitHub ↗

isIgnoredMetric checks if the metric should be ignored, as Coder agent doesn't use related features. Expected metric families: magicsock_*, derp_*, tstun_*, netcheck_*, portmap_*, etc.

(metricName string)

Source from the content-addressed store, hash-verified

130// isIgnoredMetric checks if the metric should be ignored, as Coder agent doesn't use related features.
131// Expected metric families: magicsock_*, derp_*, tstun_*, netcheck_*, portmap_*, etc.
132func isIgnoredMetric(metricName string) bool {
133 if strings.HasPrefix(metricName, "dns_") ||
134 strings.HasPrefix(metricName, "controlclient_") ||
135 strings.HasPrefix(metricName, "peerapi_") ||
136 strings.HasPrefix(metricName, "profiles_") ||
137 strings.HasPrefix(metricName, "tstun_") {
138 return true
139 }
140 return false
141}
142
143func asMetricType(typ clientmetric.Type) proto.Stats_Metric_Type {
144 switch typ {

Callers 1

collectMetricsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected