Skip to content

Commit 7a373e5

Browse files
docs: fix README.md error & typo (#504)
1 parent 6bd0cf1 commit 7a373e5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

README.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -328,16 +328,20 @@ tracer_provider.force_flush()
328328

329329
### Consuming SQS messages with Boto3 receive_message
330330

331-
Messaging instrumentations that retrieve messages from queues tend to be counter-intuitive for end-users: when retrieving one of more messages from the queue, one would naturally expect that all calls done _using data from those messages_, e.g., sending their content to a database or another queue, would result in spans that are children of the describing the retrieving of those messages.
331+
Messaging instrumentations that retrieve messages from queues tend to be counter-intuitive for end-users: when retrieving one or more messages from the queue, one would naturally expect that all calls done _using data from those messages_, e.g., sending their content to a database or another queue, would result in spans that are children of the describing the retrieving of those messages.
332332

333333
Consider the following scenario, which is supported by the `boto3` SQS `receive_message` instrumentation of the Lumigo OpenTelemetry Distro for Python:
334334

335335
```python
336+
from opentelemetry import trace
337+
338+
tracer = trace.get_tracer(__name__)
339+
336340
response = client.receive_message(...) # Instrumentation creates a `span_0` span
337341

338342
for message in response.get("Messages", []):
339343
# The SQS.ReceiveMessage span is active in this scope
340-
with trace.start_as_current_span("span_1"): # span_0 is the parent of span_1
344+
with tracer.start_as_current_span("span_1"): # span_0 is the parent of span_1
341345
do_something()
342346
```
343347

0 commit comments

Comments
 (0)