You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### Issue 1 - Duplicate lambda root spans
The instrumentation produces 2 lambda root spans upon each invocation of
the function. This is a known issue in OTel:
open-telemetry/opentelemetry-java-instrumentation#7808
#### Fix
- Otel has fixed it in [this
PR](open-telemetry/opentelemetry-java-instrumentation#10736)
but the change wasn't ported to the 1.x versions. So I took the diff
from the upstream commit and made it into a patch that we apply when
building the ADOT Java Lambda Layer for v1.33.x.
### Issue 2 - Unsampled spans do not produce Application Signals metrics
On lambda environment, we export 100% of the spans to X-Ray to ensure we
are able to provide 100% Application Signals metrics. However, currently
only the sampled spans show up on the "Services" page and the unsampled
spans do not.
#### Fix
- Upon comparing the sampled vs unsampled spans, I noticed that the
unsampled spans are missing the attributes like `aws.local.service` and
`aws.local.operation` which are required to generate Application Signals
metrics.
- The fix is to wrap the `OtlpUdpSpanExporter` instance for unsampled
spans with the `AwsMetricAttributesSpanExporter` so that the exported
spans have the desired attributes.
#### Testing
- After creating a layer with the fix, I set the `OTEL_TRACES_SAMPLER`
to `always_off`. Then I invoked the function once.
- The metrics appeared on the Application Signals console.
- See the following screenshots
<img width="1722" alt="image"
src="https://github.com/user-attachments/assets/fa10e09f-ae24-4ab3-989f-838aacfb7e50"
/>
<img width="1722" alt="image"
src="https://github.com/user-attachments/assets/d777304f-2cd9-4348-8e29-74f4a8b6b917"
/>
*Description of changes:*
By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.
Copy file name to clipboardExpand all lines: awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/AwsApplicationSignalsCustomizerProvider.java
0 commit comments