| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
System.Metrics.Prometheus.MetricId
Documentation
Construct with makeName to ensure that names use only valid characters
Instances
| Monoid Labels Source # | |
| Semigroup Labels Source # | |
| Show Labels Source # | |
| Eq Labels Source # | |
| Ord Labels Source # | |
Defined in System.Metrics.Prometheus.MetricId | |
Instances
| Show MetricId Source # | |
| Eq MetricId Source # | |
| Ord MetricId Source # | |
Defined in System.Metrics.Prometheus.MetricId | |
makeValid :: Text -> Text Source #
Make the input match the regex [a-zA-Z_][a-zA-Z0-9_] which
defines valid metric and label names, according to
https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels
Replace invalid characters with _ and add a leading _ if the
first character is only valid as a later character.