Contributing
Development Setup
Prerequisites
- JDK 21
- Gradle 8.12+
- Docker (for building images)
- minikube (for integration/E2E tests)
- clang/llvm (for compiling BPF programs locally)
- kotlin-ebpf-dsl as a sibling directory
Clone
git clone https://github.com/pjs7678/kpod-metrics.git
git clone https://github.com/pjs7678/kotlin-ebpf-dsl.git
Build
cd kpod-metrics
./gradlew build -PebpfDslPath=../kotlin-ebpf-dsl
Run Tests
./gradlew test -PebpfDslPath=../kotlin-ebpf-dsl
Docker Build
# From parent directory containing both repos
docker build -f kpod-metrics/Dockerfile -t kpod-metrics .
Pull Request Process
- Create a feature branch from
main
- Make your changes with tests
- Run
./gradlew test detekt to verify
- Run
helm lint helm/kpod-metrics if modifying Helm templates
- If adding new Helm values: update
helm/kpod-metrics/values.schema.json
- Push and open a PR against
main
- CI must pass (unit tests, detekt, Helm lint)
Code Style
- Kotlin with Detekt static analysis
- Follow existing patterns in
src/main/kotlin/
- New collectors should follow the same structure as existing ones in
collector/
- Tests use MockK for mocking and SimpleMeterRegistry for metric verification