Skip to content

Configurable label separator char replacements #29

@ktoso

Description

@ktoso

Feature Request

Offer some configuration to replace characters in labels, i.e. when people in their libraries have Counter("things.specificThing.thingsToCound") that's an invalid label for prometheus. So we should allow some labelSubstitutions = [".": "_"] or perhaps some other way?

Motivation Behind Feature

Libraries which offer metrics via Swift Metrics generally "should not know" details about formats of labels that any specific backends require. This is mostly about the use of . (prom crashes on those, other backends like those) as separator vs using _ (prom likes those, other backends dislike those).

Alternatives or Workarounds

  • No go alternative: force all possible libraries to avoid . 😉

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions