定制 poespas/opentelemetry-tracing-magento2 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

poespas/opentelemetry-tracing-magento2

最新稳定版本:1.0.0

Composer 安装命令:

composer require poespas/opentelemetry-tracing-magento2

包简介

Magento 2 OpenTelemetry Tracing

README 文档

README

Overview

OpenTelemetry Tracing is a Magento 2 module that integrates seamlessly with Magento's built-in Profiling functionality to provide advanced tracing capabilities. By adding a custom tracing driver, this module enables detailed performance monitoring and analysis, helping developers optimize their Magento applications effectively and for free.

Features

  • Enhanced Profiling: Extends Magento's native profiler with advanced tracing capabilities.
  • Jaeger Compatibility: Integrates with Jaeger for distributed tracing using the jonahgeorge/jaeger-client-php library.
  • Grafana Tempo Support: Compatible with Grafana Tempo through the OpenTelemetry endpoint, allowing for comprehensive monitoring and visualization.
  • Flexible Configuration: Easily configure tracing settings via JSON files or Magento CLI commands.

Compatibility

Jaeger

OpenTelemetry Tracing integrates with Jaeger, a popular open-source distributed tracing system. This integration is powered by the jonahgeorge/jaeger-client-php library, ensuring reliable and efficient tracing capabilities.

Grafana Tempo

The module also supports Grafana Tempo, enabling users to leverage Grafana's powerful visualization tools through the OpenTelemetry endpoint. This compatibility allows for seamless tracing data collection and analysis within the Grafana ecosystem.

Installation

  1. Clone the Repository:
composer require poespas/opentelemetry-tracing-magento2
  1. Enable the Module:
bin/magento module:enable Poespas_OpentelemetryTracing
bin/magento setup:upgrade

Configuration

You can configure the tracing driver using a JSON configuration file or via the Magento CLI command.

Using var/profiler.flag File

Create or update the var/profiler.flag file in the root of the magento installation with your JSON configuration:

{
  "drivers": [
    {
      "type": "\\Poespas\\OpentelemetryTracing\\Profiler\\Driver\\TracingDriver",
      "application_name": "my-magento-app",
      "config": {
        "local_agent": {
          "reporting_host": "127.0.0.1",
          "reporting_port": 14268
        },
        "dispatch_mode": "jaeger_over_binary_http"
      }
    }
  ]
}

Using Magento CLI Command

Alternatively, enable the profiler with a minified JSON configuration using the following command:

bin/magento dev:profiler:enable '{"drivers":[{"type":"\\Poespas\\OpentelemetryTracing\\Profiler\\Driver\\TracingDriver","application_name":"my-magento-app","config":{"local_agent":{"reporting_host":"127.0.0.1","reporting_port":14268},"dispatch_mode":"jaeger_over_binary_http"}}]}'

Screenshots

Jaeger Integration

Jaeger Dashboard

Example of tracing data visualized in Jaeger.

Grafana Tempo Integration

Grafana Tempo Dashboard

Example of tracing data visualized in Grafana Tempo.

Inspiration

OpenTelemetry Tracing was inspired by the sitewards/Magento2-OpenCensus project.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.

Support

For support and questions, please open an issue on the GitHub repository.

统计信息

  • 总下载量: 3.14k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-10-26