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

[consul] Make max number of catalog services configurable #2383

Closed
wants to merge 1 commit into from
Closed

[consul] Make max number of catalog services configurable #2383

wants to merge 1 commit into from

Conversation

antifuchs
Copy link
Contributor

Currently, the consul check cuts off the list of catalogued services that it interrogates at 50, even when using a whitelist to pick out the most important ones. (Which is slightly frustrating if you have more than 50 important services!)

This PR adds a new consul.yaml configuration key which allows setting that limit to be higher, lower, or entirely non-existent (by setting it to be <1).

The configuration key is documented in consul.yaml.example (and I've taken the liberty of adjusting the config key docs for the whitelist to not imply that the whitelist can be used query for more than 50 services).

Testing

I have added a test and a new configuration key; tests pass locally, hope that Travis is happy too. We tried this out on a consul cluster running ~160 services, and it picks up the configured number of services there.

This change adds a mechanism to increase the number of consul services
that can be queries by the agent: Currently, without this change, the
culling mechanism in consul.py would remove any services (even
whitelisted ones) in excess of the first 50. With this change, you can
set `max_services` in consul.yaml, per consul agent.

Further, to optionally remove any limit on the number of services, this
makes it possible to set `max_services` to a negative number disable
service culling entirely.

This change also adds tests for the new negative-maximum behavior and
straightens out the docs in consul.yaml.example.
@hkaj
Copy link
Member

hkaj commented Mar 24, 2016

Hi @antifuchs and thanks for opening this PR! This seems like a legit use case.
We'll review and test this PR shortly.

@hkaj hkaj added this to the 5.8.0 milestone Mar 24, 2016
@hkaj hkaj added the checks label Mar 24, 2016
@hkaj hkaj modified the milestones: Triage, 5.8.0 Mar 24, 2016
@olivielpeau
Copy link
Member

It appears that this has been addressed in DataDog/integrations-core#140 (didn't realize that the present PR existed when I merged the other one), so I'm going to close this PR.
Thanks @antifuchs!

@olivielpeau olivielpeau closed this May 9, 2017
@asf-stripe asf-stripe deleted the asf-configurable-consul-service-limit branch May 9, 2017 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants