cognesy / instructor-metrics
Event-driven metrics collection system for Instructor PHP library
v2.11.0
2026-09-17 16:56 UTC
Requires
- php: ^8.3
- cognesy/instructor-events: ^2.11
- psr/event-dispatcher: ^1.0
- psr/log: ^3.0
Requires (Dev)
- icanhazstring/composer-unused: ^0.9.0
- jetbrains/phpstorm-attributes: ^1.2
- maglnet/composer-require-checker: ^4.16
- pestphp/pest: ^4.0
- phpstan/phpstan: ^1.11
- roave/security-advisories: dev-latest
- vimeo/psalm: ^6.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-main
- v2.11.0
- v2.10.1
- v2.10.0
- v2.9.5
- v2.9.4
- v2.9.3
- v2.9.2
- v2.9.1
- v2.9.0
- v2.8.5
- v2.8.4
- v2.8.3
- v2.8.2
- v2.8.1
- v2.8.0
- v2.7.1
- v2.7.0
- v2.6.2
- v2.6.1
- v2.6.0
- v2.5.2
- v2.5.1
- v2.5.0
- v2.4.1
- v2.3.1
- v2.3.0
- v2.2.0
- v2.1.0
- v2.0.0
- v1.22.0
- v1.21.0
- v1.20.0
- v1.19.0
- v1.18.4
- v1.18.3
- v1.18.2
- v1.18.1
- v1.18.0
- v1.17.0
- v1.16.0
This package is auto-updated.
Last update: 2026-09-17 17:10:35 UTC
README
Event-driven metrics collection for InstructorPHP.
Use it to:
- collect metrics from event listeners
- store them in a registry
- export them to logs or custom backends
Example
<?php use Cognesy\Events\Dispatchers\EventDispatcher; use Cognesy\Metrics\Data\Tags; use Cognesy\Metrics\Exporters\CallbackExporter; use Cognesy\Metrics\Metrics; $metrics = (new Metrics(new EventDispatcher())) ->exportTo(new CallbackExporter(function (iterable $items): void { foreach ($items as $metric) { // send metric to your backend } })); $metrics->registry()->counter('requests_total', Tags::of(['route' => '/health'])); $metrics->export();
Documentation
packages/metrics/CHEATSHEET.mdpackages/metrics/src/