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

Also use consul tags as filter for service discovery #2285

Closed
flypenguin opened this Issue Dec 15, 2016 · 3 comments

Comments

Projects
None yet
2 participants
@flypenguin
Copy link

flypenguin commented Dec 15, 2016

Currently you can either scrape all services, or a list of certain services given by service name.

It would be really nice if you could also specify a tag filter, e.g. "prometheus_target", to use.

Current situation:

See Docs. Only consul service name is available for filtering.

Proposal for configuration:

# STATUS QUO
services:
  [ - <string> ]
# The string by which Consul tags are joined into the tag label.
[ tag_separator: <string> | default = , ]

# NEW ADDITION
tags:
  [ - <string> ]

Effect:

Should either scrape all services, or ...

  • if service name given: only services with the given names
  • if service tag list given: only services with the given tags attached
  • if both given: any combination of given service names and tag names

Rationale:

We have much more services registered in consul than we want to scrape (most of them don't even have scraping endpoints for prometheus available). So prometheus should not try to scrape them, and possibly list them as failed if it can't reach the scraping endpoint.

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Dec 15, 2016

@flypenguin

This comment has been minimized.

Copy link
Author

flypenguin commented Dec 15, 2016

oh cool :) . in that case thanks! (although it would be way more convenient the other way ;) )

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 24, 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 lock bot locked and limited conversation to collaborators Mar 24, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.