Skip to content

fix(otel): Align span attributes and log enrichment with cross-SDK spec#519

Merged
ayushiahjolia merged 1 commit into
mainfrom
fix/otel-align-span-attributes
Jul 9, 2026
Merged

fix(otel): Align span attributes and log enrichment with cross-SDK spec#519
ayushiahjolia merged 1 commit into
mainfrom
fix/otel-align-span-attributes

Conversation

@ayushiahjolia

@ayushiahjolia ayushiahjolia commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Issue Link, if available

#518

Description

Aligns the Java OTel plugin's span attributes and log enrichment with the JS and Python SDKs.

Demo/Screenshots

Screenshot 2026-07-06 at 3 21 22 PM Screenshot 2026-07-06 at 3 21 57 PM Screenshot 2026-07-06 at 3 22 09 PM

Checklist

  • I have filled out every section of the PR template
  • I have thoroughly tested this change

Testing

Unit Tests

Have unit tests been written for these changes? Updated

Integration Tests

Have integration tests been written for these changes? N/A

Examples

Has a new example been added for the change? (if applicable) N/A

@ayushiahjolia ayushiahjolia changed the title Fix/otel align span attributes fix(otel): Align span attributes and log enrichment with cross-SDK spec Jul 6, 2026
@ayushiahjolia
ayushiahjolia force-pushed the fix/otel-align-span-attributes branch 2 times, most recently from b10aca8 to dfccb12 Compare July 8, 2026 17:19
@ayushiahjolia
ayushiahjolia marked this pull request as ready for review July 8, 2026 17:42
@ayushiahjolia
ayushiahjolia requested a review from a team July 8, 2026 17:42
Comment thread otel-plugin/src/main/java/software/amazon/lambda/durable/otel/OtelPlugin.java Outdated
Comment thread otel-plugin/README.md
@ayushiahjolia
ayushiahjolia force-pushed the fix/otel-align-span-attributes branch from dfccb12 to aea3713 Compare July 8, 2026 19:52
@ayushiahjolia
ayushiahjolia force-pushed the fix/otel-align-span-attributes branch from aea3713 to 162548b Compare July 8, 2026 20:01
// Skip attempt spans for CONTEXT operations — they are a scoping construct, not a
// retriable unit of work, so attempt number/outcome attributes don't apply.
// The operation span itself provides parent context for auto-instrumented calls.
if ("CONTEXT".equals(info.type())) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

context spans are still created in onOperationStart?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, added intentionally. The makeCurrent() here is for auto-instrumented calls (HTTP clients, SDK calls). Without it, those spans would parent under the invocation span instead of the CONTEXT operation span.

@ayushiahjolia
ayushiahjolia merged commit a2cf0d9 into main Jul 9, 2026
18 of 22 checks passed
@ayushiahjolia
ayushiahjolia deleted the fix/otel-align-span-attributes branch July 9, 2026 04:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants