Cloud Billing - Cost Monitoring and Alerting API for Google Cloud (Billing Exports)
The project connects to Google Cloud BigQuery having Billing Export to Analyse, Monitor and Alerts for Cloud Cost and caches the results in Redis.
To setup the project locally, use Docker with docker-compose:
docker-compose up -d
The server will be up and running at localhost:8080/
Provide the environment variables defined in the docker-compose.yml
. To authenticate to Google Cloud, you will need a Service Account JSON mounted on the container having path set to GOOGLE_APPLICATION_CREDENTIALS
environment variable.
Caching for BigQuery queries are done via Redis with a provided TTL expiry time. The rate limiter is set that maintains a LRU cache in memory that creates mapping between user IP and requests hit per minute.
The documentation for the API will be available at /docs
route serving via Swagger
. This is thanks to the FastAPI integration with Swagger UI.
The references for this project are mentioned below: