Skip to content

Latest commit

 

History

History
102 lines (75 loc) · 4.5 KB

File metadata and controls

102 lines (75 loc) · 4.5 KB
TelemetryFlow Logo

TelemetryFlow PHP SDK

Version License PHP Version OpenTelemetry Laravel

Coverage Core Generator Laravel%20Coverage Tests PHPStan

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.


Contributing

Contributions are welcome! This document explains how to set up the TelemetryFlow PHP SDK for local development.

Monorepo Layout

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/.

Requirements

  • PHP 8.2+
  • Composer 2.6+
  • The grpc PHP extension is optional — required only when using the gRPC OTLP transport. HTTP transport works without it.

Setup

git clone https://github.com/telemetryflow/telemetryflow-php-sdk.git
cd telemetryflow-php-sdk
make install

Development Workflow

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)

Coding Standards

  • PSR-12 with strict types (declare(strict_types=1))
  • PHP-CS-Fixer enforces style, run make cs-fix before 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

Testing

  • Tests live in packages/*/tests/ mirroring the src/ 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 under tests/Integration/

Pull Requests

  1. Create a feature branch from main
  2. Make your changes with tests
  3. Ensure make check passes locally
  4. Open a PR describing the change and referencing any issue

License

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