not a valid label name when relabeling Kubernetes node labels

824 views
Skip to first unread message

mosh...@gmail.com

unread,
May 9, 2017, 9:57:39 AM5/9/17
to Prometheus Users
Hi,

When I try to relabel Kubernetes  node label like beta.kubernetes.io/os I get "is not a valid label name" error.

Is there any way to workaround this?

Thanks!

Moshe

Julius Volz

unread,
May 9, 2017, 10:48:14 AM5/9/17
to mosh...@gmail.com, Prometheus Users
If you are talking about the "__meta_kubernetes_node_label_<labelname>" labels: Prometheus does not support dots or underscores in label names, so they get converted to underscores. Like "beta_kubernetes_io_os".

I just noticed that we do not mention this conversion anywhere on https://prometheus.io/docs/operating/configuration/#<kubernetes_sd_config> - something we should fix.


--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/dc0b9cf9-8da9-47b2-b833-7ffbfd1c3b24%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Moshe Nadler

unread,
May 10, 2017, 1:37:57 AM5/10/17
to Julius Volz, Prometheus Users
Hi,

You are correct. Replacing beta.kubernetes.io/instance-type with beta_kubernetes_io_instance_type did the trick. 
So the configuration:
 relabel_configs:
      - source_labels: [__meta_kubernetes_node_label_beta_kubernetes_io_instance_type]
        target_label: kubernetes_instance_type

is working.

Thanks!

Moshe

On Tue, May 9, 2017 at 5:48 PM Julius Volz <juliu...@gmail.com> wrote:
If you are talking about the "__meta_kubernetes_node_label_<labelname>" labels: Prometheus does not support dots or underscores in label names, so they get converted to underscores. Like "beta_kubernetes_io_os".

I just noticed that we do not mention this conversion anywhere on https://prometheus.io/docs/operating/configuration/#<kubernetes_sd_config> - something we should fix.


On Tue, May 9, 2017 at 3:57 PM, <mosh...@gmail.com> wrote:
Hi,

When I try to relabel Kubernetes  node label like beta.kubernetes.io/os I get "is not a valid label name" error.

Is there any way to workaround this?

Thanks!

Moshe

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.

To post to this group, send email to promethe...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages