-
Notifications
You must be signed in to change notification settings - Fork 67
Description
name: Bug report
about: Create a report to help us improve
title: 'ADOT lambda layer does not set AWS X-Ray-specific annotations for undici'
labels: bug
assignees: ''
Describe the bug
Making requests using Node.js's fetch sets AWS X-Ray-specific annotations as:
aws.remote.service=UnknownRemoteServiceaws.remote.operation=UnknownRemoteOperation
Making requests using nodejs:https module correctly sets aws.remote.service and aws.remote.operation.
Steps to reproduce
- Create a Node.js lambda function that uses ADOT lambda layer.
- Set environment variable
OTEL_NODE_ENABLED_INSTRUMENTATIONS=aws-sdk,aws-lambda,http,undici. - You can use this code for your lambda implementation:
index.mjs
export async function handler() {
const traceIdEnv = process.env._X_AMZN_TRACE_ID
const traceId = traceIdEnv.split(';')[0].split('=')[1]
const response = await fetch('https://jsonplaceholder.typicode.com/todos/2')
const data = await response.json()
console.log('Status API response:', data)
return {
statusCode: 200,
body: JSON.stringify({ traceId }),
}
}- Go to the X-Ray trace.
What did you expect to see?
I expect aws.remote.service and aws.remote.operation to be set correctly.
What did you see instead?
aws.remote.service and aws.remote.operation are set to UnknownRemoteService and UnknownRemoteOperation respectively.
What version of collector/language SDK version did you use?
No SDK, just the lambda layer
What language layer did you use?
Config: Node.js 22.x, layer arn:aws:lambda:us-east-1:615299751070:layer:AWSOpenTelemetryDistroJs:10
Additional context
empty
