Skip to content

jdecool/phpunit-otel-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHPUnit OpenTelemetry monitoring demo

PHP demo project illustrating PHPUnit OpenTelemetry monitoring using flow-php/phpunit-telemetry-bridge.

Requirements

  • Docker (with Docker Compose)
  • GNU Make

Quick start

make install   # install Composer deps in the PHP container
make up        # start the OTEL collector + Grafana stack
make test      # run the suite; telemetry is exported to OTEL
make grafana   # open Grafana (or visit http://localhost:3000)

Running bare make defaults to make test.

Dashboards

Grafana is available at http://localhost:3000. Two dashboards are provisioned:

  • PHPUnit overview — the default home dashboard.
  • PHPUnit memory — memory usage across the suite.

All data is filtered by the service name phpunit-otel-sandbox. Raw test metrics are also exposed by the collector at http://localhost:8889/metrics.

Make targets

Run make help to list every available target. The main ones:

Target Description
make install Install Composer dependencies in the container
make test Run the full test suite (default target)
make coverage Run the tests with text coverage (PCOV)
make up Start the observability stack (OTEL collector + Grafana)
make down Stop and remove the containers
make grafana Open the Grafana dashboard
make logs Tail the OTEL collector logs
make shell Open a shell in the PHP container
make clean Stop the stack and remove the volumes

About

PHPUnit OpenTelemetry monitoring demo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors