frzb / metrics-power
The MetricsPower component allows make your application able to metric
v1.1.5
2024-04-05 14:11 UTC
Requires
- php: >=8.2
- amphp/log: ^2.0
- fp4php/functional: ^6.0
- frzb/dependency-injection: ^2.1
- promphp/prometheus_client_php: ^v2.10
- sentry/sdk: ^4.0
- symfony/event-dispatcher: ^6|^7
- symfony/expression-language: ^6|^7
- symfony/framework-bundle: ^6|^7
- symfony/http-kernel: ^6|^7
- symfony/messenger: ^6|^7
- symfony/serializer: ^6|^7
- symfony/serializer-pack: ^1.3
- symfony/yaml: ^6|^7
Requires (Dev)
- friendsofphp/php-cs-fixer: ^v3.52
- mockery/mockery: ^1.6
- pestphp/pest: ^2.34
- phpunit/phpunit: ^10.5
- symfony/phpunit-bridge: ^6|^7
README
The Metrics Power Component
allows make your application able to metric
Installation
The recommended way to install is through Composer:
composer require frzb/metrics-power
It requires PHP version 8.1 and higher.
Usage of #[Metrical]
#[Metrical]
will automatically create and collect metrics for your messages
Example
<?php use FRZB\Component\MetricsPower\Attribute\Metrical; use FRZB\Component\MetricsPower\Attribute\PrometheusOptions; #[Metrical( new PrometheusOptions( 'some_topic', 'CreateUserMessage', 'Total of user messages', ['label'], ['total'] ), )] final class CreateUserMessage { public function __construct( public readonly string $id, public readonly string $name, ) {} }