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

Expose containerPort as __meta label for marathon_sd_config #4310

Open
bforbis opened this Issue Jun 25, 2018 · 0 comments

Comments

Projects
None yet
2 participants
@bforbis
Copy link

bforbis commented Jun 25, 2018

I would like to build out a marathon_sd_config that can scape a Marathon DC/OS cluster for all instances of a particular docker image that I have built and handed off as a tool to other users to deploy themselves within the cluster.

The problem is that this docker image has more than one port, so there is not an easy deterministic way for me to find which port is the port it is serving metrics from. It seems that the recommended way is for users to set a portDefinitions or portMappings label in their marathon app definition and then prometheus should filter on these labels using relabel_configs, however that relies on the users deploying that docker image to follow a standard labeling convention. This means if a user doesn't follow this convention, my discovery will fail to work.

On the other hand, if the app's container port was exposed as a __meta label (which I know is always set to 8080), I could just filter on that information.

relabel_configs:
- source_labels: [__meta_marathon_image, __meta_marathon_container_port ]
  regex: myImageName;8080
  action: keep
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.