承接 bedita/instrumentation 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

bedita/instrumentation

Composer 安装命令:

composer require bedita/instrumentation

包简介

OpenTelemetry instrumentation plugin for BEdita

README 文档

README

Github Actions image

This library provides auto-instrumentation for BEdita applications, according to OpenTelemetry specifications.

Requirements

This library requires PHP 8.1+ and the OpenTelemetry PHP extension.

Other optional requirements:

  • ext-grpc required to use gRPC as transport for the OTLP exporter
  • ext-protobuf significant performance improvement for otlp+protobuf exporting
  • ext-zlib if you want to compress exported data
  • open-telemetry/opentelemetry-auto-psr15 auto-instrumentation for CakePHP middlewares (PSR-15)

Installation

composer require bedita/instrumentation

Note that installing this library by itself does not generate traces. You need to install and configure the OpenTelemetry SDK and at least an exporter:

composer require open-telemetry/sdk open-telemetry/exporter-otlp

Configuration

OpenTelemetry's auto-instrumentation is completely configurable through environment variables. See the SDK configuration documentation and the PHP-specific documentation.

This library provides the following instrumentations, which can be enabled or disabled individually using their respective names:

  • bedita main instrumentation (currently does nothing by itself)
  • bedita.client CakePHP HTTP client (requires bedita)
  • cakephp CakePHP HTTP server, controllers and commands (project)
  • pdo PHP PDO (project)
  • psr3 loggers compliant with PSR-3 standard (project)
  • psr16 cache engines compliant with PSR-16 standard (project)

Example configuration

This configuration enables auto-instrumentation and the export of traces and logs using the otlp+protobuf protocol to a local backend:

# PHP injection
export OTEL_PHP_AUTOLOAD_ENABLED=true

# Export
export OTEL_LOG_LEVEL="info"
export OTEL_EXPORTER_OTLP_PROTOCOL="http/protobuf"
export OTEL_EXPORTER_OTLP_ENDPOINT="http://localhost:4318/"

# Tracing
# export OTEL_TRACES_SAMPLER="parentbased_traceidratio"
# export OTEL_TRACES_SAMPLER_ARG="0.1"
export OTEL_PHP_DETECTORS="env,host,os,sdk"
export OTEL_RESOURCE_ATTRIBUTES="service.namespace=my-namespace"
export OTEL_SERVICE_NAME="my-service"

# Propagation
export OTEL_PROPAGATORS="tracecontext,baggage"

# Instrumentation
export OTEL_PHP_EXCLUDED_URLS="/status"
# export OTEL_PHP_DISABLED_INSTRUMENTATIONS="pdo"

# Log
# see: https://github.com/open-telemetry/opentelemetry-php-contrib/tree/main/src/Instrumentation/Psr3#mode
export OTEL_PHP_PSR3_MODE="export"

bedita/instrumentation 适用场景与选型建议

bedita/instrumentation 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.76k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2024 年 10 月 21 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 bedita/instrumentation 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 bedita/instrumentation 我们能提供哪些服务?
定制开发 / 二次开发

基于 bedita/instrumentation 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: LGPL-3.0-or-later
  • 更新时间: 2024-10-21