swift-server / swift-prometheus

Prometheus client library for Swift

Home Page:https://swiftpackageindex.com/swift-server/swift-prometheus

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add dimension name sanitizer

vojtarylko opened this issue · comments

Feature Request

Add dimension name sanitizer along already existing LabelSanitizer.

Motivation Behind Feature

Dimension names are limited by Prometheus:

may contain ASCII letters, numbers, as well as underscores. They must match the regex [a-zA-Z_][a-zA-Z0-9_]*

names beginning with __ are reserved for internal use.

Note: Dimension values may contain any Unicode characters.
Note: The metric name (sanitized by LabelSanitizer) follows different rules ([a-zA-Z_:][a-zA-Z0-9_:]*).

The reasoning behind this feature is same as in the #29.

Would you send in a PR for this @vojtarylko ? Thanks!