Skip to content

Commit f64bfe0

Browse files
committed
docs(telemetry) Change order of exporters config section
1 parent f00c04a commit f64bfe0

File tree

1 file changed

+20
-20
lines changed
  • docs/user-guide/observability-evaluation

1 file changed

+20
-20
lines changed

docs/user-guide/observability-evaluation/traces.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,26 @@ os.environ["OTEL_TRACES_SAMPLER"] = "traceidratio"
283283
os.environ["OTEL_TRACES_SAMPLER_ARG"] = "0.5"
284284
```
285285

286+
### Custom Attribute Tracking
287+
288+
You can add custom attributes to any span:
289+
290+
```python
291+
agent = Agent(
292+
system_prompt="You are a helpful assistant that provides concise responses.",
293+
tools=[http_request, calculator],
294+
trace_attributes={
295+
"session.id": "abc-1234",
296+
"user.id": "user-email-example@domain.com",
297+
"tags": [
298+
"Agent-SDK",
299+
"Okatank-Project",
300+
"Observability-Tags",
301+
]
302+
},
303+
)
304+
```
305+
286306
### Configuring the exporters from source code
287307

288308
The `StrandsTelemetry().setup_console_exporter()` and `StrandsTelemetry().setup_otlp_exporter()` methods accept keyword arguments that are passed to OpenTelemetry's [`ConsoleSpanExporter`](https://opentelemetry-python.readthedocs.io/en/latest/sdk/trace.export.html#opentelemetry.sdk.trace.export.ConsoleSpanExporter) and [`OTLPSpanExporter`](https://opentelemetry-python.readthedocs.io/en/latest/exporter/otlp/otlp.html#opentelemetry.exporter.otlp.proto.http.trace_exporter.OTLPSpanExporter) initializers, respectively. This allows you to save the log lines to a file or set up the OTLP endpoints from Python code:
@@ -311,26 +331,6 @@ strands_telemetry.setup_otlp_exporter(
311331

312332
For more information about the accepted arguments, refer to `ConsoleSpanExporter` and `OTLPSpanExporter` in the [OpenTelemetry API documentation](https://opentelemetry-python.readthedocs.io).
313333

314-
### Custom Attribute Tracking
315-
316-
You can add custom attributes to any span:
317-
318-
```python
319-
agent = Agent(
320-
system_prompt="You are a helpful assistant that provides concise responses.",
321-
tools=[http_request, calculator],
322-
trace_attributes={
323-
"session.id": "abc-1234",
324-
"user.id": "user-email-example@domain.com",
325-
"tags": [
326-
"Agent-SDK",
327-
"Okatank-Project",
328-
"Observability-Tags",
329-
]
330-
},
331-
)
332-
```
333-
334334
## Best Practices
335335

336336
1. **Use appropriate detail level**: Balance between capturing enough information and avoiding excessive data

0 commit comments

Comments
 (0)