Skip to content

feat: Updated Lambda test for OTEL metrics verification - #379

Open
jsumners-nr wants to merge 3 commits into
mainfrom
lambda-metrics
Open

feat: Updated Lambda test for OTEL metrics verification#379
jsumners-nr wants to merge 3 commits into
mainfrom
lambda-metrics

Conversation

@jsumners-nr

Copy link
Copy Markdown
Contributor

This PR goes with newrelic/node-newrelic#4166. It updates the lambda-test such that we can use it to verify the New Relic Lambda extension forwards the otlp_payload correctly when the agent harvests. We are able to verify this by installing the agent from the linked branch and adding a debug line to lib/collector/serverless.js at 174:

process._rawDebug('!!! toFlush:', toFlush)

Upon running the container with the correct agent revision and the above debug line, we will see the data is being added correctly.

What is not clear at the moment is if the extension actually does anything with it. I don't have any data in my NR dashboard to indicate that it does at this time.

Note: we must wait to merge this PR until it can be updated with a newrelic version string that includes the required scaffolding.

@jsumners-nr
jsumners-nr marked this pull request as ready for review July 28, 2026 12:24
Comment thread lambda-test/Dockerfile Outdated
FROM nr-ext-${TARGETARCH} AS nr-ext

# This FROM clause specifies our actual base image.
FROM public.ecr.aws/lambda/nodejs:26

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ERROR: failed to build: failed to solve: public.ecr.aws/lambda/nodejs:26: failed to resolve source metadata for public.ecr.aws/lambda/nodejs:26: public.ecr.aws/lambda/nodejs:26: not found

lambda doesn't have support for node 26 yet

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.

Very strange. That was working last week, just with a "preview release" disclaimer.

Comment thread lambda-test/Dockerfile Outdated

@bizob2828 bizob2828 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not sure loading the extension is going to do anything. if so, we need to figure out how to get it to load telemetry, otherwise it's not very useful

@jsumners-nr

Copy link
Copy Markdown
Contributor Author

I'm not sure loading the extension is going to do anything. if so, we need to figure out how to get it to load telemetry, otherwise it's not very useful

Before attempting this approach I verified that the image AWS ships fully replicates the hosted Lambda environment and the API provided therein. The extension registers within the Docker container using the exact same API and exact same API registration points.

@jsumners-nr
jsumners-nr requested a review from bizob2828 July 28, 2026 16:02
@bizob2828

Copy link
Copy Markdown
Member

You may want to take a look at their repo https://github.com/newrelic/newrelic-lambda-extension, you may need to set additional env vars to get the extension to load data

@jsumners-nr

Copy link
Copy Markdown
Contributor Author

You may want to take a look at their repo newrelic/newrelic-lambda-extension, you may need to set additional env vars to get the extension to load data

I did that last week. The only missing environment variable was the license key. That has been added in this PR.

My statement about the dashboard above includes simply not knowing where to find Lambda data. I assume it would be under the target app's "distributed trace" data, but I never saw anything there. So I figure I'm missing some sort of Lambda whatever.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Needs PR Review

Development

Successfully merging this pull request may close these issues.

3 participants