This tool connects to a Prometheus query backend and exposes a grpc server that can be queried by Thanos Querier.
This tool currently only supports Google Cloud Monitoring.
Set up the following environment variables:
PROJECT_ID=YOUR_PROJECT_ID
# Google Managed Prometheus endpoint.
QUERY_TARGET="https://monitoring.googleapis.com/v1/projects/$PROJECT_ID/location/global/prometheus"
SERVICE_ACCOUNT_CREDENTIAL_FILE=GOOGLE_CLOUD_SERVICE_ACCOUNT_WITH_GOOGLE_CLOUD_MONITORING_READ_ACCESS
Run the following command:
go run main.go \
--query.target-url=QUERY_TARGET \
--query.credentials-file=SERVICE_ACCOUNT_CREDENTIAL_FILE
- Start up Thanos Querier by running the following commands:
git clone https://github.com/thanos-io/thanos.git
cd thanos
go run ./cmd/thanos query --endpoint :8081 --query.mode distributed --query.promql-engine thanos
- Start up the thanos-promql-connector.
- View Thanos Querier UI at address 0.0.0.0:10902.