cleanLabelValue cleans a label value for use in metric keys
(value string)
| 203 | |
| 204 | // cleanLabelValue cleans a label value for use in metric keys |
| 205 | func 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] |
| 219 | func (c *Collector) createChartFromContext(ctx any, instanceID string, instance *Instance) *collectorapi.Chart { |
no outgoing calls
no test coverage detected
searching dependent graphs…