定制 open-telemetry/opentelemetry-propagation-instana 二次开发

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

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

open-telemetry/opentelemetry-propagation-instana

最新稳定版本:0.1.0

Composer 安装命令:

composer require open-telemetry/opentelemetry-propagation-instana

包简介

OpenTelemetry Instana propagator.

README 文档

README

Releases Issues Source Mirror Latest Version Stable

This is a read-only subtree split of https://github.com/open-telemetry/opentelemetry-php-contrib.

OpenTelemetry Instana Propagator

The OpenTelemetry Propagator for Instana provides HTTP header propagation and Baggage propagation for systems that are using IBM Observability by Instana. This propagator translates the Instana trace correlation headers (X-INSTANA-T/X-INSTANA-S/X-INSTANA-L) into the OpenTelemetry SpanContext, and vice versa. It does not handle TraceState.

Installation

composer require open-telemetry/opentelemetry-propagation-instana

Usage

$propagator = InstanaPropagator::getInstance(); 

Both of the above have extract and inject methods available to extract and inject respectively into the header.

For Baggage propagation, use opentelemetry's MultiTextMapPropagator, and pass the array list of propagators i.e Instana and Baggage propagator as below.

$propagator = new MultiTextMapPropagator([InstanaPropagator::getInstance(), BaggagePropagator::getInstance()]); 

Propagator Details

There are three headers that the propagator handles: X-INSTANA-T (the trace ID), X-INSTANA-S (the parent span ID), and X-INSTANA-L (the sampling level).

Example header triplet:

  • X-INSTANA-T: 80f198ee56343ba864fe8b2a57d3eff7,
  • X-INSTANA-S: e457b5a2e4d86bd1,
  • X-INSTANA-L: 1.

A short summary for each of the headers is provided below. More details are available at https://www.ibm.com/docs/en/obi/current?topic=monitoring-traces#tracing-headers.

X-INSTANA-T -- trace ID

  • A string of either 16 or 32 characters from the alphabet 0-9a-f, representing either a 64 bit or 128 bit ID.
  • This header corresponds to the OpenTelemetry TraceId.
  • If the propagator receives an X-INSTANA-T header value that is shorter than 32 characters when extracting headers into the OpenTelemetry span context, it will left-pad the string with the character "0" to length 32.
  • No length transformation is applied when injecting the span context into headers.

X-INSTANA-S -- parent span ID

  • Format: A string of 16 characters from the alphabet 0-9a-f, representing a 64 bit ID.
  • This header corresponds to the OpenTelemetry SpanId.

X-INSTANA-L - sampling level

  • The only two valid values are 1 and 0.
  • A level of 1 means that this request is to be sampled, a level of 0 means that the request should not be sampled.
  • This header corresponds to the sampling bit of the OpenTelemetry TraceFlags.

Useful links

Installing dependencies and executing tests

From Instana subdirectory:

$ composer install $ ./vendor/bin/phpunit tests

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固