Service for obtain metrics of Courses (with their exams), Users and Payments microservices.
├── application
│ ├── controllers
│ │ ├── courses_controller.py
│ │ ├── __init__.py
│ │ ├── payments_controller.py
│ │ └── users_controller.py
│ ├── __init__.py
│ ├── services
│ │ ├── auth.py
│ │ └── __init__.py
│ └── use_cases
│ ├── courses
│ │ └── get.py
│ ├── __init__.py
│ ├── payments
│ │ └── get.py
│ └── users
│ └── get.py
├── deploy
│ └── heroku-entrypoint.sh
├── docker-compose.yml
├── Dockerfile
├── exceptions
│ ├── auth_error.py
│ └── __init__.py
├── heroku.yml
├── infrastructure
│ ├── __init__.py
│ └── routes
│ ├── __init__.py
│ └── metrics_router.py
├── LICENSE
├── logging.ini
├── logs.log
├── main.py
├── monitoring
│ └── datadog.yml
├── README.md
├── requirements.txt
└── tests
├── conftest.py
├── __init__.py
└── test_metrics.py
- Python 3.x
- FastAPI (as web framework to building the API with Python)
- Docker
- Docker-compose
To run this application you need to define the following environment variables:
API_KEY = YOUR_METRICS_SERVICE_APIKEY
USERS_SERVICE_API_KEY = YOUR_USERS_SERVICE_API_KEY
COURSES_SERVICE_API_KEY = YOUR_COURSES_SERVICE_API_KEY
PAYMENTS_SERVICE_API_KEY = YOUR_PAYMENTS_SERVICE_API_KEY
EXAMS_SERVICE_API_KEY = YOUR_EXAMS_SERVICE_API_KEY
USERS_SERVICE_URL = PRODUCTIVE_USERS_SERVICE_URL
COURSES_SERVICE_URL = PRODUCTIVE_COURSES_SERVICE_URL
EXAMS_SERVICE_URL = PRODUCTIVE_EXAMS_SERVICE_URL
PAYMENTS_SERVICE_URL = PRODUCTIVE_PAYMENTS_SERVICE_URL
docker-compose up -d --build
This command deploys the service:
metricsservice_web
: Web Service
docker-compose stop
docker-compose down
docker-compose exec web pytest .
You can try it out at https://staging-metrics-service.herokuapp.com/docs