定制 grzegorzdrozd/otel-auto-redis 二次开发

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

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

grzegorzdrozd/otel-auto-redis

Composer 安装命令:

composer require grzegorzdrozd/otel-auto-redis

包简介

OpenTelemetry auto-instrumentation for Redis

README 文档

README

Please read https://opentelemetry.io/docs/instrumentation/php/automatic/ for instructions on how to install and configure the extension and SDK.

Overview

Auto-instrumentation hooks are registered via Composer, and spans will automatically be created for selected redis operations (by default: all Redis commands).

Configuration

You can disable the extension using runtime configuration:

OTEL_PHP_DISABLED_INSTRUMENTATIONS=redis
OTEL_PHP_DISABLED_INSTRUMENTATIONS=predis
OTEL_PHP_DISABLED_INSTRUMENTATIONS=credis

Module specific configuration

Disable instrumentation for specific commands

You can disable instrumentation for specific commands. This can be useful if you have some commands that are executed very often and you don't want to create spans for them. This option is disabled by default. Use environment variables to set this option. You can set multiple commands separated by a comma. You can also specify "group" of commands using @<group_name>. Groups are defined in the src/CommandGroupEnum.php file. List of commands and groups can be found in the src/AbstractInstrumentation.php file. You can define commands individually for each supported extension.

OTEL_PHP_INSTRUMENTATION_REDIS_PREDIS_FUNCTIONS=@all,-@readonly
OTEL_PHP_INSTRUMENTATION_REDIS_CREDIS_FUNCTIONS=@write
OTEL_PHP_INSTRUMENTATION_REDIS_REDIS_FUNCTIONS=get,mget

Tracking connection details for clustered connection

In Predis you can configure a clustered connection (for replication, sharding, etc.). In this case, there is no clear way to see which server executed a command. Changing this setting to true will use Predis methods to get information about which connection executed the command. Optionally, when cluster mode is set to redis, it will make a second call to Redis to determine this information. This will make your code slower. This option is disabled by default.

OTEL_PHP_INSTRUMENTATION_PREDIS_TRACK_AGGREGATED_CONNECTIONS=true

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2025-03-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固