aws / aws/aws-xray-sdk-node

Annotation not set for Lambda (not using Express)

Open
#222 7 comments 4 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
280
Forks
157
PR merge metrics
No merged PRs in 30d

Description

Hi.

In my lambda handler, I'm trying to set an annotation on a subsegment. I'm not using express.

```JavaScript
const sub = AWSXRay.getSegment().addNewSubsegment('my-handler')

// Rest of my code...

sub.addAnnotation('response', JSON.stringify(response))
```

I can't see this set anywhere though. What am I missing?

Thanks in advance.

Contributor guide

Open the contributing guide

Research direction

Start at the Lambda handler and trace AWSXRay.getSegment(), addNewSubsegment(), and addAnnotation() through the Node.js SDK, focusing on the non-Express path described here. Done means identifying why the annotation is not visible and confirming the expected annotation behavior for this handler.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, javascript, node.js
Domain
backend, cloud, observability-sre
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.