Skip to content

Commit e16a85b

Browse files
Update xray documentation (#743)
1 parent 8de0ccc commit e16a85b

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/docs/getting-started/x-ray.mdx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ By using OpenTelemetry SDK, we can add the customized attributes for each trace
214214
attributes will be converted into `metadata` attributes in X-Ray raw data. If we need to convert some or all OpenTelemetry attributes
215215
into X-Ray `annotation`, we can follow the steps below for enabling annotation conversion.
216216

217+
#### Enabling X-Ray annotations via the otel collector xray exporter config
217218
#### Step 1: create an attribute by using OpenTelemetry SDK
218219
For example:
219220
```
@@ -232,6 +233,22 @@ For all attributes to be indexed:
232233
awsxray:
233234
index_all_attributes: true
234235
```
236+
237+
#### Enabling X-Ray annotations via an otel sdk span attribute
238+
We can direct X-ray to annotate customized attributes of a span via otel span attributes.
239+
#### Step 1: create an attribute by using OpenTelemetry SDK
240+
For example:
241+
```
242+
setAttribute(“TransactionId”, <value>)
243+
setAttribute(“AccountId”, <value>)
244+
```
245+
*Note: More detailed instructions for adding attributes can be found in individual languages' guides*
246+
#### Step 2: direct xray to annotate these attributes
247+
For example:
248+
```
249+
setAttribute("aws.xray.annotations", List.of(“TransactionId”, “AccountId”))
250+
```
251+
*Note: More detailed instructions can be found here: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/awsxrayexporter
235252
<SectionSeparator />
236253

237254
## Configuring the OpenTelemetry Collector for X-Ray remote Sampling

0 commit comments

Comments
 (0)