Enterprise-grade PHP SDK for TelemetryFlow — unified metrics, logs, and traces collection following OpenTelemetry standards. Ships as a monorepo with a framework-agnostic core, a first-class Laravel integration, and a Symfony Console code generator.
Contributions are welcome! This document explains how to set up the TelemetryFlow PHP SDK for local development.
packages/
├── php-native/ # Framework-agnostic core (TelemetryFlow\Core\*)
├── laravel/ # Laravel integration (TelemetryFlow\Laravel\*)
└── generator/ # Symfony Console CLI (TelemetryFlow\Generator\*)
All three packages share a single root composer.json for development. Dependencies declared by each package are installed into the root vendor/.
- PHP 8.2+
- Composer 2.6+
- The
grpcPHP extension is optional — required only when using the gRPC OTLP transport. HTTP transport works without it.
git clone https://github.com/telemetryflow/telemetryflow-php-sdk.git
cd telemetryflow-php-sdk
make install| Command | Description |
|---|---|
make test |
Run all package test suites |
make test-core |
Run php-native tests only |
make test-laravel |
Run Laravel tests only |
make stan |
Run PHPStan static analysis (level 6) |
make cs-fix |
Auto-fix code style |
make cs-check |
Verify code style (CI mode) |
make check |
Run all checks (style + stan + tests) |
- PSR-12 with strict types (
declare(strict_types=1)) - PHP-CS-Fixer enforces style, run
make cs-fixbefore committing - PHPStan level 6 static analysis must pass
- Every class must have a header license comment (auto-added by CS-Fixer)
- Use readonly properties and backed enums where appropriate
- Tests live in
packages/*/tests/mirroring thesrc/structure - Use PHPUnit 10/11 conventions
- Aim for 80%+ line coverage and 85%+ mutation score
- Place unit tests under
tests/Unit/and cross-layer tests undertests/Integration/
- Create a feature branch from
main - Make your changes with tests
- Ensure
make checkpasses locally - Open a PR describing the change and referencing any issue
By contributing you agree that your contributions will be licensed under the Apache License 2.0.
Built with ❤️ by Telemetri Data Indonesia collaboration with Kiro