Skip to content

fix: escape '/' in Docker container label keys for Prometheus exposition - #440

Open
jaimeib wants to merge 1 commit into
hubblo-org:devfrom
IFCA-Advanced-Computing:fix/container-label-slash-escaping
Open

jaimeib wants to merge 1 commit into
hubblo-org:devfrom
IFCA-Advanced-Computing:fix/container-label-slash-escaping

Conversation

@jaimeib

@jaimeib jaimeib commented Sep 11, 2026

Copy link
Copy Markdown

Fixes #439

Container labels with a / in the key (e.g. Kubernetes/OCI-style namespaced labels like nuclio.io/function-spec) produce an invalid Prometheus label name such as container_label_nuclio_io/function_spec, since a raw / isn't valid in a Prometheus label name.

This breaks parsing of the whole /metrics response for scrapers that enforce the exposition format strictly (observed with Grafana Alloy), losing every metric from that target, not just the offending one.

The fix adds / to the existing escape_list alongside -, ., : and in ProcessTracker's container label handling, so the key becomes container_label_nuclio_io_function_spec — a single-line change.

Container labels with a '/' in the key (e.g. Kubernetes/OCI-style
namespaced labels like nuclio.io/function-spec) produce an invalid
Prometheus label name such as container_label_nuclio_io/function_spec.
A raw '/' is not valid in a Prometheus label name, so this breaks parsing
of the whole /metrics response for scrapers that enforce the exposition
format strictly (observed with Grafana Alloy), losing every metric from
that target, not just the offending one.

Add '/' to the existing escape_list alongside '-', '.', ':' and ' '.
@jaimeib
jaimeib force-pushed the fix/container-label-slash-escaping branch from f185c70 to cec9162 Compare September 19, 2026 14:25
@jaimeib
jaimeib changed the base branch from main to dev September 19, 2026 14:25

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docker container labels with '/' in the key break Prometheus exposition parsing entirely

1 participant