MCPcopy Create free account
hub / github.com/netdata/netdata / cleanLabelValue

Function cleanLabelValue

src/go/plugin/ibm.d/framework/collector.go:205–216  ·  view source on GitHub ↗

cleanLabelValue cleans a label value for use in metric keys

(value string)

Source from the content-addressed store, hash-verified

203
204// cleanLabelValue cleans a label value for use in metric keys
205func cleanLabelValue(value string) string {
206 // Replace problematic characters
207 r := strings.NewReplacer(
208 " ", "_",
209 ".", "_",
210 "-", "_",
211 "/", "_",
212 ":", "_",
213 "=", "_",
214 )
215 return strings.ToLower(r.Replace(value))
216}
217
218// createChartFromContext creates a go.d chart from a Context[T]
219func (c *Collector) createChartFromContext(ctx any, instanceID string, instance *Instance) *collectorapi.Chart {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…