semako / elastic-apm-bundle

安装: 0

依赖者: 0

建议者: 0

安全: 0

星标: 0

关注者: 0

分支: 7

类型:symfony-bundle

v0.5.0 2019-06-25 12:29 UTC

This package is auto-updated.

Last update: 2024-09-08 00:09:56 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

将新配置文件导入 config.ymlapp/config 目录

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