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

WIP: Add Consul Service discovery and Dockerize tool #3

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

saswatamcode
Copy link
Member

@saswatamcode saswatamcode commented Nov 4, 2021

This PR adds an initial implementation of Consul service discovery for Thanos Stores. It makes heavy use of prometheus custom-sd example.

PR also Dockerizes this tool and includes a script to run a test setup using Consul which demonstrates Service Discovery using thanos-sd-sidecar which only selects Thanos Store services from services advertised by Consul. It does this using store.Info() gRPC call.

Steps to run POC setup:

  • Checkout add-disc branch after cloning.
  • Run make run-consul-setup which will build thanos-sd-sidecar docker image and setup other containers. (Might need to add -u root \ flag in setup.sh from Prometheus docker containers, based on env)
  • Check if 9 containers are up (3 Prometheus, 3 Thanos Sidecar, 1 Consul, 1 thanos-sd-sidecar, 1 Thanos Querier)
  • Visit Thanos querier at http://localhost:29090/stores and Consul UI at http://localhost:8500/ui
  • Curl http://localhost:8000/targets to get targets in Prometheus HTTP SD format
  • Run make teardown-consul-setup to teardown entire setup

TODOs:

  • Make setup script cleaner.
  • Add tests.
  • Make Consul implementation similar to current one in prometheus/discovery, unlike custom_sd one.

@saswatamcode saswatamcode self-assigned this Nov 4, 2021
Signed-off-by: Saswata Mukherjee <[email protected]>
Signed-off-by: Saswata Mukherjee <[email protected]>
Signed-off-by: Saswata Mukherjee <[email protected]>
Signed-off-by: Saswata Mukherjee <[email protected]>
Signed-off-by: Saswata Mukherjee <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant