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

labeldrop is not working #3991

Closed
XooR opened this Issue Mar 20, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@XooR
Copy link

XooR commented Mar 20, 2018

What did you do?

I have set relabel for redis exporter which have extra: addr and alias which I want to remove but with relabel configuration metric stay as it is:

    relabel_configs:
    - action: labeldrop
      regex: 'addr'
    - action: labeldrop
      regex: 'alias'

What did you expect to see?

With metric from exporter:

redis_aof_current_rewrite_duration_sec{addr="redis://localhost:6379",alias=""} -1

To get this metric in prometheus:

redis_aof_current_rewrite_duration_sec{instance="unique-hostname"} -1

What did you see instead? Under which circumstances?

Labels are kept as they are.

Environment

  • System information:

Linux 3.10.0-693.17.1.el7.x86_64 x86_64

  • Prometheus version:

I tried with prometheus 2.0.0 and 2.2.1 and same thing happen.

prometheus, version 2.2.1 (branch: HEAD, revision: bc6058c81272a8d938c05e75607371284236aadc)
  build user:       root@149e5b3f0829
  build date:       20180314-14:15:45
  go version:       go1.10
  • Prometheus configuration file:
global:
  scrape_interval: '15s'
  scrape_timeout: '10s'
  evaluation_interval: '1m'

rule_files: []

scrape_configs:
  - consul_sd_configs:
    - datacenter: dc1
      server: localhost:8500
      services:
      - exporter-redis
    job_name: redis
    relabel_configs:
    - replacement: $1
      separator: ':'
      source_labels:
      - __meta_consul_node
      - __meta_consul_service_port
      target_label: instance
    - regex: .*,cluster=([^,]+),.*
      replacement: $1
      source_labels:
      - __meta_consul_tags
      target_label: cluster
    - action: labeldrop
      regex: 'addr'
    - action: labeldrop
      regex: 'alias'

alerting:
  alert_relabel_configs:
    []
  alertmanagers:
    []

remote_write:
  []

remote_read:
  []
@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Mar 20, 2018

https://www.robustperception.io/relabel_configs-vs-metric_relabel_configs/

It makes more sense to ask questions like this on the prometheus-users mailing list rather than in a GitHub issue. On the mailing list, more people are available to potentially respond to your question, and the whole community can benefit from the answers provided.

@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.