Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/affordablemobiles/opentelemetry-operations-php
OpenTelemetry Integration with Google Cloud Operations Suite for PHP
https://github.com/affordablemobiles/opentelemetry-operations-php
google-cloud google-cloud-trace opentelemetry opentelemetry-exporter php
Last synced: about 1 month ago
JSON representation
OpenTelemetry Integration with Google Cloud Operations Suite for PHP
- Host: GitHub
- URL: https://github.com/affordablemobiles/opentelemetry-operations-php
- Owner: affordablemobiles
- License: mit
- Created: 2024-03-20T17:24:11.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2024-04-10T15:17:01.000Z (10 months ago)
- Last Synced: 2024-04-10T18:55:43.810Z (10 months ago)
- Topics: google-cloud, google-cloud-trace, opentelemetry, opentelemetry-exporter, php
- Language: PHP
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Open-Telemetry Operations Exporters for PHP
Provides OpenTelemetry PHP exporters for Google Cloud Platform [operation suite](https://cloud.google.com/products/operations) products.
## Installation
Available via composer as `affordablemobiles/opentelemetry-operations-php`.
## Usage
Example usage:
```php
use AffordableMobiles\GServerlessSupportLaravel\Trace\Propagator\CloudTracePropagator;
use AffordableMobiles\OpenTelemetry\CloudTrace\SpanExporterFactory;
use OpenTelemetry\SDK\Sdk;
use OpenTelemetry\SDK\Trace\Sampler\AlwaysOnSampler;
use OpenTelemetry\SDK\Trace\Sampler\ParentBased;
use OpenTelemetry\SDK\Trace\SpanProcessor\SimpleSpanProcessor;
use OpenTelemetry\SDK\Trace\TracerProviderBuilder;$propagator = CloudTracePropagator::getInstance();
$spanProcessor = new SimpleSpanProcessor(
(new SpanExporterFactory())->create(),
);$sampler = new ParentBased(
new AlwaysOnSampler(),
);$tracerProvider = (new TracerProviderBuilder())
->addSpanProcessor($spanProcessor)
->setSampler($sampler)
->build()
;Sdk::builder()
->setTracerProvider($tracerProvider)
->setPropagator($propagator)
->setAutoShutdown(true)
->buildAndRegisterGlobal()
;
```