Skip to main content

Prometheus tag label feature is broken

Opening here since I'm not really sure where to open it on GH.

The tag label feature of Prometheus is awesome but broken in some specific cases.

The feature allows to split a tag on ":" but I suspect the splitting is done by taking only the first two elements from an execution of split(':'). That won't work if multiple ":" are contained in the string.

For instance, if we pass the tag url:https://foo.com, the resulting Prometheus label-value would be url:https, which is clearly wrong.

The string should be split only on the first occurrence of ":" so that label values such as urls can be correctly exposed by the Prometheus endpoint.

Status: Completed4 comments

Log in to comment and vote

Comments4

  • Tim Nolet

    •

    Sep 20, 2023

    This behaviour is now fixed in our upcoming V2 Prometheus endpoint. We opted to keep the behaviour the same in the V1 endpoint to not unintentionally break any scraper setups. CC @BaCaRoZzo

  • Rikard Nilsson

    •

    Sep 11, 2023

    Hi,

    Thanks for reporting this! We've confirmed the problem and will be addressing it.

    Let me know if you have any followup questions.

    Regards,

    Rikard