chq81/elastic-apm-bundle

Elastic APM bundle

安装次数: 2,668

依赖项: 0

建议者: 0

安全性: 0

星标: 0

关注者: 0

分支: 7

类型:symfony-bundle

v1.1.0 2022-05-02 14:49 UTC

This package is auto-updated.

Last update: 2024-08-30 01:23:28 UTC


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.

贡献

欢迎贡献。阅读贡献指南以开始。

贡献者

感谢每一位贡献者,特别感谢