PHPackages                             open-telemetry/opentracing-shim - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. open-telemetry/opentracing-shim

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

open-telemetry/opentracing-shim
===============================

OpenTracing shim for OpenTelemetry

0.0.4(1mo ago)117Apache-2.0PHP

Since Jun 5Pushed 1mo ago3 watchersCompare

[ Source](https://github.com/opentelemetry-php/contrib-shim-opentracing)[ Packagist](https://packagist.org/packages/open-telemetry/opentracing-shim)[ Docs](https://opentelemetry.io)[ RSS](/packages/open-telemetry-opentracing-shim/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (28)Versions (5)Used By (0)

OpenTracing shim for OpenTelemetry
==================================

[](#opentracing-shim-for-opentelemetry)

This package is intended to help OpenTracing users migrate to OpenTelemetry. The OpenTelemetry documentation provides guidance on how to migrate to OpenTelemetry:

Installation
============

[](#installation)

API + SDK
---------

[](#api--sdk)

This package depends on the OpenTelemetry API, but an [OpenTelemetry SDK](https://opentelemetry.io/docs/instrumentation/php/sdk/)and an exporter should also be provided to enable exporting spans.

You usually need to supply a PSR-7 and PSR-18 implementation, since most exporters use HTTP to transport telemetry data (gRPC is the exception).

OTLP Exporter
-------------

[](#otlp-exporter)

Usually logs are exported to some receiver via the `otlp` protocol in the `protobuf` format, via http or `gRPC`.

This requires:

- a `protobuf` implementation; either the protobuf extension or the `google/protobuf` package
- the `open-telemetry/exporter-otlp` package
- the `open-telemetry/transport-grpc` package, if using gRPC transport
- a PSR-7 and PSR-18 implementation, if using HTTP transport

Zipkin exporter
---------------

[](#zipkin-exporter)

OpenTelemetry supports exporting via the zipkin protocol, which requires the `open-telemetry/exporter-zipkin` package. Traces can be exported to a zipkin instance directly, or to any other service which supports the zipkin protocol.

Setup
=====

[](#setup)

To use this package, you need to create an OpenTelemetry `tracer provider`, which is the only parameter used by the shim tracer:

```
$tracerProvider = new OpenTelemetry\SDK\Trace\TracerProvider(/*params*/);
OpenTelemetry\SDK\Common\Util\ShutdownHandler::register([$tracerProvider, 'shutdown']);
$tracer = new OpenTelemetry\Contrib\Shim\OpenTracing\Tracer($tracerProvider);
```

There are a number of ways to set up a tracer provider, please see the [official documentation](https://opentelemetry.io/docs/instrumentation/php/sdk/)or the [examples](./examples).

Notes
=====

[](#notes)

- OpenTelemetry does not support setting span kind after span creation, so adding a `span.kind` tag will not set the span's kind. An attribute will still be emitted, though.
- `Span::log([/*$fields*/])` will use an `event` field as the log name, otherwise `log`.
- errors may be logged via `Span::log`, using the key `exception`. A `Throwable` should be the field's value, but a string is allowable and will be converted to an exception

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance90

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor4

4 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~341 days

Total

4

Last Release

49d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4978962?v=4)[Brett McBride](/maintainers/brettmc)[@brettmc](https://github.com/brettmc)

![](https://avatars.githubusercontent.com/u/4099109?v=4)[Bob Strecansky](/maintainers/bobstrecansky)[@bobstrecansky](https://github.com/bobstrecansky)

---

Top Contributors

[![agoallikmaa](https://avatars.githubusercontent.com/u/3532037?v=4)](https://github.com/agoallikmaa "agoallikmaa (1 commits)")[![bobstrecansky](https://avatars.githubusercontent.com/u/4099109?v=4)](https://github.com/bobstrecansky "bobstrecansky (1 commits)")[![brettmc](https://avatars.githubusercontent.com/u/4978962?v=4)](https://github.com/brettmc "brettmc (1 commits)")[![ChrisLightfootWild](https://avatars.githubusercontent.com/u/106102472?v=4)](https://github.com/ChrisLightfootWild "ChrisLightfootWild (1 commits)")[![intuibase](https://avatars.githubusercontent.com/u/9551626?v=4)](https://github.com/intuibase "intuibase (1 commits)")[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (1 commits)")[![weslenteche](https://avatars.githubusercontent.com/u/54692047?v=4)](https://github.com/weslenteche "weslenteche (1 commits)")

---

Tags

shimopentelemetryotelopentracing

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/open-telemetry-opentracing-shim/health.svg)

```
[![Health](https://phpackages.com/badges/open-telemetry-opentracing-shim/health.svg)](https://phpackages.com/packages/open-telemetry-opentracing-shim)
```

###  Alternatives

[open-telemetry/sdk

SDK for OpenTelemetry PHP.

2222.9M248](/packages/open-telemetry-sdk)[open-telemetry/opentelemetry-auto-symfony

OpenTelemetry auto-instrumentation for Symfony

551.2M1](/packages/open-telemetry-opentelemetry-auto-symfony)[open-telemetry/opentelemetry-auto-pdo

OpenTelemetry auto-instrumentation for PDO

111.2M1](/packages/open-telemetry-opentelemetry-auto-pdo)[open-telemetry/opentelemetry-auto-wordpress

OpenTelemetry auto-instrumentation for Wordpress

17166.0k](/packages/open-telemetry-opentelemetry-auto-wordpress)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
