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 upsplitting kubernetes service ip with regex #2971
Comments
bahho
changed the title
kubernetes pod ip
splitting kubernetes pod ip with regex
Jul 19, 2017
bahho
changed the title
splitting kubernetes pod ip with regex
splitting kubernetes service ip with regex
Jul 19, 2017
This comment has been minimized.
This comment has been minimized.
|
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. |
brian-brazil
closed this
Jul 24, 2017
This comment has been minimized.
This comment has been minimized.
|
Thanks for the info. I'll do that. |
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 23, 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
bot
locked and limited conversation to collaborators
Mar 23, 2019
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
bahho commentedJul 19, 2017
•
edited
What did you do?
I have pods with jmx-exporter. I would like to scrape only the exposed ports.
I do use the annotation "prometheus.io/port" but to be that only the exposed port is scraped in case some pods/services dont have the annotation. To do so I am trying to replace the ports in the addresses that I get from the service endpoints.
I have multiple ports exposed in the pods so that with the below config I get endpoints in prometheus like
http://10.131.0.2:1111 http://10.131.0.2:2222 http://10.131.0.2:3333 http://10.131.0.2:4444I would like to split up the pod IP and append the port number I would like to scrape.
I don't seem to be able to make use of the regexes...
What I need is something like
where ${1} is the service IP and 2222 is the port I want.
Can anybody help me with that?
Environment
OpenShift
Prometheus version:
1.6.2
Prometheus configuration file: