Skip to content

Commit

Permalink
docs: fix README.md error & typo
Browse files Browse the repository at this point in the history
  • Loading branch information
sagivoululumigo committed Sep 26, 2023
1 parent 6bd0cf1 commit f45dbe4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,16 +328,20 @@ tracer_provider.force_flush()

### Consuming SQS messages with Boto3 receive_message

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.
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.

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

```python
from opentelemetry import trace

tracer = trace.get_tracer(__name__)

response = client.receive_message(...) # Instrumentation creates a `span_0` span

for message in response.get("Messages", []):
# The SQS.ReceiveMessage span is active in this scope
with trace.start_as_current_span("span_1"): # span_0 is the parent of span_1
with tracer.start_as_current_span("span_1"): # span_0 is the parent of span_1
do_something()
```

Expand Down

0 comments on commit f45dbe4

Please sign in to comment.