goksagun/elastic-apm-bundle

Elastic APM bundle

安装次数: 4,344

依赖项: 0

建议者: 0

安全性: 0

星星: 0

关注者: 1

分支: 7

开放问题: 0

类型:symfony-bundle

v0.6.0 2022-08-23 11:07 UTC

This package is auto-updated.

Last update: 2024-09-23 15:19:25 UTC


README

使用 Symfony Flex 的应用程序

打开命令行控制台,进入您的项目目录并执行

$ composer require goksagun/elastic-apm-bundle

未使用 Symfony Flex 的应用程序

步骤 1: 下载 Bundle

打开命令行控制台,进入您的项目目录并执行以下命令以下载此 Bundle 的最新稳定版本

$ composer require goksagun/elastic-apm-bundle

此命令要求您全局安装了 Composer,请参阅 Composer 文档的安装章节

步骤 2: 启用 Bundle

然后,将 Bundle 添加到项目 app/AppKernel.php 文件中注册的 Bundle 列表中以启用它

<?php
// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = [
            // ...
            new Goksagun\ElasticApmBundle\ElasticApmBundle(),
        ];

        // ...
    }

    // ...
}

步骤 3: 添加 Bundle 配置文件

然后,将 Bundle 配置 yml 文件 elastic_apm.yml 添加到 app/config 目录中

elastic_apm:
    enabled: true
    appName: 'Symfony APM App' #Name of this application, Required
    serverUrl: 'http://127.0.0.1:8200' #APM Server Endpoint, Default: 'http://127.0.0.1:8200'
    secretToken: null #Secret token for APM Server, Default: null

将新配置文件导入到 app/config 目录中的 config.yml

imports:
    ...
    - { resource: elastic_apm.yml }