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

Use job and __param_<name> labels cause double instance in report #1567

Closed
stimg opened this Issue Apr 21, 2016 · 6 comments

Comments

Projects
None yet
2 participants
@stimg
Copy link

stimg commented Apr 21, 2016

v. 0.17.0
Using config like this

[{
    "targets": ["192.168.0.2"],
    "labels": {
        "job": "my_job",
        "__param_module": "my_module",
    }
}]

in the targets file "my_job.json'" cause creation of two instances with the same parameters in the same job in the Prometheus metrics report. Workaround: delete job label.

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Apr 21, 2016

Can you share your prometheus.yml?

@stimg

This comment has been minimized.

Copy link
Author

stimg commented Apr 21, 2016

global:
   scrape_interval:     15s # By default, scrape targets every 15 seconds.
   evaluation_interval: 15s # By default, scrape targets every 15 seconds.

rule_files:
   - 'rules/*.rule'
   - 'rules/s3/*.rule'

scrape_configs:
...
  - job_name: 'dns_exporter_snmp'
    file_sd_configs:
    - names: ['/opt/prometheus/tgroups/snmp*_targets.json']
    relabel_configs:
      - source_labels: [__address__]
        regex: (.*?)(:80)?
        target_label: __param_address
        replacement: ${1}
      - source_labels: [__param_address]
        regex: (.*)
        target_label: instance
        replacement: ${1}
      - source_labels: []
        regex: .*
        target_label: __address__
        replacement: 10.200.18.51:9116  # SNMP exporter.

UPDATE: despite I delete job label, Prometheus creates two jobs for the target:

  1. job_name: dns_exporter_snmp
  2. job_name: my_job

@brian-brazil brian-brazil removed the question label Apr 21, 2016

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Apr 21, 2016

You're not doing anything odd, so that sounds like a bug that we'll need to verify and look in to.

I presume there's no other files matching that glob? That could explain it.

Does this also happen with 0.18.0?

@stimg

This comment has been minimized.

Copy link
Author

stimg commented Apr 21, 2016

uiuiui, you're right! there was another definition for this target hardcoded in the config. sorry.

@stimg stimg closed this Apr 21, 2016

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Apr 21, 2016

No problem.

@brian-brazil brian-brazil added question and removed bug labels Apr 21, 2016

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 24, 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 24, 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.