Skip to main content

SanitizeMetricName

SanitizeMetricName ensures the generates metric name is compatible with the underlying prometheus library.

def SanitizeMetricName(
name: string
) - > string

Ensures the generated metric name is compatible with the underlying Prometheus library. This function processes the input string to replace unsupported characters and maintain compatibility with Prometheus naming conventions.

Parameters

NameTypeDescription
namestringThe original metric name string to be sanitized.

Returns

TypeDescription
stringThe sanitized metric name, suitable for use with Prometheus.