Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid target labelnames? #3850

Closed
brian-brazil opened this Issue Feb 15, 2018 · 7 comments

Comments

Projects
None yet
4 participants
@brian-brazil
Copy link
Member

brian-brazil commented Feb 15, 2018

Per https://groups.google.com/forum/#!topic/prometheus-users/4JIBSa1zyDA it appears that a user on 2.0.0 has managed to have target labels containing hyphens in the label name. This indicates a lack of validation somewhere.

@krasi-georgiev

This comment has been minimized.

Copy link
Member

krasi-georgiev commented Feb 16, 2018

DIBS

should this be checked in the parser or somewhere in the ingestion path?

@brian-brazil

This comment has been minimized.

Copy link
Member Author

brian-brazil commented Feb 16, 2018

It's probably that the sanitization I added around service discovery was lost.

@krasi-georgiev

This comment has been minimized.

Copy link
Member

krasi-georgiev commented Feb 16, 2018

that would mean I broke it 😳 , do you remember where was this piece to save me some digging?

@maximilianvw

This comment has been minimized.

Copy link

maximilianvw commented Feb 19, 2018

Sorry guys I was offline for the weekend. I reported this bug via the mailing list. My scrape config was as follows:

scrape_configs:
- job_name: prometheus
  scrape_interval: 10s
  scrape_timeout: 10s
  static_configs:
  - targets:
    - localhost:9090
- job_name: openstack
  openstack_sd_configs:
  - identity_endpoint: xxx
    password: xxx
    project_name: xxx
    role: instance
    username: xxx
  relabel_configs:
  - action: keep
    regex: ACTIVE
    source_labels:
    - __meta_openstack_instance_status
  - action: keep
    regex: 'true'
    source_labels:
    - __meta_openstack_tag_service_nodeexporter
  - regex: ([^:]+)(?::\d+)?
    replacement: $1:9100
    source_labels:
    - __address__
    target_label: __address__
  - source_labels:
    - __meta_openstack_private_ip
    target_label: private_ip
  - source_labels:
    - __meta_openstack_public_ip
    target_label: floating_ip
  - source_labels:
    - __meta_openstack_instance_name
    target_label: instance
  - action: labelmap
    regex: __meta_openstack_tag_service_(.+)
    replacement: service-$1

Let me know if you need more details.

@brian-brazil

This comment has been minimized.

Copy link
Member Author

brian-brazil commented Feb 19, 2018

So the issue here is around that last labelmap.

@simonpasquier

This comment has been minimized.

Copy link
Member

simonpasquier commented Feb 20, 2018

thanks @maximilianvw I think I've spotted the place. Will send a PR.

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 22, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 22, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.