chq81 / elastic-apm-bundle
Elastic APM bundle
v1.1.0
2022-05-02 14:49 UTC
Requires
- php: ^7.1 || ^8.0
- nipwaayoni/elastic-apm-php-agent: ^7.5
- symfony/config: ^4.4 || ^5.4 || ^6.0
- symfony/dependency-injection: ^4.4 || ^5.4 || ^6.0
- symfony/http-kernel: ^4.4 || ^5.4 || ^6.0
- symfony/security-bundle: ^4.4 || ^5.4 || ^6.0
Requires (Dev)
- symfony/phpunit-bridge: ^4.4 || ^5.4 || ^6.0
README
本包是goksagun在goksagun/elastic-apm-bundle上所做的优秀工作的延续。
安装
使用Symfony Flex的应用程序
打开命令行,进入您的项目目录并执行
$ composer require chq81/elastic-apm-bundle
不使用Symfony Flex的应用程序
步骤 1: 下载Bundle
打开命令行,进入您的项目目录并执行以下命令以下载此bundle的最新稳定版本
$ composer require chq81/elastic-apm-bundle
此命令要求您已全局安装Composer,具体请参阅Composer文档的安装章节。
步骤 2: 启用Bundle
然后,通过将其添加到项目中app/AppKernel.php文件中注册的bundle列表中,启用该bundle
<?php // app/AppKernel.php // ... class AppKernel extends Kernel { public function registerBundles() { $bundles = [ // ... new Chq81\ElasticApmBundle\ElasticApmBundle(), ]; // ... } // ... }
步骤 3: 添加Bundle配置文件
然后,将bundle配置yml文件elastic_apm.yml添加到config/packages目录
elastic_apm: enabled: true # Activate the APM Agent, default is true serviceName: 'Symfony APM App' # The name of your service, required serverUrl: 'https://:8200' # The URL for your APM service, required The URL must be fully qualified, including the protocol and port. secretToken: null # The secret token required to send data to your APM service environment: dev # The environment of your service
配置
提供了以下配置选项
此外,还可以为事务和错误禁用/启用数据捕获。默认情况下,两者都启用。对于错误,可以排除状态码和异常。以下是一个示例
transactions: # Captures transactions
enabled: true # Activating capturing of transactions, default is true
errors: # Captures errors
enabled: true # Activating capturing of errors, default is true
exclude:
status_codes: [] # Status codes which should not be captured. The default is none.
exceptions: [] # Exceptions which should not be captured. The default is none.
贡献
欢迎贡献。阅读贡献指南以开始。
贡献者
感谢每一位贡献者,特别感谢