friendsofhyperf / sentry
The sentry component for Hyperf.
Fund package maintenance!
huangdijia
hdj.me/sponsors
Requires
- hyperf/command: ~3.1.0
- hyperf/context: ~3.1.0
- hyperf/coroutine: ~3.1.0
- hyperf/di: ~3.1.0
- hyperf/event: ~3.1.0
- hyperf/exception-handler: ~3.1.0
- hyperf/framework: ~3.1.0
- hyperf/http-server: ~3.1.0
- hyperf/support: ~3.1.0
- hyperf/tappable: ~3.1.0
- sentry/sentry: ^4.4.0
Suggests
- elasticsearch/elasticsearch: Required to use the elasticsearch client (^7.0|^8.0).
- hyperf/amqp: Required to use the amqp event (~3.1.9).
- hyperf/crontab: Required to use the crontab event (~3.1.7).
- hyperf/database: Required to use the crontab event (~3.1.0).
- phpmyadmin/sql-parser: Required to use the sql parser (^5.9).
- dev-main / 3.1.x-dev
- v3.1.46.1
- v3.1.46
- v3.1.44
- v3.1.41
- v3.1.40
- v3.1.37
- v3.1.36
- v3.1.32
- v3.1.31
- v3.1.29
- v3.1.28.2
- v3.1.27
- v3.1.26
- v3.1.25
- v3.1.22.6
- v3.1.22.5
- v3.1.22.4
- v3.1.22.3
- v3.1.22.2
- v3.1.22.1
- v3.1.22
- v3.1.21
- v3.1.20
- v3.1.19
- v3.1.18
- v3.1.17
- v3.1.16.3
- v3.1.16.2
- v3.1.16.1
- v3.1.16
- v3.1.15
- v3.1.13
- v3.1.12.2
- v3.1.12.1
- v3.1.12
- v3.1.10
- v3.1.8
- v3.1.7
- v3.1.6
- v3.1.5
- v3.1.4
- v3.1.3
- v3.1.2
- v3.1.1
- v3.1.0
- v3.1.0-rc.23
- v3.1.0-rc.22
- v3.1.0-rc.21
- v3.1.0-rc.20
- v3.1.0-rc.19
- v3.1.0-rc.18
- v3.1.0-rc.17
- v3.1.0-rc.16
- v3.1.0-rc.15
- v3.1.0-rc.14
- v3.1.0-rc.13
- v3.1.0-rc.12
- v3.1.0-rc.11
- v3.1.0-rc.10
- v3.1.0-rc.9
- v3.1.0-rc.8
- v3.1.0-rc.7
- v3.1.0-rc.6
- v3.1.0-rc.5
- v3.1.0-rc.4
- v3.1.0-rc.2
- v3.1.0-rc.1
- v3.1.0-beta.24
- v3.1.0-beta.23
- v3.1.0-beta.22
- v3.1.0-beta.21
- v3.1.0-beta.20
- v3.1.0-beta.19
- v3.1.0-beta.18
- v3.1.0-beta.17
- v3.1.0-beta.16
- v3.1.0-beta.15
- v3.1.0-beta.13
- v3.1.0-beta.12
- v3.1.0-beta.11
- v3.1.0-beta.9
- v3.1.0-beta.3
- v3.1.0-beta.1
- 3.0.x-dev
- v3.0.122
- v3.0.121
- v3.0.120
- v3.0.118
- v3.0.117
- v3.0.116
- v3.0.115
- v3.0.114
- v3.0.113
- v3.0.112
- v3.0.111
- v3.0.110
- v3.0.108
- v3.0.107
- v3.0.105
- v3.0.104
- v3.0.103
- v3.0.102
- v3.0.101
- v3.0.100
- v3.0.99
- v3.0.98
- v3.0.97
- v3.0.96
- v3.0.95
- v3.0.94
- v3.0.93
- v3.0.92
- v3.0.91
- v3.0.90
- v3.0.89
- v3.0.88
- v3.0.85
- v3.0.83
- v3.0.81
- v3.0.80
- v3.0.79
- v3.0.78
- v3.0.77
- v3.0.76
- v3.0.75
- v3.0.74
- v3.0.73
- v3.0.72
- v3.0.71
- v3.0.70
- v3.0.68
- v3.0.67
- v3.0.66
- v3.0.55
- v3.0.52
- v3.0.51
- v3.0.49
- v3.0.48
- v3.0.47
- v3.0.44
- v3.0.43
- v3.0.42
- v3.0.36
- v3.0.35
- v3.0.34
- v3.0.33
- v3.0.32
- v3.0.31
- v3.0.30
- v3.0.29
- v3.0.25
- v3.0.24
- v3.0.23
- v3.0.21
- v3.0.20
- v3.0.18
- v3.0.14
- v3.0.6
- v3.0.2
- v3.0.0
- v3.0.0-rc.36
- v3.0.0-rc.35
- v3.0.0-rc.34
- v3.0.0-rc.33
- 2.0.x-dev
- v2.0.28
- v2.0.25
This package is auto-updated.
Last update: 2024-11-22 09:37:19 UTC
README
The sentry component for Hyperf.
Installation
composer require friendsofhyperf/sentry
Publish
php bin/hyperf.php vendor:publish friendsofhyperf/sentry
Register Logger Handler
<?php # use it send customer log to sentry //\FriendsOfHyperf\Helpers\logs('project-name', 'sentry')->warning('this is a test warning issue!'); return [ // ... 'sentry' => [ 'handler' => [ 'class' => FriendsOfHyperf\Sentry\SentryHandler::class, 'constructor' => [ 'level' => \Monolog\Level::Debug, ], ], 'formatter' => [ 'class' => \Monolog\Formatter\LineFormatter::class, 'constructor' => [ 'format' => null, 'dateFormat' => null, 'allowInlineLineBreaks' => true, ] ], ], // ... ];
Sentry Running log
<?php # config/autoload/sentry.php return [ // ... 'logger' => Hyperf\Contract\StdoutLoggerInterface::class, // ... ];
Annotation
<?php namespace App; use FriendsOfHyperf\Sentry\Annotation\Breadcrumb; class Foo { #[Breadcrumb(category: 'foo')] public function bar($a = 1, $b = 2) { return __METHOD__; } }
Tracing
SENTRY_TRACING_ENABLE_AMQP=true SENTRY_TRACING_ENABLE_ASYNC_QUEUE=true SENTRY_TRACING_ENABLE_COMMAND=true SENTRY_TRACING_ENABLE_CRONTAB=true SENTRY_TRACING_ENABLE_KAFKA=true SENTRY_TRACING_ENABLE_MISSING_ROUTES=true SENTRY_TRACING_ENABLE_REQUEST=true SENTRY_TRACING_SPANS_COROUTINE=true SENTRY_TRACING_SPANS_DB=true SENTRY_TRACING_SPANS_ELASTICSEARCH=true SENTRY_TRACING_SPANS_GUZZLE=true SENTRY_TRACING_SPANS_RPC=true SENTRY_TRACING_SPANS_REDIS=true SENTRY_TRACING_SPANS_SQL_QUERIES=true
Sentry Develop Docs
- https://github.com/open-telemetry/semantic-conventions/tree/main
- https://develop.sentry.dev/sdk/performance/span-operations/#database