2

I am running lambda in AWS and enabled xray. Below is a code I use to create a subsegment inside lambda. I can see this subsegment when I click a trace. How can I search all traces with this subsegment by name in xray console?

await AWSXRay.captureAsyncFunc('create-connection', async () => {
...

1 Answer 1

1

In the X-Ray console, you can only search for traces with segment names as each segment typically represents a service. Subsegment names searches are not supported.

What you can do instead is add an annotation to the created subsegment. Something like this should work:

await AWSXRay.captureAsyncFunc('create-connection', function(subsegment) => {
  subsegment.addAnnotation("mykey", "my value");
  ...

Since annotations are indexed, in the X-Ray console you can search traces with annotation like annotation.mykey = "my value"

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.