A RESTful API for dynamically managing OpenTelemetry Collector configurations in Kubernetes environments.
Enables central control over pipelines via HTTP, including configuration updates, deletions, and live reloads.
- API endpoints to:
- Create or replace configurations (
POST
) - Update specific processors (
PUT
) - Remove parts of the pipeline (
DELETE
) - Trigger live reload in the OpenTelemetry pod (
POST /reload
)
- Create or replace configurations (
- Designed for Kubernetes clusters
- DEBUG mode support for testing without persistence
- Fully tested with
pytest
# Clone the repository
git clone https://ants-gitlab.inf.um.es/telemetry/plugin-api-otel.git
cd plugin-api-otel
# Create virtual environment
python -m venv venv
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
To run the full test suite:
cd plugin-api-otel
# Run tests
pytest
Run the development server:
uvicorn agent:app --host 0.0.0.0 --port 8000
Visit the interactive Swagger docs:
Method | Endpoint | Description |
---|---|---|
PUT | /configurations |
Update parts of the pipeline |
POST | /configurations |
Create or replace full configuration |
DELETE | /configurations |
Delete specific pipeline elements |
POST | /reload |
Reload OpenTelemetry Collector via kubectl debug and SIGHUP |
plugin-api-otel/
├── agent.py # Main FastAPI application
├── Dockerfile # Container definition
├── helm/
├── k8s/
│ ├── deployment.yaml # Kubernetes agent-api deployment manifest
│ └── service.yaml # Kubernetes agent-api service definition
├── requirements.txt # Python dependencies
├── test/ # Test suite
│ ├── curl/ # Example curl commands
│ ├── template.yaml # Test ConfigMap template
│ ├── test_configurations.py # Unit tests for /configurations endpoints (PUT, POST, DELETE)
│ └── test_reload.py # Unit tests for /reload endpoint with mocked k8s operations
└── README.md
- Python 3.11 or newer
- Kubernetes environment with
kubectl
access - Sufficient privileges to execute
kubectl debug
Contributions are welcome!
- Create a new branch:
git checkout -b feature-branch
- Commit your changes:
git commit -m 'Clear description of your change'
- Push to remote:
git push origin feature-branch
- Open a Merge Request in GitLab
José Manuel Bernabé Murcia
José Luis Sánchez Fernández
University of Murcia