Commit 470c0d1
authored
UDPExporter should be useable when Application Signals is disabled on Lambda (#148)
*Issue #, if available:*
Currently, if AppSignals is disabled, UDP Span Exporter not usable in
Lambda.
[According to this
comment](https://github.com/aws-observability/aws-otel-js-instrumentation/blob/v0.5.0/aws-distro-opentelemetry-node-autoinstrumentation/src/aws-opentelemetry-configurator.ts#L440-L443),
the correct logic should be:
>If isLambdaEnvironment is true, we will default to exporting OTel spans
via udp_exporter, regardless of whether AppSignals is true or false.
Currently, this is not respected because when AppSignals is disabled,
ADOT's otel config cannot use the UDPExporter
- Currently, the only difference between the `AppSignals enabled` and
`AppSignals disabled` configurations is that in the "disabled" case,
ADOT leaves the Span Exporter/Processor and textMapPropagator
initialization work to the OTel JS SDK. Only in `AppSignals enabled`
scenario, the configured UDPExporter is accessible.
*Description of changes:*
Update `configure()` to not depend on AppSignalsEnabled flag (always use
the Span Exporter/Processor and textMapPropagator configurations made
from the ADOT configurator)
- [Similarly to
Python](https://github.com/aws-observability/aws-otel-python-instrumentation/blob/v0.8.0/aws-opentelemetry-distro/src/amazon/opentelemetry/distro/aws_opentelemetry_configurator.py#L181),
always use the ADOT configured Span Exporter/Processor, which is already
configured based on the AppSignalsEnabled flag
- textMapPropagator configuration is still using [upstream's
configuration](https://github.com/aws-observability/aws-otel-js-instrumentation/blob/v0.5.0/aws-distro-opentelemetry-node-autoinstrumentation/src/aws-opentelemetry-configurator.ts#L163)
(includes the XRay Propagator)
*Testing:*
- Add Unit Test
- Test that spans are exported in Lambda when AppSignals is disabled
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 6036eb2 commit 470c0d1
File tree
2 files changed
+42
-30
lines changed- aws-distro-opentelemetry-node-autoinstrumentation
- src
- test
2 files changed
+42
-30
lines changedLines changed: 17 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
220 | 208 | | |
221 | 209 | | |
222 | 210 | | |
| |||
Lines changed: 25 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
13 | 19 | | |
14 | 20 | | |
15 | 21 | | |
| |||
457 | 463 | | |
458 | 464 | | |
459 | 465 | | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
460 | 484 | | |
461 | 485 | | |
462 | 486 | | |
| |||
0 commit comments