Skip to content

Commit 440a5a5

Browse files
Update PHP manual instrumentation docs to reflect upstream 1.0.0beta changes (#507)
Co-authored-by: bryan-aguilar <[email protected]>
1 parent d6b1833 commit 440a5a5

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/docs/getting-started/php-sdk/trace-manual-instr.mdx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ composer require open-telemetry/sdk
5656
In order to use this package, you must also install the GRPC package using PECL. See the instructions on the [OpenTelemetry PHP repository](https://github.com/open-telemetry/opentelemetry-php#optional-dependencies) for more information.
5757

5858
```bash
59-
composer require open-telemetry/exporter-otlp-grpc
59+
composer require open-telemetry/exporter-otlp
60+
composer require open-telemetry/transport-grpc
6061
```
6162

6263
<SectionSeparator />
@@ -71,7 +72,10 @@ In order to send trace data to AWS X-Ray, instantiate a new tracer provider and
7172
```
7273
// Initialize Span Processor, X-Ray ID generator, Tracer Provider, and Propagator
7374
74-
$spanProcessor = new SimpleSpanProcessor(new OTLPExporter());
75+
$transport = (new GrpcTransportFactory())->create('http://127.0.0.1:4317' . OtlpUtil::method(Signals::TRACE));
76+
$exporter = new SpanExporter($transport);
77+
$spanProcessor = new SimpleSpanProcessor($exporter);
78+
7579
$idGenerator = new IdGenerator();
7680
$tracerProvider = new TracerProvider($spanProcessor, null, null, null, $idGenerator);
7781
$propagator = new Propagator();
@@ -137,26 +141,28 @@ Run the following command to import the AWS SDK Instrumentation:
137141

138142

139143
```
140-
composer require open-telemetry/opentelemetry-php-contrib:0.0.15
144+
composer require open-telemetry/contrib-aws:1.0.0beta3
141145
```
142146

143147

144148
Import the `AwsSdkInstrumentation` class in your PHP source code to activate the SDK instrumentation:
145149

146150

147151
```
148-
use OpenTelemetry\Instrumentation\AwsSdk\AwsSdkInstrumentation;
152+
use OpenTelemetry\Aws\AwsSdkInstrumentation;
149153
```
150154

151155

152156
Tracing support for downstream AWS SDK calls to Amazon DynamoDB, S3, and others is provided by the [OpenTelemetry PHP AWS SDK Instrumentation](https://github.com/open-telemetry/opentelemetry-php-contrib/tree/main/src/Instrumentation/AwsSdk). The example below demonstrates setting up the AWS SDK instrumentation and tracing a call to S3.
153157

154158

155159
```
156-
use OpenTelemetry\Instrumentation\AwsSdk\AwsSdkInstrumentation;
160+
use OpenTelemetry\Aws\AwsSdkInstrumentation;
157161

158162
// Initialize Span Processor, X-Ray ID generator, Tracer Provider, and Propagator
159-
$spanProcessor = new SimpleSpanProcessor(new OTLPExporter());
163+
$transport = (new GrpcTransportFactory())->create('http://127.0.0.1:4317' . OtlpUtil::method(Signals::TRACE));
164+
$exporter = new SpanExporter($transport);
165+
$spanProcessor = new SimpleSpanProcessor($exporter);
160166
$xrayIdGenerator = new IdGenerator();
161167
$tracerProvider = new TracerProvider($spanProcessor, null, null, null, $xrayIdGenerator);
162168
$xrayPropagator = new Propagator();

0 commit comments

Comments
 (0)