https://github.com/opentelemetry-php/contrib-propagator-cloudtrace
[READONLY] CloudTrace propagator
https://github.com/opentelemetry-php/contrib-propagator-cloudtrace
Last synced: 6 months ago
JSON representation
[READONLY] CloudTrace propagator
- Host: GitHub
- URL: https://github.com/opentelemetry-php/contrib-propagator-cloudtrace
- Owner: opentelemetry-php
- Created: 2025-08-04T02:43:42.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-08-08T01:43:34.000Z (11 months ago)
- Last Synced: 2025-09-30T20:56:16.757Z (9 months ago)
- Language: PHP
- Size: 8.79 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://github.com/opentelemetry-php/contrib-propagator-cloudtrace/releases)
[](https://github.com/open-telemetry/opentelemetry-php/issues)
[](https://github.com/open-telemetry/opentelemetry-php-contrib/tree/main/src/Propagation/CloudTrace)
[](https://github.com/opentelemetry-php/contrib-propagator-cloudtrace)
[](https://packagist.org/packages/open-telemetry/opentelemetry-propagation-cloudtrace/)
[](https://packagist.org/packages/open-telemetry/opentelemetry-propagation-cloudtrace/)
This is a read-only subtree split of https://github.com/open-telemetry/opentelemetry-php-contrib.
# OpenTelemetry CloudTrace Propagator
CloudTrace is a propagator that supports the specification for the header "x-cloud-trace-context" used for trace context propagation across
service boundaries. (https://cloud.google.com/trace/docs/setup#force-trace). OpenTelemetry PHP CloudTrace Propagator Extension provides
option to use it bi-directionally or one-way. One-way does not inject the header for downstream consumption, it only processes the incoming headers
and returns the correct span context. It only attaches to existing X-Cloud-Trace-Context traces and does not create downstream ones.
## Installation
```sh
composer require open-telemetry/opentelemetry-propagation-cloudtrace
```
## Usage
For one-way CloudTrace:
```
$propagator = CloudTracePropagator::getOneWayInstance();
```
For bi-directional CloudTrace:
```
$propagator = CloudTracePropagator::getInstance();
```