Simple analytics for API callers: latency and error rate. Can be used as a starting point for other Airfold projects.
The structure of this repository is:
./airfold- Airfold pipeline definitions./dashboard.py- Streamlit dashboard that displays the data./main.py- Example app that sends API events to Airfold./github/workflows/deploy.yaml- Typical workflow for CI/CD
To install the project, run the following commands:
git clone api-analytics-template
cd api-analytics-template
pip install -r requirements.txtTo set up your Airfold pipeline, follow these steps:
- Obtain an Admin key from your Airfold Workspace.
- Set it up in the Airfold CLI:
af configWhen prompted, enter the API URL and Admin key:
Configuring for API URL: https://api.airfold.co
? Api key: **************
🚀 Config successfully set up!
You can manually modify it in: '/home/user/api-analytics-template/.airfold/config.yaml'
- Push the pipeline:
af push ./airfold- Send some events from the main app:
AIRFOLD_API_KEY=aft_XXXXX python main.py- Launch the dashboard:
AIRFOLD_API_KEY=aft_XXXXX streamlit run dashboard.pyThis repository contains a deploy CI/CD pipeline that will dry-run your Airfold project on PRs
and deploy the project upon merging to main.
It will also create PR comments reporting CI/CD progress or failures.
