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 upMarathon Service Discovery in Prometheus picks up only the first port of a task as target #2448
Comments
rohitChaware
referenced this issue
Feb 27, 2017
Closed
Changes to Marathon service discovery to consider all the ports of a task as targets #2450
This was referenced Mar 16, 2017
This comment has been minimized.
This comment has been minimized.
|
Fixed with #2506. |
grobie
closed this
Mar 18, 2017
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.
rohitChaware commentedFeb 24, 2017
•
edited
What did you do?
I am running Prometheus configured with Marathon service discovery in a docker container. I have an app running in Marathon which exposes more than 2 ports and I have /metrics available on a port(say X) exposed by the app which is not the first port listed in the app definition JSON file.
What did you expect to see?
Expected Prometheus to discover the app from Marathon, show the app with port X as an endpoint in targets and also show the endpoint's state as UP.
What did you see instead? Under which circumstances?
Prometheus discovers the app, shows the app with port which is listed first in the app definition JSON file(not X) as an endpoint and shows the state of the endpoint as DOWN.
Environment
System information:
Linux 4.4.0-36-generic x86_64
Prometheus version: Output of <prometheus -version> from the Prometheus container
prometheus, version 1.5.0 (branch: master, revision: d840f2c)
build user: root@a04ed5b536e3
build date: 20170123-13:56:24
go version: go1.7.4
Prometheus configuration file:
Possible resolution:
The function targetForTask() in the file 'discovery/marathon/marathon.go' returns only the first port of a task as target.
The function targetsForApp in the file 'discovery/marathon/marathon.go' can be modified, as below, to consider all the ports of a task as targets:
(Verified)With just the above modification, Prometheus shows all the ports of a task as endpoints under targets.
Attaching the file 'discovery/marathon/marathon.go' as a marathon.txt file(.go file not supported as attachment).