Commit 586504e
authored
Suppress appsignal metrics and attributes from boto3sqs spans (#127)
*Issue*
- Boto3 calls use botocore underneath and OTel offers instrumentation
for both libraries -
[boto3sqs](https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation/opentelemetry-instrumentation-boto3sqs)
(specifically SQS relates spans) and
[botocore](https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation/opentelemetry-instrumentation-botocore)
- For boto3 operations on SQS (send, receive, delete), we generate the
following set of spans:
- SendMessage: 1 PRODUCER span (from boto3sqs) + 1 CLIENT span (from
botocore) per operation
- ReceiveMessages: 1 CONSUMER receive span (from boto3sqs) per operation
+ 1 CONSUMER process span (from boto3sqs) per message received + 1
CLIENT span (from botocore) per operation
- DeleteMessage: 1 CLIENT span (from botocore) per operation
The above behavior causes the current logic to generate multiple
dependency metrics per operation whereas we want to to generate only 1
dependency metrics per operation.
*Note: the below image doesn't include the SendMessage operation so
there are no spans for it*
<img width="1707" alt="before"
src="https://github.com/aws-observability/aws-otel-python-instrumentation/assets/50466688/09ad0e1a-d69d-40c3-8e56-d796dd2f54e7">
*Description of changes:*
- Identify if the span is generated by the `boto3sqs` instrumentation by
checking the instrumentation scope.
- If yes, then we don't generate any service and dependency metrics from
such span. We also do not populate any `AWS_*` attribute on the span.
After making the changes, this is what the dependency metrics looks
like.
<img width="1812" alt="Screenshot 2024-03-27 at 2 48 59 PM"
src="https://github.com/aws-observability/aws-otel-python-instrumentation/assets/50466688/53a95217-3822-49e5-b7be-56208350f4aa">
By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.1 parent 0bf0163 commit 586504e
File tree
3 files changed
+68
-46
lines changed- aws-opentelemetry-distro
- src/amazon/opentelemetry/distro
- tests/amazon/opentelemetry/distro
3 files changed
+68
-46
lines changedLines changed: 14 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
| 23 | + | |
25 | 24 | | |
26 | 25 | | |
27 | 26 | | |
| |||
87 | 86 | | |
88 | 87 | | |
89 | 88 | | |
90 | | - | |
| 89 | + | |
91 | 90 | | |
92 | 91 | | |
93 | 92 | | |
94 | 93 | | |
95 | 94 | | |
96 | | - | |
97 | | - | |
| 95 | + | |
| 96 | + | |
98 | 97 | | |
99 | 98 | | |
100 | 99 | | |
| |||
118 | 117 | | |
119 | 118 | | |
120 | 119 | | |
121 | | - | |
122 | | - | |
123 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
124 | 127 | | |
125 | | - | |
126 | 128 | | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| |||
Lines changed: 35 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| |||
772 | 772 | | |
773 | 773 | | |
774 | 774 | | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
775 | 808 | | |
776 | 809 | | |
777 | 810 | | |
| |||
Lines changed: 19 additions & 30 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
307 | 307 | | |
308 | 308 | | |
309 | 309 | | |
310 | | - | |
311 | | - | |
| 310 | + | |
| 311 | + | |
312 | 312 | | |
313 | | - | |
| 313 | + | |
314 | 314 | | |
315 | | - | |
316 | | - | |
| 315 | + | |
| 316 | + | |
317 | 317 | | |
318 | 318 | | |
319 | 319 | | |
320 | | - | |
321 | | - | |
| 320 | + | |
322 | 321 | | |
323 | | - | |
| 322 | + | |
324 | 323 | | |
325 | 324 | | |
326 | | - | |
| 325 | + | |
| 326 | + | |
327 | 327 | | |
328 | 328 | | |
329 | 329 | | |
330 | | - | |
331 | | - | |
| 330 | + | |
332 | 331 | | |
333 | | - | |
| 332 | + | |
334 | 333 | | |
335 | 334 | | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
| 335 | + | |
349 | 336 | | |
350 | 337 | | |
351 | 338 | | |
| |||
358 | 345 | | |
359 | 346 | | |
360 | 347 | | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
365 | 355 | | |
366 | | - | |
367 | 356 | | |
368 | 357 | | |
369 | 358 | | |
| |||
0 commit comments