From ac15c261b66200b7eaec4c001730cad4676d8f0c Mon Sep 17 00:00:00 2001 From: Austin Kothig Date: Thu, 19 Dec 2024 15:14:50 -0700 Subject: [PATCH] Instana exporter documentation. --- content/en/docs/languages/php/exporters.md | 33 +++++++++++++++++++ .../docs/languages/exporters/intro.md | 2 +- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/content/en/docs/languages/php/exporters.md b/content/en/docs/languages/php/exporters.md index eaf45ce67545..3e59f8f35ee2 100644 --- a/content/en/docs/languages/php/exporters.md +++ b/content/en/docs/languages/php/exporters.md @@ -182,6 +182,39 @@ $tracerProvider = new TracerProvider( $tracer = $tracerProvider->getTracer('io.opentelemetry.contrib.php'); ``` +## Instana + +To send collected trace data to an [Instana](https://www.ibm.com/products/instana) endpoint, you'll need the `open-telemetry/exporter-instana` package. + +```shell +composer require open-telemetry/exporter-instana +``` + +This package allows for converting OpenTelemetry spans into Instana spans before sending them natively to the Instana backend. + +To open a transport you can do one of the following + +```php +$transport = new InstanaTransport('http://127.0.0.1:42699', 10); +$converter = new SpanConverter($transport->getUuid(), $transport->getPid()); +$instanaExporter = new SpanExporter($transport, $converter); +$tracerProvider = new TracerProvider( + new SimpleSpanProcessor($instanaExporter) +); +$tracer = $tracerProvider->getTracer('io.opentelemetry.contrib.php'); +``` + +or utilize the factory which loads the variables `OTEL_EXPORTER_INSTANA_ENDPOINT` and `OTEL_EXPORTER_INSTANA_TIMEOUT`. + +```php +$tracerProvider = new TracerProvider( + new SimpleSpanProcessor( + (new SpanExporterFactory)->create() + ) +); +$tracer = $tracerProvider->getTracer('io.opentelemetry.contrib.php'); +``` + ## Minimizing export delays Most PHP runtimes are synchronous and blocking. Sending telemetry data diff --git a/layouts/shortcodes/docs/languages/exporters/intro.md b/layouts/shortcodes/docs/languages/exporters/intro.md index 43cb2a6a7b6f..06fcaa84b5f1 100644 --- a/layouts/shortcodes/docs/languages/exporters/intro.md +++ b/layouts/shortcodes/docs/languages/exporters/intro.md @@ -2,7 +2,7 @@ [OpenTelemetry Collector](/docs/collector/) to make sure it's exported correctly. Using the Collector in production environments is a best practice. To visualize your telemetry, export it to a backend such as -[Jaeger](https://jaegertracing.io/), [Zipkin](https://zipkin.io/), +[Jaeger](https://jaegertracing.io/), [Zipkin](https://zipkin.io/), [Instana](https://www.ibm.com/products/instana), [Prometheus](https://prometheus.io/), or a [vendor-specific](/ecosystem/vendors/) backend.