Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upEC2 Service Discovery Filter Not Working Correctly #5227
Comments
This comment has been minimized.
This comment has been minimized.
|
Which version of Prometheus do you run? Can you share a screenshot of the service discovery page? |
This comment has been minimized.
This comment has been minimized.
|
We're running v2.7.1 of Prometheus. |
simonpasquier
added
the
component/service discovery
label
Feb 18, 2019
This comment has been minimized.
This comment has been minimized.
|
Is your - job_name: 'linux'
ec2_sd_configs:
- region: 'eu-west-1'
- port: 9100
- filters:
- name: tag:PrometheusMonitoring
values:
- '*Node*'
- '*node*'If yes, it creates 3 SD instances and I suspect that you want this instead: - job_name: 'linux'
ec2_sd_configs:
- region: 'eu-west-1'
port: 9100
filters:
- name: tag:PrometheusMonitoring
values:
- '*Node*'
- '*node*' |
This comment has been minimized.
This comment has been minimized.
|
That 's fixed it. |
simonpasquier
closed this
Feb 18, 2019
This comment has been minimized.
This comment has been minimized.
|
Hmm, we're meant to de-duplicate identical instances post relabelling within a scrape config. Was that not happening? |
This comment has been minimized.
This comment has been minimized.
|
All of the instances in that job were listed twice, so I don't believe it was here |
This comment has been minimized.
This comment has been minimized.
|
Actually one set would have had port 9100, and two sets 80 so 2x is right. |
james-miller commentedFeb 18, 2019
•
edited
Proposal
Use case. Why is this important?
I’m looking to use AWS EC2 tags to indicate which exporters are installed and target the correct ports. This will allow us to easily enable new metrics and standardise our Prometheus configuration using a tag like "PrometheusMonitoring".
The documentation suggests that this is currently possible using filters but this does not seem to function as intended.
Bug Report
What did you do?
Added the following job to my scrape config:
What did you expect to see?
One active target to be displayed in the 'Linux' job on the Service Discovery page. This should be just the instance with the 'PrometheusMonitoring' tag key and 'SQL, Node, Squid' in the tag value.
What did you see instead? Under which circumstances?
All of the instances in the AWS account were picked up twice by that job on the service discovery page.
Also worth noting that the following AWS command works perfectly:
Environment
System information:
Linux 3.10.0-862.14.4.el7.x86_64 x86_64
Docker version 18.09.1, build 4c52b90
Prometheus version:
prom/prometheus:v2.7.1
Prometheus configuration file: