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 upKuberenetes SD scrapes all service ports, not just the one annotated #2507
Comments
This comment has been minimized.
This comment has been minimized.
|
Temporary workaround - set some other identifier on the exporter container, or the container/service port, then use an additional relabel config to filter out unwanted targets:
or...
or...
I don't really like having to do this though, since it makes the service discovery less dynamic and requires additional contrived config on the Kubernetes objects involved... The last example only works if you don't have any other non-metrics ports listening in the 9000-9999 range |
tux21b
referenced this issue
Mar 29, 2017
Closed
Discover multiple (but not all) Ports in a Kubernetes Pod #2545
This comment has been minimized.
This comment has been minimized.
kfox1111
commented
Apr 25, 2017
|
I've hit a similar issue with sidecars. Can prometheus.io/ports attribution feature be added thats value is a string encoded version of a list "[9100,9101]" and if specified that way, all other ports are ignored by the default scraper? This will still allow the previous behavior to function while eliminating the failures. |
brian-brazil
added
component/service discovery
kind/support
labels
Jul 7, 2017
brian-brazil
added
kind/question
and removed
kind/support
labels
Jul 14, 2017
This comment has been minimized.
This comment has been minimized.
|
Uage questions should be asked on https://groups.google.com/forum/#!forum/prometheus-users |
brian-brazil
closed this
Jul 14, 2017
This comment has been minimized.
This comment has been minimized.
dimpavloff
commented
Aug 3, 2017
|
@drewhemm we had a similar issue but for pods. Changing the regex to |
This comment has been minimized.
This comment has been minimized.
kfox1111
commented
Aug 3, 2017
|
which regex? would be nice if we could get it into github.com/kubernetes/charts/ stable/prometheus so it works right out of the box. |
This comment has been minimized.
This comment has been minimized.
dimpavloff
commented
Aug 4, 2017
|
@kfox1111 the regex is in the section rewriting the
I haven't tested this with the |
This comment has been minimized.
This comment has been minimized.
lainekendall
commented
Aug 17, 2018
•
|
I ran into this problem too. However, after reading the Prometheus Configuration docs it seems this is the intended behavior: |
This comment has been minimized.
This comment has been minimized.
navi86
commented
Sep 19, 2018
|
is it possible to get all nodePort value from kubernetes service for scrapping automatically? |
atomy
pushed a commit
to mlamm/amadeus-ws-client
that referenced
this issue
Nov 26, 2018
This comment has been minimized.
This comment has been minimized.
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. |
drewhemm commentedMar 17, 2017
I created an OpenShift Kubernetes service and annotated it as follows:
I expected to see in the Prometheus targets a single entry per scrape port per pod/container. Instead I see one target for each pod/container port, even though only 9101 is annotated. Even creating a separate service that lists only the scrape port:
Prometheus still tries to scrape from every port open to the pod/container.
I'm running OpenShift Enterprise 3.4 with Kubernetes version 1.4.0 and Prometheus version 1.5.2
System information:
Linux 3.10.0-514.6.1.el7.x86_64 x86_64
Prometheus configuration file: