Code Monkey home page Code Monkey logo

newrelic-lambda-layers's Introduction

Community Plus header

New Relic Lambda Layers

This repository contains source code and utilities to build and publish New Relic's public AWS Lambda layers.

Most users should use our published layers which are chosen automatically via the CLI tool. Those layers are published to be public and are available here.

This tool is released for users seeking to deploy their own copies of the New Relic Lambda Layers into their accounts, or to modify and publish their own customized wrapper layers.

Requirements:

  • aws-cli
  • bash shell

The AWS cli must be configured, please refer to its documentation.

Publishing Layers:

To publish the layer, modify the runtime according to the options provided in the .publish-layers.sh script. Then, run the following command in your shell:

cd python
./publish-layers.sh python3.12 
cd ..
cd nodejs
./publish-layers.sh nodejs20x 
cd ..
cd ruby
./publish-layers.sh ruby3.3 
cd ..
cd java
./publish-layers.sh java21
cd ..
cd dotnet
./publish-layers.sh
cd ..
cd extension
./publish-layer.sh
cd ..

Attaching Custom Lambda Layer ARNs

The layers published to your account may be used directly within SAM, Cloudformation Templates, Serverless.yml, or other configuration methods that allow specifying the use of layers by ARN.

New Relic Serverless APM customers are advised to use the newrelic-lambda-cli tool, and this may be used with custom layers as follows by adding the --layer-arn flag to the layers install command:

newrelic-lambda layers install \
    --function <name or arn> \
    --nr-account-id <new relic account id>
    --layer-arn <YOUR_CUSTOM_LAYER_ARN>

Manual Instrumentation using Layers:

We recommend using the newrelic-lambda-cli tool, but some users find that they need, or prefer to manually configure their functions.

These steps will help you configure the layers correctly:

  1. Find the New Relic AWS Lambda Layer ARN that matches your runtime and region.
  2. Copy the ARN of the most recent AWS Lambda Layer version and attach it to your function.
  1. Update your functions handler to point to the newly attached layer in the console for your function:
  • Python: newrelic_lambda_wrapper.handler
  • Node: newrelic-lambda-wrapper.handler
  • Ruby: newrelic_lambda_wrapper.handler
  • Java:
    • RequestHandler implementation: com.newrelic.java.HandlerWrapper::handleRequest
    • RequestStreamHandlerWrapper implementation: com.newrelic.java.HandlerWrapper::handleStreamsRequest
  • .NET: This step is not required.
  1. Add these environment variables to your Lambda console:
  • NEW_RELIC_ACCOUNT_ID: Your New Relic account ID
  • NEW_RELIC_LAMBDA_HANDLER: Path to your initial handler.
  • NEW_RELIC_USE_ESM: For Node.js handlers using ES Modules, set to true.
  • CORECLR_ENABLE_PROFILING (.NET only): 1
  • CORECLR_PROFILER (.NET only): {36032161-FFC0-4B61-B559-F6C5D41BAE5A}
  • CORECLR_NEWRELIC_HOME (.NET only): /opt/lib/newrelic-dotnet-agent
  • CORECLR_PROFILER_PATH (.NET only): /opt/lib/newrelic-dotnet-agent/libNewRelicProfiler.so

Refer to the New Relic AWS Lambda Monitoring Documentation for instructions on completing your configuration by linking your AWS Account and Cloudwatch Log Streams to New Relic.

Support for ES Modules (Node.js)

AWS announced support for Node 18 as a Lambda runtime in late 2022, introducing aws-sdk version 3 for Node 18 only. This version of aws-sdk patches NODE_PATH, so ESM-supporting functions using import and top-level await should work as expected with Lambda Layer releases v9.8.1.1 and above (Numerical layer versions vary by region and runtime). To configure the layer to leverage import, add the environment variable NEW_RELIC_USE_ESM: true.

Note that if you use layer-installed instrumentation with the NEW_RELIC_USE_ESM environment variable, your function must use promises or async/await; callback based functions are not supported. The Node wrapper uses a dynamic import to attach to your function, which is an asynchronous operation. If you still need support for callback based functions, you will have to use the CommonJS based wrapper, which can be done by removing the NEW_RELIC_USE_ESM environment variable.

You may see some warnings from the Extension in CloudWatch logs referring to a non-standard handler; these warnings may be ignored.

If your Node functions use import and top-level await in Node 16 or Node 14 runtimes, layer-installed instrumentation will be unable to find imported modules, as import specifiers don't resolve with NODE_PATH. You can still instrument your functions with New Relic, but you will need to do the following:

  1. instrument your function manually using our Node Agent
  2. On deploying your function, don't set the function handler to our Node wrapper; instead, use your regular handler function, which you've wrapped with newrelic.setLambdaHandler().
  3. If you're using Node 18 or above, apply the latest Lambda Layer for your runtime. It will install both the Node agent and our Lambda Extension.
  4. If you're using Node 14 or Node 16, you will have to deploy our agent with your function code, but you could use our Extension-only Lambda Layer for delivering telemetry. Use our layer discovery website to find the ARN for your region. Look for either NewRelicLambdaExtension or NewRelicLambdaExtensionARM64 (depending on your function's architecture).
  5. Add your NEW_RELIC_LICENSE_KEY as an environment variable.

Note on performance for ES Module functions

In order to wrap ESM functions without a code change, our wrapper awaits the completion of a dynamic import. If your ESM function depends on a large number of dependency and file imports, you may see long cold start times as a result. As a workaround, we recommend instrumenting manually, following the instructions below.

Manual instrumentation for ES Modules

First import the New Relic Node agent into your handler file:

import newrelic from 'newrelic'

Then wrap your handler function using the .setLambdaHandler method:

export const handler = newrelic.setLambdaHandler(async (event, context) => {
    // TODO implement
    return {
        statusCode: 200,
        body: JSON.stringify('Hello from Lambda!')
    }
})

Support

Should you need assistance with New Relic products, you are in good hands with several support channels.

If the issue has been confirmed as a bug or is a feature request, please file a GitHub issue.

Support Channels

Privacy

At New Relic we take your privacy and the security of your information seriously, and are committed to protecting your information. We must emphasize the importance of not sharing personal data in public forums, and ask all users to scrub logs and diagnostic information for sensitive information, whether personal, proprietary, or otherwise.

We define “Personal Data” as any information relating to an identified or identifiable individual, including, for example, your name, phone number, post code or zip code, Device ID, IP address and email address.

Please review New Relic’s General Data Privacy Notice for more information.

Contribute

We encourage your contributions to improve the New Relic Lambda layers! Keep in mind when you submit your pull request, you'll need to sign the CLA via the click-through using CLA-Assistant. You only have to sign the CLA one time per project.

If you have any questions, or to execute our corporate CLA, required if your contribution is on behalf of a company, please drop us an email at [email protected].

A note about vulnerabilities

As noted in our security policy, New Relic is committed to the privacy and security of our customers and their data. We believe that providing coordinated disclosure by security researchers and engaging with the security community are important means to achieve our security goals.

If you believe you have found a security vulnerability in this project or any of New Relic's products or websites, we welcome and greatly appreciate you reporting it to New Relic through HackerOne.

If you would like to contribute to this project, review these guidelines.

To all contributors, we thank you! Without your contribution, this project would not be what it is today.

License

The New Relic Lambda layers are licensed under the Apache 2.0 License.

The New Relic Lambda layers also use source code from third-party libraries. You can find full details on which libraries are used and the terms under which they are licensed in the third-party notices document.

newrelic-lambda-layers's People

Contributors

bizob2828 avatar chaudharysaket avatar chynesnr avatar coreyarnold avatar dasunewrelic avatar deleonenriqueta avatar dependabot[bot] avatar engerim avatar ewindisch avatar fall1ngstar avatar fallwith avatar gliptak avatar hmstepanek avatar huonw avatar iamemilio avatar jaesius avatar jaffinito avatar jmartin4563 avatar jordigh avatar jtduffy avatar katiewest820 avatar kolanos avatar meiao avatar melissaklein24 avatar mrickard avatar musketyr avatar sunilbittu avatar timpansino avatar umaannamalai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

newrelic-lambda-layers's Issues

python `publish-layers.sh` requires python version as argument

Description

Running publish-layers.sh as described in readme fails as the python version (format: pythonX.Y) is a required parameter.

Once added, it fails due to missing md5sum. This can be resolved by running

$ brew install md5sha1sum

Both should be updated in the README.md

Steps to Reproduce

Follow instructions in README to run python publish-layers.sh and note error message:

$ cd python
$ ./publish-layers.sh
./publish-layers.sh: line 478: $1: unbound variable

After this, without md5sum installed, you will get:

$ ./publish-layers.sh python3.7
Building New Relic layer for python3.7 (x86_64)
##################################################################################################################################################################################### 100.0%##################################################################################################################################################################################### 100.0%
Archive:  extension.zip
 extracting: ./preview-extensions-ggqizro707
   creating: ./extensions/
  inflating: ./extensions/newrelic-lambda-extension
Build complete: dist/python37.x86_64.zip
./publish-layers.sh: line 172: md5sum: command not found

Expected Behaviour

Script should run without error

Relevant Logs / Console output

$ cd python
$ ./publish-layers.sh
./publish-layers.sh: line 478: $1: unbound variable
$ ./publish-layers.sh python3.7
Building New Relic layer for python3.7 (x86_64)
##################################################################################################################################################################################### 100.0%##################################################################################################################################################################################### 100.0%
Archive:  extension.zip
 extracting: ./preview-extensions-ggqizro707
   creating: ./extensions/
  inflating: ./extensions/newrelic-lambda-extension
Build complete: dist/python37.x86_64.zip
./publish-layers.sh: line 172: md5sum: command not found

Your Environment

Mac OS 12.2.1

Additional context

Node18 lambda layer requires ES Modules?

[NOTE]: We have decide to upgrade our lambdas from Node 16 to Node 18. We have applied the proper Lamdba Layer for Node 18. Once we do so, our lambdas no longer function due to an error. If we run in Node 16 (with the appropriate lambda layer), everything functions normally. All we did we tell our lambda to run in node 18 and apply the correct layer

Description

We took an existing lambda functioning that is using Node 16 and the right lambda layer for node 16 and ported it to Node 18 and the right lambda layer for node 18. No other code changed. We received the error below. Our js file is getDeal.js not getDeal.mjsWe use a default export of our handler

For node 16, we had this setup with NEW_RELIC_LAMBDA_HANDLER environment variable set to getDeal.default
image

For node 18, we have the same NEW_RELIC_LAMBDA_HANDLER environment variable set to getDeal.default with
image

(See error below)

Steps to Reproduce

  • Create a lambda not using es modules with an handler of yourlambda.js
  • Set the NEW_RELIC_LAMBDA_HANDLER variable to yourlambda.default since we use a default export for our handler
  • set the other environment variables NEW_RELIC_ACCOUNT_ID, NEW_RELIC_EXTENSION_SEND_FUNCTION_LOGS and NEW_RELIC_LAMBDA_EXTENSION_ENABLED as you normally would (in our case, both flags are true)
  • Set the Lambda runtime to Node 16 and set the layer to arn:aws:lambda:us-east-1:451483290750:layer:NewRelicNodeJS16X:46
  • Once you prove the lambda works then do the following:
  • change the runtime to Node 18
  • change the layer to ``

Expected Behaviour

Upgrading the runtime and then the corresponding NR Lambda Layer should allow the code to work

Relevant Logs / Console output

2023-03-29T13:14:44.756Z	undefined	ERROR	Unhandled Promise Rejection 	{
    "errorType": "Runtime.UnhandledPromiseRejection",
    "errorMessage": "Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/var/task/getDeal.mjs' imported from /opt/nodejs/node_modules/newrelic-lambda-wrapper/index.js",
    "reason": {
        "errorType": "Error",
        "errorMessage": "Cannot find module '/var/task/getDeal.mjs' imported from /opt/nodejs/node_modules/newrelic-lambda-wrapper/index.js",
        "code": "ERR_MODULE_NOT_FOUND",
        "stack": [
            "Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/var/task/getDeal.mjs' imported from /opt/nodejs/node_modules/newrelic-lambda-wrapper/index.js",
            "    at new NodeError (node:internal/errors:400:5)",
            "    at finalizeResolution (node:internal/modules/esm/resolve:331:11)",
            "    at moduleResolve (node:internal/modules/esm/resolve:994:10)",
            "    at moduleResolveWithNodePath (node:internal/modules/esm/resolve:938:12)",
            "    at defaultResolve (node:internal/modules/esm/resolve:1202:79)",
            "    at nextResolve (node:internal/modules/esm/loader:163:28)",
            "    at ESMLoader.resolve (node:internal/modules/esm/loader:842:30)",
            "    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)",
            "    at ESMLoader.import (node:internal/modules/esm/loader:525:22)",
            "    at importModuleDynamically (node:internal/modules/cjs/loader:1151:29)"
        ]
    },
    "promise": {},
    "stack": [
        "Runtime.UnhandledPromiseRejection: Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/var/task/getDeal.mjs' imported from /opt/nodejs/node_modules/newrelic-lambda-wrapper/index.js",
        "    at process.<anonymous> (file:///var/runtime/index.mjs:1188:17)",
        "    at process.emit (node:events:513:28)",
        "    at process.wrappedEmit [as emit] (/opt/nodejs/node_modules/newrelic/lib/instrumentation/core/globals.js:54:23)",
        "    at emit (node:internal/process/promises:149:20)",
        "    at processPromiseRejections (node:internal/process/promises:283:27)",
        "    at process.processTicksAndRejections (node:internal/process/task_queues:96:32)"
    ]
}

Your Environment

Lambda Node 16 and 18
commonjs

Compatibility with aws-cdk aws-lambda-nodejs

Summary

The AWS CDK NodejsFunction construct creates a Lambda function with automatic transpiling and bundling of TypeScript or Javascript code. https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda_nodejs-readme.html

It has a hardcoded handler parameter in the format of "index.{handler}", https://github.com/aws/aws-cdk/blob/5c40b90707b869f62e59613d50d5deaafbaa52f1/packages/%40aws-cdk/aws-lambda-nodejs/lib/function.ts#L114

This is incompatible with New Relic's Lambda Layer requiring to set the handler to "newrelic-lambda-wrapper".

Desired Behaviour

New Relic Lambda Layer compatible with NodejsFunction, with code like

const func = new NodejsFunction(this, 'myFunction', {
        handler: 'newrelic-lambda-wrapper.handler',
      });
func.addLayers(newRelicLayer);
func.addEnvironment('NEW_RELIC_ACCOUNT_ID', newRelicAccountId);
func.addEnvironment('NEW_RELIC_LAMBDA_HANDLER', 'handler');

Possible Solution A

Provide the newrelic-lambda-wrapper also as index.newrelic-lambda-wrapper for compatibility.

cp index.js $BUILD_DIR/node_modules/newrelic-lambda-wrapper

Easy to use.

Possible Solution B

Ask AWS to make the "index." part overrideable or configurable, and add documentation for that in the New Relic documentation.

Node lambda layer tries to access SSM for license key

Description

We have configured NodeJS lambdas with newrelic layer. We are using layer version arn:aws:lambda:eu-west-1:451483290750:layer:NewRelicNodeJS20XARM64:4. From CloudTrail events we can see that the layer tries to access SSM parameter NEW_RELIC_LICENSE_KEY, which fails because there's no such parameter and the lambda is not authorized to perform SSM requests. We are storing the license key in Secrets manager as instructed in the docs and it's working as expected.

SSM request in that case is unnecessary and undocumented, so it should be removed. Unnecessary requests consume the SSM quota, which is very limited by default, so extra requests should be avoided.

Steps to Reproduce

  1. Setup nodejs lambda with the layer
  2. Store License key in secrets manager as instructed
  3. Enable CloudTrail logs
  4. Invoke lambda
  5. Investigate CloudTrail logs and see that there's a failed request to SSM GetParameter.

Expected Behaviour

No unnecessary calls to SSM parameter store.

Relevant Logs / Console output

Successful secrets manager request:

{
    "eventVersion": "1.08",
    "userIdentity": {
        "type": "AssumedRole",
        "principalId": "***",
        "arn": "arn:aws:sts::***",
        "accountId": "***",
        "accessKeyId": "***",
        "sessionContext": {***}
    },
    "eventTime": "2024-02-02T08:47:59Z",
    "eventSource": "secretsmanager.amazonaws.com",
    "eventName": "GetSecretValue",
    "awsRegion": "eu-west-1",
    "sourceIPAddress": "***",
    "userAgent": "aws-sdk-go/1.44.288 (go1.19.11; linux; arm64)",
    "requestParameters": {
        "secretId": "NEW_RELIC_LICENSE_KEY"
    },
    "responseElements": null,
    "requestID": "***",
    "eventID": "***",
    "readOnly": true,
    "eventType": "AwsApiCall",
    "managementEvent": true,
    "recipientAccountId": "***",
    "vpcEndpointId": "***",
    "eventCategory": "Management"
}

Denied SSM request:

{
    "eventVersion": "1.08",
    "userIdentity": {
        "type": "AssumedRole",
        "principalId": "***",
        "arn": "arn:aws:sts::***",
        "accountId": "***",
        "accessKeyId": "***",
        "sessionContext": {***}
    },
    "eventTime": "2024-02-02T08:47:59Z",
    "eventSource": "ssm.amazonaws.com",
    "eventName": "GetParameter",
    "awsRegion": "eu-west-1",
    "sourceIPAddress": "***",
    "userAgent": "aws-sdk-go/1.44.288 (go1.19.11; linux; arm64)",
    "errorCode": "AccessDenied",
    "errorMessage": "User: arn:aws:sts::*** is not authorized to perform: ssm:GetParameter on resource: arn:aws:ssm:eu-west-1:***:parameter/NEW_RELIC_LICENSE_KEY because no identity-based policy allows the ssm:GetParameter action",
    "requestParameters": null,
    "responseElements": null,
    "requestID": "***",
    "eventID": "***",
    "readOnly": true,
    "eventType": "AwsApiCall",
    "managementEvent": true,
    "recipientAccountId": "***",
    "eventCategory": "Management"
}

Your Environment

NodeJS v20 Lambda with layer arn:aws:lambda:eu-west-1:451483290750:layer:NewRelicNodeJS20XARM64:4.

Additional context

Support for ESM Modules

Description

good morning....

We are using New Relic's Lambda Extension (layer) to report metrics back to NR. Everything is working great....

We now want to migrate our Node14 Lambdas from commonjs to esm . The lambdas are working well as ESM but as soon as I change the handler to newrelic-lambda-wrapper.handler to go through the New Relic Lambda Extension instead of directly (testEsm.default), the lambda fails.

Judging by the errors, it seems like it is using a cjs loader to try to load the default handler testEsm.default for instance and it says it does not exist.

Has anyone run into this and is there a way to use the New Relic Lambda Extension with ESM build NodeJs14 modules?

If this is the wrong channel, please let me know....

Steps to Reproduce

  • Build your lambda via ESM modules
  • Use the New Relic Lambda Extension Layer for Node 14
  • Change the handler from your handler (for instance testEsm.default) to newrelic-lambda-wrapper.handler
  • Make sure you have the proper env variables set to support the extension
    • NEW_RELIC_LAMBDA_EXTENSION_ENABLED
    • NEW_RELIC_LAMBDA_HANDLER (set to `testEsm.default in our case)
    • NEW_RELIC_ACCOUNT_ID set to our account

In cloudFormation when deploying, you will receive Provisioned Concurrency configuration failed to be applied. Reason: FUNCTION_ERROR_INIT_FAILURE. If you do this manually via the console, you will see

We are using this layer: arn:aws:lambda:us-east-1:451483290750:layer:NewRelicNodeJS14X:42

Expected Behavior

The default entry point should work through the Extension as it does if specified directly as the Handler. Changing the handler to testEsm.default in our case the lambda works when testing on the console.

Relevant Logs / Console output

Test Event Name
test

Response
{
  "errorType": "Error",
  "errorMessage": "Unable to import module 'testEsm'",
  "trace": [
    "Error: Unable to import module 'testEsm'",
    "    at getHandler (/opt/nodejs/node_modules/newrelic-lambda-wrapper/index.js:40:13)",
    "    at Object.<anonymous> (/opt/nodejs/node_modules/newrelic-lambda-wrapper/index.js:62:50)",
    "    at Module._compile (internal/modules/cjs/loader.js:1085:14)",
    "    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)",
    "    at Module.load (internal/modules/cjs/loader.js:950:32)",
    "    at Function.Module._load (internal/modules/cjs/loader.js:790:12)",
    "    at Module.require (internal/modules/cjs/loader.js:974:19)",
    "    at require (internal/modules/cjs/helpers.js:101:18)",
    "    at _tryRequire (/var/runtime/UserFunction.js:186:10)",
    "    at _loadUserApp (/var/runtime/UserFunction.js:197:12)"
  ]
}

Your Environment

  • AWS Lambda
  • NodeJS 14
  • Filename ends in mjs extension.

Additional context

NOTE: logger/logger is code to add data to console.log in a structured format. It is bundled with esbuild when deploying the lambda.

import { Handler, APIGatewayProxyEvent, APIGatewayProxyResult } from 'aws-lambda';
import { logger } from '../../logger/logger';
import { StatusCodes } from 'http-status-codes';

logger.addDefaultTags(['testEsm']);

// await a function here
const fn = async () => {
    logger.log({
        message: 'Starting fake sleep',
        meta: {}
    });

    return new Promise((resolve) => {
        logger.log({
            message: 'Resolving Promise',
            meta: {}
        });

        setTimeout(resolve, 3000);
    });
};

logger.log({
    message: 'Starting Await',
    meta: {}
});

await fn();

logger.log({
    message: 'Finishing Await',
    meta: {}
});

const handler: Handler<APIGatewayProxyEvent> = async (event, context): Promise<APIGatewayProxyResult> => {
    context.callbackWaitsForEmptyEventLoop = false;

    const { queryStringParameters, pathParameters, path, headers: requestHeaders } = event;

    // returns to api gateway
    const result: APIGatewayProxyResult = {
        statusCode: StatusCodes.NOT_FOUND,
        body: 'Not Found',
        headers: {
            'Content-Type': 'application/json'
        }
    };

    logger.log({
        message: 'NOT_FOUND',
        meta: { path, queryStringParameters, pathParameters, requestHeaders, result }
    });

    return result;
};

export default handler;

Layer for nodejs16.x runtime

Summary

AWS released their node 16 runtime over a week ago, we'd very much like to use it, but you still haven't released a lambda layer for that runtime.

Desired Behaviour

A layer exists for the node 16 runtime

Possible Solution

Build and publish a layer for the node16 runtime

Additional context

node 14 is no longer LTS, so we need to migrate away from it asap. AWS finally got their act together and released a node 16 runtime, but we're still blocked from migrating to it due to our heavy use of new relic lambda layers.

lambda layer: drop node 14

Is your feature request related to a problem? Please describe.

I'm not sure what needs to be done to drop support for Node 14 but this will serve as a placeholder

Add support for PHP

Feature Description

I know, at the moment AWS Lambda does NOT officially support PHP runtime but with the help of bref.sh one can in fact deploy PHP applications with serverless thus leveraging AWS Lambda functions.

In that situation, we certainly would like to be able to install the NewRelic PHP Agent inside the Lambda function, as a layer, so we can monitor our PHP applications.

Describe Alternatives

The obvious alternative is to use the generic AWS Lambda monitoring provided by NewRelic but we miss a ton of info related to PHP execution itself.

Alternatively, I suppose we can try to create our own custom Lambda layer containing the NewRelic PHP Agent. I don't even know if it is possible or if the Agent would work at all in this scenario. TBH I found this very project when I was searching for answers on the matter.

Additional context

N/A

Priority

Probably a "Must Have".

For people already using NewRelic like us and moving to a serverless architecture, we are in a position were we would loose NewRelic for PHP. This is not a blocker but we are definitely not happy with this perspective.

Large slowdowns in Python cold start times

Description

We recently upgraded our New Relic layers, and this appears to have resulted in a massive slow-down in our cold start times, with the time from AWS's START log line to "our code executing" going from 100-200ms to 5-10s, and this is entirely with New Relic.

For instance, we don't see this slowdown if we set the lambda to call our handler directly (not going via newrelic_lambda_wrapper.handler + NEW_RELIC_LAMBDA_HANDLER).

We're in ap-southeast-2 (Sydney), and are using layers like arn:aws:lambda:ap-southeast-2:451483290750:layer:NewRelicPython310:17. Comparing versions (i.e. changing 17) with a lambda with 256MB of memory, we find the interesting start times are:

version start time
17 5.5-5.6
16 5.5-5.6
15 6.8-7.3
14 7.2-7.5
13 10.0-10.1
... (similar)
8 ~10
7 ~1.4
... (similar)
2 ~1.5
1 0.1-0.2

In summary:

  • 1 -> 2: slow-down
  • 7 -> 8: slow-down
  • 13 -> 14: speed-up
  • 15 -> 16: speed-up

The final result is still a massive slowdown from where it used to be. This causes issues for us. For instance, lambda hooks for cognito have a strict 5 second time limit... and the initialisation time alone exceeds that, even without running any real code (we do use provisioned concurrency, but we want to have functional Lambdas, even if we get a spike in load that exceeds the provisioning).

When Amazon Cognito calls your Lambda function, it must respond within 5 seconds. If it doesn't and if the call can be retried, Amazon Cognito retries the call. After three unsuccessful attempts, the function times out. You can't change this five-second timeout value — https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html#important-lambda-considerationsl

Steps to Reproduce

  1. Create a large lambda (sorry, quite a lot of effort to narrow down the specifics, our lambdas include boto3 and sqlalchemy) with a new relic layer, that prints something as soon as the "real" code starts executing
  2. Invoke it
  3. BUG: observe there's a long time between AWS's START and the printing of the real code

Expected Behaviour

Start-up times like they used to be: a few milliseconds, not a few seconds.

Relevant Logs / Console output

Using one of the layers between version 8 and 13, with a lambda that has print("Starting function...") at the top of the real handler, the CloudWatch logs include something like:

2024-01-09T12:28:56.259+11:00	START RequestId: ad0b4e84-98db-46e3-96c6-f9f28b20e2b2 Version: $LATEST
2024-01-09T12:28:57.272+11:00	[NR_EXT] Sent 1/1 New Relic function log batches successfully with certainty in 517.487ms (516ms to transmit 0.3kB).
2024-01-09T12:29:06.353+11:00	Starting function...

Note how the start line is at 28:56.259 while the print happens at 29:06.353, more than 10s later.

Your Environment

AWS Lambda, Python 3.10, layer versions above.

Additional context

I imagine this may be caused by changes to the underlying agents, but I can't work out how to find the version of the agent that's included in a particular layer, e.g. it doesn't appear to be logged by the init routine.

https://forum.newrelic.com/s/hubtopic/aAXPh0000000cJpOAI/new-relic-python-lambda-layers-performance-has-regressed-massively

Enabling NR layer causes timeout

Description

When using same Lambda with NR extension enabled and disabled we can see drastic difference in billed duration.
With NR enabled all Lambdas are capped at 180 seconds which causes additional costs for user.

Steps to Reproduce

Use layer arn:aws:lambda:us-east-1:451483290750:layer:NewRelicNodeJS14X:85 with any Node Lambda.

Expected Behaviour

Using layer doesn't affect billed time drastically.

Relevant Logs / Console output

You can see time difference between last log from NR and request END.

  | 2023-03-03T17:44:42.552+01:00 | [NR_EXT] Sent 1/1 New Relic function log batches successfully in 69.411ms (69ms to transmit 0.4kB).
-- | -- | --
  | 2023-03-03T17:47:06.921+01:00 | END RequestId: 2a4c7a30-3328-4d68-99cf-f8a0e75039a9

Your Environment

Node 14x Lambda with layer arn:aws:lambda:us-east-1:451483290750:layer:NewRelicNodeJS14X:85

[Python] Handlers inside a PEP 420 namespaces aren't working

Handlers inside a PEP 420 namespaces aren't working

Description

When a lambda using this layer tries to load the handler that comes from a module included in a namespace, the import fails.
For example, if your handler is under "namespace.package.handler", an exception will be returned saying that "namespace" isn't a package.

The issue is most likely coming from

file_handle, pathname, desc = imp.find_module(segment, pathname)
as the modules are found and loaded using the "imp" module, which is deprecated since Python 3.4.

The module "importlib" should be used instead. That would most likely solve this issue + avoid the for loop "imp" requires to load sub-modules.

Steps to Reproduce

Define a handler that is inside a namespace (e.g. NEW_RELIC_LAMBDA_HANDLER=namespace.package.handler)
Run the lambda function.

Expected Behaviour

The NR layer should be able to import the handler and run the lambda.

Relevant Logs / Console output

Your Environment

Python3.9 (AWS Python runtime)

[Repolinter] Open Source Policy Issues

Repolinter Report

🤖This issue was automatically generated by repolinter-action, developed by the Open Source and Developer Advocacy team at New Relic. This issue will be automatically updated or closed when changes are pushed. If you have any problems with this tool, please feel free to open a GitHub issue or give us a ping in #help-opensource.

This Repolinter run generated the following results:

❗ Error ❌ Fail ⚠️ Warn ✅ Pass Ignored Total
0 0 0 7 0 7

Passed #

Click to see rules

license-file-exists #

Found file (LICENSE). New Relic requires that all open source projects have an associated license contained within the project. This license must be permissive (e.g. non-viral or copyleft), and we recommend Apache 2.0 for most use cases. For more information please visit https://docs.google.com/document/d/1vML4aY_czsY0URu2yiP3xLAKYufNrKsc7o4kjuegpDw/edit.

readme-file-exists #

Found file (README.md). New Relic requires a README file in all projects. This README should give a general overview of the project, and should point to additional resources (security, contributing, etc.) where developers and users can learn further. For more information please visit https://github.com/newrelic/open-by-default.

readme-starts-with-community-plus-header #

The first 5 lines contain all of the requested patterns. (README.md). The README of a community plus project should have a community plus header at the start of the README. If you already have a community plus header and this rule is failing, your header may be out of date, and you should update your header with the suggested one below. For more information please visit https://opensource.newrelic.com/oss-category/.

readme-contains-link-to-security-policy #

Contains a link to the security policy for this repository (README.md). New Relic recommends putting a link to the open source security policy for your project (https://github.com/newrelic/<repo-name>/security/policy or ../../security/policy) in the README. For an example of this, please see the "a note about vulnerabilities" section of the Open By Default repository. For more information please visit https://nerdlife.datanerd.us/new-relic/security-guidelines-for-publishing-source-code.

readme-contains-discuss-topic #

Contains a link to the appropriate discuss.newrelic.com topic (README.md). New Relic recommends directly linking the your appropriate discuss.newrelic.com topic in the README, allowing developer an alternate method of getting support. For more information please visit https://nerdlife.datanerd.us/new-relic/security-guidelines-for-publishing-source-code.

code-of-conduct-should-not-exist-here #

New Relic has moved the CODE_OF_CONDUCT file to a centralized location where it is referenced automatically by every repository in the New Relic organization. Because of this change, any other CODE_OF_CONDUCT file in a repository is now redundant and should be removed. Note that you will need to adjust any links to the local CODE_OF_CONDUCT file in your documentation to point to the central file (README and CONTRIBUTING will probably have links that need updating). For more information please visit https://docs.google.com/document/d/1y644Pwi82kasNP5VPVjDV8rsmkBKclQVHFkz8pwRUtE/view. Did not find a file matching the specified patterns. All files passed this test.

third-party-notices-file-exists #

Found file (THIRD_PARTY_NOTICES.md). A THIRD_PARTY_NOTICES.md file can be present in your repository to grant attribution to all dependencies being used by this project. This document is necessary if you are using third-party source code in your project, with the exception of code referenced outside the project's compiled/bundled binary (ex. some Java projects require modules to be pre-installed in the classpath, outside the project binary and therefore outside the scope of the THIRD_PARTY_NOTICES). Please review your project's dependencies and create a THIRD_PARTY_NOTICES.md file if necessary. For JavaScript projects, you can generate this file using the oss-cli. For more information please visit https://docs.google.com/document/d/1y644Pwi82kasNP5VPVjDV8rsmkBKclQVHFkz8pwRUtE/view.

Canada (Central) region missing latest version of layers

Description

I am deploying an AWS Lambda function on Node 14 to multiple AWS regions. I got the latest layer version from https://layers.newrelic-external.com/, and used the same version for all regions I was deploying in. However, deploying to the ca-central-1 region failed because it is a few builds behind on the Node 14 layer. Viewing the region on the layers site and comparing to other regions looks like several other layers are missing completely (no ARM64 layers) or out of date like Node 14.

Steps to Reproduce

Deploy a Lambda function with a layer of (terraform): "arn:aws:lambda:${data.aws_region.current.name}:451483290750:layer:NewRelicNodeJS14X:33"

This succeeds in multiple regions but fails in ca-central-1 because the latest version available is 31, not 33.

Expected Behaviour

The same layers should be available in all regions.

Relevant Logs / Console output

Your Environment

  • AWS Lambda
  • Node 14
  • Terraform
  • 5 global AWS regions

Additional context

[ERROR] Distribution Not Found

I deployed this week a new lambda with serverless-newrelic-lambda-layers plugin. When I run the Lambda i received the following error

...
 File "/opt/python/lib/python3.9/site-packages/newrelic/hooks/messagebroker_confluentkafka.py", line 60, in wrap_Producer_produce
    transaction.add_messagebroker_info("Confluent-Kafka", get_package_version("confluent-kafka"))
...

I already have a similar application and when I look for differences, the only one found was the newrelic lambda layer version.

On lambda that works the version was 30 and the lambda with erro, the version was 32. To solve I fixed the lambda arn to 30 and solve the problem.

newRelic:
  layerArn: arn:aws:lambda:us-east-1:451483290750:layer:NewRelicPython39:30

It works now, but the error on 32 remains.

I dont know if is related but we are using the serverless-python-requirements plugin with the following settings:

pythonRequirements:
  pythonBin: python3
  dockerizePip: non-linux
  zip: true

API Gateway 502 due to Lambda Proxy body is null

I've installed the serverless-newrelic-lambda-layers plugin in my nodejs18.x serverless project ensured i've set the NEW_RELIC_LAMBDA_HANDLER variable for each function and verified that the NR settings are working properly.

I'm running into a problem with API Gateway not receiving the body from my callback when using this integration.

Endpoint response body before transformations: null

It appears that statusCode is being passed through properly but for some reason the body parameter is being set to null.

I'm using async lambda handlers and returning like this:

  return {

    statusCode: 200,

    body: JSON.stringify({

        responseObj

    })

  };

When I remove the newrelic layer plugin and deploy the function it works as expected through the API Gateway lambda proxy set up. It seems like the way the newrelic layer/instrumentation within the newrelic-lambda-wrapper.handler isn't handling the body parameter properly. Is this a known issue? I've spent the past 2 days reading through all of your documentation, going through all of your github repos and searching issues and PRs and I cannot solve this for the life of me.

commit 63855c2 causes java.lang.NoClassDefFoundError

Description

The lambda will immediately fail after invocation.

Commit 63855c2 is part of #46.

This file has not been changed since Apr 23rd before that.

Steps to Reproduce

The bug only occurs in the latest version 8 of the Java11 layer.
After downgrading to the lambda version 7 everything worked fine again.

Expected Behaviour

Lambda version 8 of the Java11 layer should not produce this error and should not cause invocations to fail.

Relevant Logs / Console output

Error loading class com.newrelic.java.HandlerWrapper: io/opentracing/Tracer: java.lang.NoClassDefFoundError
java.lang.NoClassDefFoundError: io/opentracing/Tracer

Your Environment

  • Runtime: Java 11 (Corretto)
  • Framework: Quarkus
  • javaNewRelicHandler: handleStreamsRequest
  • layer: arn:aws:lambda:eu-west-1:451483290750:layer:NewRelicJava11:8

Java 21 Layer

Is your feature request related to a problem? Please describe.

AWS Lambda now supports Java 21 as a runtime, however no Java 21 NewRelic layer is available.

Feature Description

Provide a NewRelic layer which can be used with the java21 Lambda runtime.

Describe Alternatives

/

Additional context

/

Priority

Since this might block projects from moving to Java 21, I would consider this a "Must Have" or even "Blocker".

Adding permissions so layers can be publicly listed

Summary

Trying to perform any action that requires a ListLayerVersions API call returns a permissions error to do with a missing lambda:listLayerVersions policy.

This would be useful as it would allow fetching the latest layer.

Desired Behaviour

The ListLayerVersions operations should return New Relic's Lambda Layers information

Possible Solution

Adding the following policy to each layer should achieve this result:

Type: AWS::Lambda::LayerVersionPermission
Properties: 
  Action: lambda:listLayerVersions
  LayerVersionArn: !Ref LayerVersionArn
  Principal: *

Additional context

Apologies if this doesn't belong in this repository, more than happy to recreate it where it belongs.

We primarily use Terraform for infrastructure-as-code and, for APM instrumentation, we keep the layer ARN stored in SSM. This means that, every once in awhile, someone has to go and verify that lambda layer versions are up to date, and update them if they're not.

If the layers had this policy attached, this would simply be a matter of fetching the latest layer version in Terraform, via a data block reference, similarly to the functionality that exists when using the Serverless Framework plugin.

Newrelic instrumented lambdas are failing with /lib64/libc.so.6: version `GLIBC_2.34' not found

Newrelic instrumented lambdas are failing with /lib64/libc.so.6: version `GLIBC_2.34' not found

Description

2024-02-14T11:34:04.262-08:00	START RequestId: af74f517-4c8b-41e6-8998-6bfab44fdcd2 Version: $LATEST
2024-02-14T11:34:04.265-08:00	RequestId: af74f517-4c8b-41e6-8998-6bfab44fdcd2 Error: exit status 1 Extension.Crash
2024-02-14T11:34:04.265-08:00	END RequestId: af74f517-4c8b-41e6-8998-6bfab44fdcd2
2024-02-14T11:34:04.265-08:00	REPORT RequestId: af74f517-4c8b-41e6-8998-6bfab44fdcd2 Duration: 8.29 ms Billed Duration: 9 ms Memory Size: 1024 MB Max Memory Used: 3 MB
2024-02-14T11:34:04.370-08:00	/opt/extensions/newrelic-lambda-extension: /lib64/libc.so.6: version `GLIBC_2.34' not found (required by /opt/extensions/newrelic-lambda-extension)
2024-02-14T11:34:04.370-08:00	/opt/extensions/newrelic-lambda-extension: /lib64/libc.so.6: version `GLIBC_2.32' not found (required by /opt/extensions/newrelic-lambda-extension)
2024-02-14T11:34:04.370-08:00	EXTENSION Name: newrelic-lambda-extension State: Started Events: []
2024-02-14T11:34:04.370-08:00	INIT_REPORT Init Duration: 5.51 ms Phase: invoke Status: error Error Type: Extension.Crash 

serverless-newrelic-lambda-layers: ^5.0.0
runtime: provided.al2

Steps to Reproduce

Expected Behaviour

Run without a crash during startup.

Relevant Logs / Console output

See above.

Your Environment

serverless-newrelic-lambda-layers: ^5.0.0
runtime: provided.al2
arn:aws:lambda:us-east-1:451483290750:layer:NewRelicLambdaExtension:35

Additional context

Locking to arn:aws:lambda:us-east-1:451483290750:layer:NewRelicLambdaExtension:34 fixes the issue.

NR node lambda layer doesn't initialize function when using Provisioned Concurrency & fails to find handler when exported within promise

Description

When instrumenting node lambda function using the newrelic lambda layer, the layer wrapper doesn't initialize function before first request is received. This behaviour is the same even when we turn on Provisioned Concurrency, it initializes the newrelic lambda extension but doesn't initialize the function wrapped with newrelic-lambda-wrapper.handler.

Top level await Blog by AWS : Link

Related issue: We can minimize cold start with provisioned concurrency for CommonJS via initializing function first and exporting handler via Promise. This works on AWS Lambda without newrelic wrapper but fails when we use newrelic lambda wrapper

Issues:

  1. When module exports Promise which resolves handler wrapper fails to find handler. An AWS Lambda without the newrelic lambda layer works fine

  2. When using newrelic node lambda layer, it doesn't initialize function init code. This affects usage of provisioned concurrency.

Example handler code ESM

const sleep = ms => new Promise(resolve => setTimeout(resolve, ms))

console.log(Date.now() + ": start init");
await sleep(3000);
console.log(Date.now() + ": end init");

export function handler() {
  console.log(Date.now() + ": executing handler");
  return Promise.resolve({
    body: 'foo',
    statusCode: 200,
  })
}

Example handler code CommonJS

const sleep = ms => new Promise(resolve => setTimeout(resolve, ms))

async function init(){
    console.log(Date.now() + ": start init");
    await sleep(3000);
    console.log(Date.now() + ": end init");
}

function handler() {
    console.log(Date.now() + ": executing handler");
    return Promise.resolve({
        body: 'foo',
        statusCode: 200,
    })
}

const main = async () => {
    await init();
    return { handler };
};

module.exports = main();

Behaviour without Newrelic lambda layer

handler: dist/main.handler
Provisioned Concurrency Initialization log (5.35 seconds)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|   timestamp   |                                                                              message                                                                               |
|---------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 1697506346256 | INIT_START Runtime Version: nodejs:18.v13 Runtime Version ARN: arn:aws:lambda:us-east-1::runtime:98792929c89e9ef325cbf51e2dd60dd8cfb8a23a70f14859c5609e9c9ae8a094  |
| 1697506348599 | 2023-10-17T01:32:28.599Z undefined INFO 1697506348599: start init                                                                                                  |
| 1697506351605 | 2023-10-17T01:32:31.605Z undefined INFO 1697506351604: end init                                                                                                    |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
First Request with Provisioned Concurrency log (9.30 ms)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|   timestamp   |                                                                                message                                                                                 |
|---------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 1697506550230 | START RequestId: be00b478-faf1-4596-acd7-076346e06b15 Version: 13                                                                                                      |
| 1697506550231 | 2023-10-17T01:35:50.231Z be00b478-faf1-4596-acd7-076346e06b15 INFO 1697506550231: executing handler                                                                    |
| 1697506550239 | END RequestId: be00b478-faf1-4596-acd7-076346e06b15                                                                                                                    |
| 1697506550239 | REPORT RequestId: be00b478-faf1-4596-acd7-076346e06b15 Duration: 9.30 ms Billed Duration: 10 ms Memory Size: 128 MB Max Memory Used: 66 MB Init Duration: 5383.31 ms   |
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Second Request with Provisioned Concurrency log (1.60 ms)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|   timestamp   |                                                                                message                                                                                 |
|---------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 1697506552906 | START RequestId: 2f49ed3d-5196-4248-91d1-33ecf1afda37 Version: 13                                                                                                      |
| 1697506552906 | 2023-10-17T01:35:52.906Z 2f49ed3d-5196-4248-91d1-33ecf1afda37 INFO 1697506552906: executing handler                                                                    |
| 1697506552907 | END RequestId: 2f49ed3d-5196-4248-91d1-33ecf1afda37                                                                                                                    |
| 1697506552907 | REPORT RequestId: 2f49ed3d-5196-4248-91d1-33ecf1afda37 Duration: 1.60 ms Billed Duration: 2 ms Memory Size: 128 MB Max Memory Used: 67 MB                              |
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Steps to Reproduce (with newrelic lambda layer)

commonjs

NEW_RELIC_USE_ESM: false
NEW_RELIC_LAMBDA_HANDLER: dist/main.handler
handler: newrelic-lambda-wrapper.handler
Provisioned Concurrency Initialization log (9.30 seconds)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|   timestamp   |                                                                              message                                                                               |
|---------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 1697508381686 | INIT_START Runtime Version: nodejs:18.v13 Runtime Version ARN: arn:aws:lambda:us-east-1::runtime:98792929c89e9ef325cbf51e2dd60dd8cfb8a23a70f14859c5609e9c9ae8a094  |
| 1697508382729 | [NR_EXT] New Relic Lambda Extension starting up                                                                                                                    |
| 1697508382790 | [NR_EXT] Extension telemetry processing disabled                                                                                                                   |
| 1697508382790 | [NR_EXT] Starting no-op mode, no telemetry will be sent                                                                                                            |
| 1697508390989 | EXTENSION Name: newrelic-lambda-extension State: Ready Events: [INVOKE, SHUTDOWN]                                                                                  |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Request Failed (400.31 ms)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|   timestamp   |                                                                                                                                                                                                                                                                                message                                                                                                                                                                                                                                                                                 |
|---------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 1697508559990 | START RequestId: 1fc4140f-e86e-47c8-96ec-97668f46df17 Version: 15                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| 1697508560250 | 2023-10-17T02:09:20.250Z 1fc4140f-e86e-47c8-96ec-97668f46df17 INFO 1697508560250: start init                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| 1697508560252 | 2023-10-17T02:09:20.252Z 1fc4140f-e86e-47c8-96ec-97668f46df17 ERROR Invoke Error  {"errorType":"Error","errorMessage":"Handler 'handler' missing on module 'dist/main'","stack":["Error: Handler 'handler' missing on module 'dist/main'","    at validateHandlerDefinition (/opt/nodejs/node_modules/newrelic-lambda-wrapper/index.js:93:11)","    at importHandler (/opt/nodejs/node_modules/newrelic-lambda-wrapper/index.js:110:3)","    at async Runtime.patchESModuleHandler [as handler] (/opt/nodejs/node_modules/newrelic-lambda-wrapper/index.js:127:23)"]}  |
| 1697508560389 | END RequestId: 1fc4140f-e86e-47c8-96ec-97668f46df17                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| 1697508560389 | REPORT RequestId: 1fc4140f-e86e-47c8-96ec-97668f46df17 Duration: 400.31 ms Billed Duration: 401 ms Memory Size: 128 MB Max Memory Used: 99 MB Init Duration: 9302.64 ms                                                                                                                                                                                                                                                                                                                                                                                                |
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

ESM

NEW_RELIC_USE_ESM: true
NEW_RELIC_LAMBDA_HANDLER: dist/main.handler
handler: newrelic-lambda-wrapper.handler
Provisioned Concurrency initialization log (9.45 seconds)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|   timestamp   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      message                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
|---------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 1697505473563 | INIT_START Runtime Version: nodejs:18.v13 Runtime Version ARN: arn:aws:lambda:us-east-1::runtime:98792929c89e9ef325cbf51e2dd60dd8cfb8a23a70f14859c5609e9c9ae8a094                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| 1697505474637 | [NR_EXT] New Relic Lambda Extension starting up                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| 1697505474716 | [NR_EXT] Extension telemetry processing disabled                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| 1697505474716 | [NR_EXT] Starting no-op mode, no telemetry will be sent                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| 1697505483017 | EXTENSION Name: newrelic-lambda-extension State: Ready Events: [INVOKE, SHUTDOWN]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
First Request with Provisioned Concurrency log (3.68 seconds)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|   timestamp   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      message                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
|---------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 1697505690855 | START RequestId: 254e62f4-1827-46c3-88b6-0873e72fb372 Version: 12                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| 1697505691255 | 2023-10-17T01:21:31.255Z 254e62f4-1827-46c3-88b6-0873e72fb372 INFO 1697505691255: start init                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| 1697505694297 | 2023-10-17T01:21:34.297Z 254e62f4-1827-46c3-88b6-0873e72fb372 INFO 1697505694297: end init                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| 1697505694304 | 2023-10-17T01:21:34.304Z 254e62f4-1827-46c3-88b6-0873e72fb372 INFO 1697505694304: executing handler                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| 1697505694515 | [1,"NR_LAMBDA_MONITORING","H4sIAAAAAAAAA+1XW3PaRhT+Kx09g7T3i94cx67dSVJPcJIHT4ZZpDWoEZKyWtkmHv57jyRwTQLEl6TNQ80YlmX1ne9c95zbYG69SY03QXwbGFcEcfsem="]  |
| 1697505694535 | END RequestId: 254e62f4-1827-46c3-88b6-0873e72fb372                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| 1697505694535 | REPORT RequestId: 254e62f4-1827-46c3-88b6-0873e72fb372 Duration: 3680.39 ms Billed Duration: 3681 ms Memory Size: 128 MB Max Memory Used: 100 MB Init Duration: 9453.07 ms                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Second Request log (7 ms)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|   timestamp   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      message                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
|---------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 1697505859238 | START RequestId: d8076f0c-ed80-4983-abc2-27dd0965659a Version: 12                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| 1697505859240 | 2023-10-17T01:24:19.240Z d8076f0c-ed80-4983-abc2-27dd0965659a INFO 1697505859240: executing handler                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| 1697505859294 | [1,"NR_LAMBDA_MONITORING","H4sIAAAAAAAAA+1X23LiOBD9lS0/g5Bk3ey3TC6bVGWmUgvZeUhNUcIW4B1js7JMwqT4920ZyMKEy+YyMy"]                                                                                                                                                                                                                                                                  |
| 1697505859313 | END RequestId: d8076f0c-ed80-4983-abc2-27dd0965659a                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| 1697505859313 | REPORT RequestId: d8076f0c-ed80-4983-abc2-27dd0965659a Duration: 74.82 ms Billed Duration: 75 ms Memory Size: 128 MB Max Memory Used: 100 MB                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Expected behaviour with newrelic lambda layer

See below comment #185 (comment)

Relevant Logs / Console output

See below comment #185 (comment)

I need Ruby Runtime support

I heard that the president of New Relic is a Ruby lover.
I often use Ruby because it's easy to write scripts like lambda and it goes well with Ruby.
Please provide Runtime support.

Java support cannot be applied for method handles with not context parameter

Description

When the Java handler method only accepts one parameter (e.g.. for example implements java.util.function.Function) then NoSuchMethodException is called.

Steps to Reproduce

  1. Create a handler class such as following one
package example;

import java.util.function.Function;

public class MyHandler implements Function<String, String> {

    @Override
    public String apply(String input) {
        return "Hello" + input;
    }

}
  1. deploy the handler in a function using the New Relic layer and a NR handler example.MyHandler::apply

  2. trigger the function, for example with string World

  3. the following exception is logged

Error loading class com.newrelic.java.HandlerWrapper: java.lang.ExceptionInInitializerError
java.lang.ExceptionInInitializerError
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Unknown Source)
Caused by: java.lang.RuntimeException: Error occurred during initialization of javaClassLoader: java.lang.NoSuchMethodException: no such method: 
example.MyHandler.apply(Object,Context)Object/invokeVirtual
	at com.newrelic.java.HandlerWrapper.<clinit>(HandlerWrapper.java:33)
	... 2 more

Expected Behaviour

The handler is executed properly and returns the input event appended after Hello.

Relevant Logs / Console output

Your Environment

  • ex: Browser name and version:
  • ex: Operating System and version:

Additional context

NodeJS Agent version out of date

Is your feature request related to a problem? Please describe.

Startup check failed: Agent version out of date: v9.7.5, in order access up to date features please upgrade to the latest New Relic node layer that includes agent version v9.8.0

Feature Description

Use Dependabot or something like that to keep it up to date?

Priority

Really Want

Python `3.10` layer broken (`ImportModuleError`)

Description

When using the new Python 3.10 compatible new relic layer (e.g. arn:aws:lambda:eu-west-1:451483290750:layer:NewRelicPython310:1), our application fails. When deploying the python example and modifying the terraform code, I get the same error.

[ERROR] Runtime.ImportModuleError: Unable to import module 'newrelic_lambda_wrapper': Failed to import module 'app': No module named 'app'

Steps to Reproduce

Deploy the lambda python example with the newest new relic layer and python 3.10 (see also newrelic/newrelic-lambda-extension#157). Deployment then succeeds but testing fails with the above error.

Expected Behaviour

It should be able to import the module

Relevant Logs / Console output

[ERROR] Runtime.ImportModuleError: Unable to import module 'newrelic_lambda_wrapper': Failed to import module 'app': No module named 'app'

Your Environment

  • ex: Browser name and version:
  • ex: Operating System and version:

Additional context

Reduce boilerplate for build and publish scripts

Currently, new layers are built by triggering jobs in ./circleci/config.yml. After running tests, the CI jobs execute jobs defined in the project Makefile, which triggers build jobs in each language's publish-layers.sh file...which also references the top-level libBuild.sh for code-sharing.

There's a lot of repetition and boilerplate, and adding new runtimes requires updating all of the above files, as well as (for Node and Java) adding a Dockerfile for the new runtime in the dockerfiles directory.

Ideally, the process of adding a new version of a single runtime should involve just adding a new element to an array that these scripts can use to iterate, rather than copying and pasting boilerplate.

Update:

Publishing operations for Node and Java layers currently use the repo's Makefile and Docker images. The Python layers do not: instead, they include a step to install the awscli (using pip) and publish directly from the CI job. I'd recommend that we repeat this pattern for Node and Java, dispensing with the Makefile and Dockerfiles, reducing the number of updates needed when a new runtime is released.

Stop publishing Node 14 layers

The Node Agent drops Node 14 support with version 11. We should not publish new layers containing that or newer versions of the agent.

ESM Support for nodejs 18 aws layer

Is your feature request related to a problem? Please describe.

With the release of aws lambda node18, also the issue of loading es module with the node_path is solved as written down. here https://aws.amazon.com/de/blogs/compute/node-js-18-x-runtime-now-available-in-aws-lambda/

I played around with the js code of the lambda layer and made it work that the wrapper can handle mjs via import or js via require.
My question would be now before I write more code, and provide test cases for this. If you guys had other blockers for esm. for me it worked in both cases fine.

Below I have provided my changes as a patch, so that you can get an understanding of what I did.

Additional context

---
Index: nodejs/index.js
<+>UTF-8
===================================================================
diff --git a/nodejs/index.js b/nodejs/index.js
--- a/nodejs/index.js	(revision 3cdd1d29e776e547bc0e948392698afbdc65c280)
+++ b/nodejs/index.js	(date 1671193279371)
@@ -11,7 +11,6 @@
 }
 
 const newrelic = require('newrelic')
-
 function getHandlerPath() {
   let handler
   const { NEW_RELIC_LAMBDA_HANDLER } = process.env
@@ -35,21 +34,35 @@
   return { moduleToImport, handlerToWrap }
 }
 
-function requireHandler() {
-  const { LAMBDA_TASK_ROOT = '.' } = process.env
-  const { moduleToImport, handlerToWrap } = getHandlerPath()
-  let importedModule
+function handleRequireImportError(e, moduleToImport) {
+  if (e.code === 'MODULE_NOT_FOUND') {
+    return new Error(`Unable to import module '${moduleToImport}'`)
+  }
+  return e
+}
 
+async function getImportedModule(LAMBDA_TASK_ROOT, moduleToImport) {
   try {
-    importedModule = require(`${LAMBDA_TASK_ROOT}/${moduleToImport}`)
+    return require(`${LAMBDA_TASK_ROOT}/${moduleToImport}`)
   } catch (e) {
-    if (e.code === 'MODULE_NOT_FOUND') {
-      throw new Error(`Unable to import module '${moduleToImport}'`)
+    //require failed, it could be an es module, so we try to import as mjs since v18 aws allows it
+    if (e.code === 'MODULE_NOT_FOUND' && process.version.startsWith('v18')) {
+      try {
+        return await import(`${LAMBDA_TASK_ROOT}/${moduleToImport}.mjs`)
+      } catch (e) {
+        throw handleRequireImportError(e, moduleToImport);
+      }
     }
-    throw e
+
+    throw handleRequireImportError(e, moduleToImport);
   }
+}
 
-  const userHandler = importedModule[handlerToWrap]
+async function requireHandler() {
+  const { LAMBDA_TASK_ROOT = '.' } = process.env
+  const { moduleToImport, handlerToWrap } = getHandlerPath()
+
+  const userHandler = (await getImportedModule(LAMBDA_TASK_ROOT, moduleToImport))[handlerToWrap]
 
   if (typeof userHandler === 'undefined') {
     throw new Error(
@@ -66,13 +79,14 @@
   return userHandler
 }
 
-const wrappedHandler = newrelic.setLambdaHandler(requireHandler())
+async function patchedHandler() {
 
-
-function patchedHandler() {
   const args = Array.prototype.slice.call(arguments)
 
-  return wrappedHandler.apply(this, args)
+  return requireHandler().then(userHandler => {
+    return newrelic.setLambdaHandler(userHandler)
+  })
+      .then(wrappedHandler => wrappedHandler.apply(this, args));
 }
 
 module.exports = { handler: patchedHandler, getHandlerPath }

Priority

Must Have for easy esm support :)

Lambda handler method is implemented only in base class, Null Pointer Exception is thrown and New Relic Lambda layer doesn’t work.

Current New Relic Lambda Layer (java) doesn’t support following case;
NEW_RELIC_LAMBDA_HANDLER points to the MyHandler class that inherits the base class (HandlerBase). And the handler method is implemented in HandlerBase only. This means the handler method is NOT overridden on MyHandler.

Where the code the NullPointerException is thrown:

if (inputType.isAssignableFrom(Number.class) || inputType.isAssignableFrom(String.class)) {

Where the code why inpuType is null:

if (method.toString().contains(className) &&

The hander method is implemented in base class, then isUserHanderMethod() returns false.

Please see following source code as reference code to reproduce this issue.

MyHandler.java

public class MyHandler extends HandlerBase {
  //handler method is NOT implemented in this class.
}

HandlerBase.java

public abstract class HandlerBase  implements RequestHandler<APIGatewayProxyRequestEvent, APIGatewayProxyResponseEvent> {

    @Override
    public final APIGatewayProxyResponseEvent handleRequest(APIGatewayProxyRequestEvent input, Context context) {
        APIGatewayProxyResponseEvent res = new APIGatewayProxyResponseEvent();
        res.setStatusCode(200);
        res.setBody("OK");
        return res;
    }
}

"Cannot find module '/var/task/handler.mjs' imported from /opt/nodejs/node_modules/newrelic-lambda-wrapper/index.js"

Description

After updating runtime from Node16 to Node18, a handler that is processing SQS messages is failing.

Steps to Reproduce

  • Compile as commonjs.
  • Use layer 'arn:aws:lambda:eu-west-1:451483290750:layer:NewRelicNodeJS18X:13' or :16.
  • Run handler for SQS messages

Expected Behaviour

Function runs without errors

Relevant Logs / Console output

{
    "errorType": "Runtime.UnhandledPromiseRejection",
    "errorMessage": "Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/var/task/handler.mjs' imported from /opt/nodejs/node_modules/newrelic-lambda-wrapper/index.js",
    "reason": {
        "errorType": "Error",
        "errorMessage": "Cannot find module '/var/task/handler.mjs' imported from /opt/nodejs/node_modules/newrelic-lambda-wrapper/index.js",
        "code": "ERR_MODULE_NOT_FOUND",
        "stack": [
            "Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/var/task/handler.mjs' imported from /opt/nodejs/node_modules/newrelic-lambda-wrapper/index.js",
            "    at new NodeError (node:internal/errors:400:5)",
            "    at finalizeResolution (node:internal/modules/esm/resolve:331:11)",
            "    at moduleResolve (node:internal/modules/esm/resolve:994:10)",
            "    at moduleResolveWithNodePath (node:internal/modules/esm/resolve:938:12)",
            "    at defaultResolve (node:internal/modules/esm/resolve:1202:79)",
            "    at nextResolve (node:internal/modules/esm/loader:163:28)",
            "    at ESMLoader.resolve (node:internal/modules/esm/loader:842:30)",
            "    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)",
            "    at ESMLoader.import (node:internal/modules/esm/loader:525:22)",
            "    at importModuleDynamically (node:internal/modules/cjs/loader:1151:29)"
        ]
    },
    "promise": {},
    "stack": [
        "Runtime.UnhandledPromiseRejection: Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/var/task/handler.mjs' imported from /opt/nodejs/node_modules/newrelic-lambda-wrapper/index.js",
        "    at process.<anonymous> (file:///var/runtime/index.mjs:1188:17)",
        "    at process.emit (node:events:513:28)",
        "    at process.wrappedEmit [as emit] (/opt/nodejs/node_modules/newrelic/lib/instrumentation/core/globals.js:54:23)",
        "    at emit (node:internal/process/promises:149:20)",
        "    at processPromiseRejections (node:internal/process/promises:283:27)",
        "    at process.processTicksAndRejections (node:internal/process/task_queues:96:32)"
    ]
}

Your Environment

Lambda
Node 18
commonjs (not ESM)
"aws-sdk": "2.1321.0"

Additional context

HTTP API handlers work as expected.

New Relic handler throws error when wrapping handler in hidden file or directory (node.js)

When the new relic handler tries to execute a wrapped function in a hidden directory it throws an error.

Description

We are using the serverless-plugin-warmup to help minimize lambda cold starts. This plugin creates a hidden handler with the path .warmup/default/index.warmUp.

const parts = handler.split('.')
if (parts.length !== 2) {
throw new Error(
`Improperly formatted handler environment variable: ${handler}`
)
}

When the check on the above line runs, it detects that there are two periods in the path and then throws the error. It is techincally valid for a file path to contain multiple periods. as long as one is at the end and all others are prefixed with a forward slash. I believe a better check would be a regex similar to the following:

^(\.?[\w\-]+\/)*\.?[\w\-]+\.\w+$

Steps to Reproduce

Create a new relic wrapped function with a handler that uses a hidden folder or file

Expected Behaviour

The function executes

Relevant Logs / Console output

2022-07-07T14:10:41.265Z	undefined	ERROR	Uncaught Exception 	
{
    "errorType": "Error",
    "errorMessage": "Improperly formatted handler environment variable: .warmup/default/index.warmUp",
    "stack": [
        "Error: Improperly formatted handler environment variable: .warmup/default/index.warmUp",
        "    at getHandler (/opt/nodejs/node_modules/newrelic-lambda-wrapper/index.js:27:11)",
        "    at Object.<anonymous> (/opt/nodejs/node_modules/newrelic-lambda-wrapper/index.js:62:50)",
        "    at Module._compile (internal/modules/cjs/loader.js:1085:14)",
        "    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)",
        "    at Module.load (internal/modules/cjs/loader.js:950:32)",
        "    at Function.Module._load (internal/modules/cjs/loader.js:790:12)",
        "    at Module.require (internal/modules/cjs/loader.js:974:19)",
        "    at require (internal/modules/cjs/helpers.js:101:18)",
        "    at _tryRequire (/var/runtime/UserFunction.js:194:10)",
        "    at _loadUserApp (/var/runtime/UserFunction.js:215:12)"
    ]
}

Your Environment

Runtime: Node.js 14.x

[JAVA] Getting error "is RequestStreamHandler, use handleStreamsRequest"

Hello, I am deploying the spring boot application to AWS lambda using this

Then, I added the New Relic layer to the lambda. However, I am getting the "is RequestStreamHandler, use handleStreamsRequest instead" error message.

When I check the code it seems to me like it should be able to handle RequestStreamHandler

Can you tell me how can I make it work with RequestStreamHandler?

Error: parts.at is not a function

Description

Looks like there is an error in the latest version of the new relic nodejs lambda layer (version 67).

All of our lambdas using the new version pushed yesterday are now seeing the error parts.at is not a function

Relevant Logs / Console output

parts.at is not a function

at getHandler (/opt/nodejs/node_modules/newrelic-lambda-wrapper/index.js:32:31)

Your Environment

AWS lambda using the NewRelicNodeJS14X layer: arn:aws:lambda:ap-southeast-2:451483290750:layer:NewRelicNodeJS14X:67

eu-north-1.layers.newrelic-external.com not found

Tried to deploy a sls function with the layer in eu-north-1 and got this error:

Request Error ------------------------------------------

RequestError: Error: getaddrinfo ENOTFOUND eu-north-1.layers.newrelic-external.com
at new RequestError (/home/gostrega/github/sl_app/serverless/users/node_modules/request-promise-core/lib/errors.js:14:15)
at Request.plumbing.callback (/home/gostrega/github/sl_app/serverless/users/node_modules/request-promise-core/lib/plumbing.js:87:29)
at Request.RP$callback [as _callback] (/home/gostrega/github/sl_app/serverless/users/node_modules/request-promise-core/lib/plumbing.js:46:31)
at self.callback (/home/gostrega/github/sl_app/serverless/users/node_modules/request/request.js:185:22)
at Request.emit (events.js:315:20)
at Request.EventEmitter.emit (domain.js:485:12)
at Request.onRequestError (/home/gostrega/github/sl_app/serverless/users/node_modules/request/request.js:877:8)
at ClientRequest.emit (events.js:315:20)
at ClientRequest.EventEmitter.emit (domain.js:485:12)
at TLSSocket.socketErrorListener (_http_client.js:467:9)
at TLSSocket.emit (events.js:315:20)
at TLSSocket.EventEmitter.emit (domain.js:485:12)
at emitErrorNT (internal/streams/destroy.js:100:8)
at emitErrorCloseNT (internal/streams/destroy.js:68:3)
at processTicksAndRejections (internal/process/task_queues.js:84:21)

According to the documentation:
https://discuss.newrelic.com/t/lambda-troubleshooting-framework-general-knowledge-part-1/146356
eu-north-1 is supported

When NewRelic is down, the lambda (nodejs) falls in timeout and emits a slow response

In december 23' EU NewRelic servers had a severe outage, causing lambdas to timed out and reach the max concurrency limits of the AWS account. Our production applications became very slow and became down. We had to remove the newrelic layers on each lambda to resume the normal activity

Description

We are in eu-west-1 using the arn:aws:lambda:eu-west-1:451483290750:layer:NewRelicNodeJS18XARM64:57 within a serverless configuration

Steps to Reproduce

Put a hello world lambda in VPC, with a quick setup using the "serverless-newrelic-lambda-layers": "5.0.0"
The Security Group of the VPC must be void of rules (inbound and outbound), the aim is to reproduce the outage of the new relic servers.

extract the serverless.yml part

service: hello-world

plugins:
  - serverless-webpack
  - serverless-newrelic-lambda-layers

custom:
  newRelic:
    nrRegion: eu
    linkedAccount: xxxx
    accountId: xxxx
    apiKey: xxx
    enableIntegration: false
    enableExtension: true
    enableFunctionLogs: true
    debug: true
    logLevel: info
    enableExtensionLogs: false

provider:
  environment:
    REGION: eu-west-1
    NEW_RELIC_LICENSE_KEY: XXXXX

functions:
  TestNewRelic:
    handler: src/handler/test.handler
    role: !GetAtt LambdaVpcRole.Arn
    vpc:
      subnetIds: XXXXX
      securityGroupIds: 
      - { Ref: "SecurityGroupVpc" }
    events:
      - http:
          method: GET
          path: /testHW

the lambda code test.ts

export const handler = async () => {
    console.log('Some business stuff');

    return { statusCode: 200, body: 'Hello World' };
};

Expected Behaviour

This code must run within 50ms from the client, 5ms from the inside lambda like this.

2024-01-31T15:59:54.637+01:00 START RequestId: 000f0416-4591-4461-b12c-91cd8184aaea Version: $LATEST
2024-01-31T15:59:54.638+01:00 2024-01-31T14:59:54.638Z 000f0416-4591-4461-b12c-91cd8184aaea INFO Some business stuff
2024-01-31T15:59:54.642+01:00 END RequestId: 000f0416-4591-4461-b12c-91cd8184aaea
2024-01-31T15:59:54.642+01:00 REPORT RequestId: 000f0416-4591-4461-b12c-91cd8184aaea Duration: 4.81 ms Billed Duration: 5 ms Memory Size: 1024 MB Max Memory Used: 125 MB

To have those results i 've add the outbound rule All TCP 0.0.0.0/0 on the vpc security group

Relevant Logs / Console output

When removing the outbound rule, the client get the reponse with 1.2s and the lambda continues to run until the timeout plus a 2s penalty, and fail.

2024-01-31T16:05:23.899+01:00 | INIT_START Runtime Version: nodejs:18.v20 Runtime Version ARN: arn:aws:lambda:eu-west-1::runtime:8c909ba80c0363d759e5fc7f9aa6b9fd23ae563b082256816c4ccdcb11de3748
2024-01-31T16:05:23.977+01:00 | [NR_EXT] New Relic Lambda Extension starting up
2024-01-31T16:05:23.985+01:00 | LOGS Name: newrelic-lambda-extension State: Subscribed Types: [Platform, Function]
2024-01-31T16:05:24.627+01:00 | EXTENSION Name: newrelic-lambda-extension State: Ready Events: [INVOKE, SHUTDOWN]
2024-01-31T16:05:24.630+01:00 | START RequestId: b6200688-caa5-4623-86e4-9d7549b5f8b9 Version: $LATEST
2024-01-31T16:05:24.640+01:00 | 2024-01-31T15:05:24.640Z b6200688-caa5-4623-86e4-9d7549b5f8b9 INFO Some business stuff
2024-01-31T16:05:32.637+01:00 | 2024-01-31T15:05:32.637Z b6200688-caa5-4623-86e4-9d7549b5f8b9 Task timed out after 8.01 seconds
2024-01-31T16:05:32.637+01:00 | END RequestId: b6200688-caa5-4623-86e4-9d7549b5f8b9
2024-01-31T16:05:32.637+01:00 | REPORT RequestId: b6200688-caa5-4623-86e4-9d7549b5f8b9 Duration: 8007.69 ms Billed Duration: 6000 ms Memory Size: 1024 MB Max Memory Used: 108 MB Init Duration: 728.19 ms

Your environment

AWS, NodeJS 18.x, Typescript, layers 5.0.0, automatic wrapper

Additional context

  • How can be setup the internal timeout of the newrelic agent connexion, in order to be loosely-coupled with newrelic ?

Thanks in advance.

Support Lambda Response Streaming

Is your feature request related to a problem? Please describe.

AWS has released Response Streaming for Lambda. (https://aws.amazon.com/blogs/compute/introducing-aws-lambda-response-streaming/). When using Response Streaming and the NR Lambda Layer, the parameters passed to the handler when using awslambda.streamifyResponse does not match. This is because they added the responseStream in the middle of the parameters.

Feature Description

I would like NR Lambda Layer to be able to support Response Streaming

Describe Alternatives

Instrument the code manually

Incorrect error message when dependency module is not loading

It looks that the error handling of this function is a bit too harsh and obfuscating the actual error message. If a dependency that is included is missing, it will report that the entrypoint is missing instead of that module.

throw new Error(`Unable to import module '${moduleToImport}'`)

STR:

  • Make a nodejs 16 lambda which includes the aws-sdk v2 in the entrypoint file and use the new relic entrypoint
  • Swap over to nodejs 18 without updating the aws-sdk require. It will report that the entry file is missing while really in the background the 'aws-sdk' import is not possible because the nodejs 18 layer uses the aws-sdk v3.

Above scenario is working as expected when you include the entrypoint file directly in your lambda instead of the layers entry point.

.zip file location

Hi team

Is it possible to include a link to, or, provide us with a .zip file so we can upload the lambda layer manually?

Thanks

Using the layer without redirecting the handler

Summary

I am currently investigating different ways to integrate New Relic into our Node lambdas and I am very interested in using your layers. However the only documented method for using them involves redirecting the handler to the layer via the settings. We are already doing this with another layer integration and it looks like chaining layers (having one layer redirect to anothe) is not supported (at least it does not work). So my question is, is there another way to use the layer? Otherwise we are left with only the legacy integration.
NOTE: # ( Provide a brief overview of what the new feature is all about. )

Desired Behaviour

It would be nice If I could still use the layer without having the redirect the handler.

Possible Solution

I have not spent a ton of time researching if this is possible, but it looks like layers can be imported in node just like any other library. Would it be possible to use it similar to how the newrelic npm library is used?

const newrelicLayer = require('layer');
module.exports.handler = newrelicLayer.setLambdaHandler((event, context, callback) => {
...
});

Additional context

We are already redirecting the handler to another layer integration and cannot change that.

NEW_RELIC_LOG_LEVEL environment variable missing

Description

We have tried to use NewRelic layer version 6 for Node 12 with log level configured to debug but that configuration does not seem to work. When you downgrade to version 4 of published layer all works as expected.

Steps to Reproduce

Configure layer to arn:aws:lambda:eu-central-1:451483290750:layer:NewRelicNodeJS12X:6
Configure lambda environment variable to NEW_RELIC_LOG_LEVEL: trace
Navigate to cloudwatch logs no trace output.

Same applies to debug

Expected Behaviour

Trace / Debug log present in cloudwatch logs

Relevant Logs / Console output

N/A

Your Environment

N/A

Additional context

N/A

Python 3.7 layer broken (ImportModuleError)

When using the new Python 3.7 compatible new relic layer (e.g. arn:aws:lambda:eu-central-1:451483290750:layer:NewRelicPython37:10), our application fails. When deploying the Python example and modifying the terraform code, I get the same error.

Description

[ERROR] Runtime.ImportModuleError: Unable to import module 'newrelic_lambda_wrapper': Failed to import module: main Traceback (most recent call last):

Steps to Reproduce

Deploy the lambda python example with the newest new relic layer and python 3.7 (see also newrelic/newrelic-lambda-extension#157). Deployment then succeeds but testing fails with the above error.

Expected Behaviour

It should be able to import the module

Relevant Logs / Console output

[ERROR] Runtime.ImportModuleError: Unable to import module 'newrelic_lambda_wrapper': Failed to import module 'app': No module named 'app'

[Python] Lambda layer includes GLIBC_2.28

Description

Due to a dependency that includes cryptography as a dependency, the pip install build process will package cryptography into the lambda layer. This causes a conflict if the user additionally installs the cryptography library as part of their dependencies. The CI process uses circleci/python

Steps to Reproduce

Use latest Python lambda layer with a project that use cryptography library 38.x.

Expected Behaviour

Lambda function should run accordingly.

Relevant Logs / Console output

[ERROR] Runtime.ImportModuleError: Unable to import module 'newrelic_lambda_wrapper': Failed to import module 'lambda_function': /lib64/libc.so.6: version `GLIBC_2.28' not found (required by /var/task/cryptography/hazmat/bindings/_rust.abi3.so)Traceback (most recent call last): | [ERROR] Runtime.ImportModuleError: Unable to import module 'newrelic_lambda_wrapper': Failed to import module 'lambda_function': /lib64/libc.so.6: version `GLIBC_2.28' not found (required by /var/task/cryptography/hazmat/bindings/_rust.abi3.so) Traceback (most recent call last):

Your Environment

AWS Lambda Python 3.8

Docker image for our Python project: public.ecr.aws/sam/build-python3.8:latest

Additional context

We are using the smbclient library, but it's not entirely related to that library.

circleci/python:3.8 glibc version

circleci@5c2149770425:/$ apt info libc6-dev
Package: libc6-dev
Version: 2.31-13+deb11u2

[Repolinter] Open Source Policy Issues

Repolinter Report

🤖This issue was automatically generated by repolinter-action, developed by the Open Source and Developer Advocacy team at New Relic. This issue will be automatically updated or closed when changes are pushed. If you have any problems with this tool, please feel free to open a GitHub issue or give us a ping in #help-opensource.

This Repolinter run generated the following results:

❗ Error ❌ Fail ⚠️ Warn ✅ Pass Ignored Total
0 2 0 5 0 7

Fail #

readme-starts-with-community-plus-header #

The README of a community plus project should have a community plus header at the start of the README. If you already have a community plus header and this rule is failing, your header may be out of date, and you should update your header with the suggested one below. For more information please visit https://opensource.newrelic.com/oss-category/. Below is a list of files or patterns that failed:

  • README.md: The first 5 lines do not contain the pattern(s): Open source Community Plus header (see https://opensource.newrelic.com/oss-category).
    • 🔨 Suggested Fix: prepend the latest code snippet found at https://github.com/newrelic/opensource-website/wiki/Open-Source-Category-Snippets#code-snippet-2 to file

readme-contains-forum-topic #

Doesn't contain a link to the appropriate forum.newrelic.com topic (README.md). New Relic recommends directly linking the your appropriate forum.newrelic.com topic in the README, allowing developer an alternate method of getting support. For more information please visit https://nerdlife.datanerd.us/new-relic/security-guidelines-for-publishing-source-code.

Passed #

Click to see rules

license-file-exists #

Found file (LICENSE). New Relic requires that all open source projects have an associated license contained within the project. This license must be permissive (e.g. non-viral or copyleft), and we recommend Apache 2.0 for most use cases. For more information please visit https://docs.google.com/document/d/1vML4aY_czsY0URu2yiP3xLAKYufNrKsc7o4kjuegpDw/edit.

readme-file-exists #

Found file (README.md). New Relic requires a README file in all projects. This README should give a general overview of the project, and should point to additional resources (security, contributing, etc.) where developers and users can learn further. For more information please visit https://github.com/newrelic/open-by-default.

readme-contains-link-to-security-policy #

Contains a link to the security policy for this repository (README.md). New Relic recommends putting a link to the open source security policy for your project (https://github.com/newrelic/<repo-name>/security/policy or ../../security/policy) in the README. For an example of this, please see the "a note about vulnerabilities" section of the Open By Default repository. For more information please visit https://nerdlife.datanerd.us/new-relic/security-guidelines-for-publishing-source-code.

code-of-conduct-should-not-exist-here #

New Relic has moved the CODE_OF_CONDUCT file to a centralized location where it is referenced automatically by every repository in the New Relic organization. Because of this change, any other CODE_OF_CONDUCT file in a repository is now redundant and should be removed. Note that you will need to adjust any links to the local CODE_OF_CONDUCT file in your documentation to point to the central file (README and CONTRIBUTING will probably have links that need updating). For more information please visit https://docs.google.com/document/d/1y644Pwi82kasNP5VPVjDV8rsmkBKclQVHFkz8pwRUtE/view. Did not find a file matching the specified patterns. All files passed this test.

third-party-notices-file-exists #

Found file (THIRD_PARTY_NOTICES.md). A THIRD_PARTY_NOTICES.md file can be present in your repository to grant attribution to all dependencies being used by this project. This document is necessary if you are using third-party source code in your project, with the exception of code referenced outside the project's compiled/bundled binary (ex. some Java projects require modules to be pre-installed in the classpath, outside the project binary and therefore outside the scope of the THIRD_PARTY_NOTICES). Please review your project's dependencies and create a THIRD_PARTY_NOTICES.md file if necessary. For JavaScript projects, you can generate this file using the oss-cli. For more information please visit https://docs.google.com/document/d/1y644Pwi82kasNP5VPVjDV8rsmkBKclQVHFkz8pwRUtE/view.

Update New Relic Lambda Extension Dependency to 2.3.7+

Is your feature request related to a problem? Please describe.

newrelic/newrelic-lambda-extension#95

Feature Description

The New Relic Lambda Extension dependency has gotten a couple versions out of date. Update it to at least v2.3.7, so we can take advantage of loading license keys from Parameter Store.

Describe Alternatives

We need to manually publish our own build of the layer with the updated version, which doesn't seem ideal.

Additional context

Priority

Blocker

Startup check failed: Agent version out of date: v9.7.3

Startup check failed: Agent version out of date: v9.7.3

Description

After installing and bundling the NR agent via the layer, startup failed message being shown in every invocation.
Very confusing, taking into account that 9.7.3 was releasead a week ago.

As well, "startup failed" looks a lot more like a ERROR message other than Warning

Steps to Reproduce

Standard installation with Serverless

Expected Behaviour

Show it as warning or improve a version check logic, to allow bigger drift (major versions?).
Otherwise, this polutes the logs with a "failed" messages

Relevant Logs / Console output

"startup check failed: Agent version out of date: v9.7.3, in order access up to date features please upgrade to the latest New Relic node layer that includes agent version v9.7.4"

Your Environment

Node 14
Serverless

Java 17 layer

Is your feature request related to a problem? Please describe.

AWS Lambda now supports Java 17 as runtime, however no Java 17 NewRelic layer is available.

Feature Description

Provide a NewRelic layer which can be used with the java17 Lambda runtime.

Describe Alternatives

/

Additional context

/

Priority

Since this might block projects to move to Java 17, I would consider this a "Must Have" or even "Blocker".

Layer is a resource hog, requiring a large amount of memory for acceptable cold start

Description

The Lambda layer drastically slows down the cold starts of the Lambdas they're added to unless you increase the memory, by a lot.

Steps to Reproduce

To test, I created a Lambda function with this body as the body of the handler (Node.js). This Lambda was triggered by Api Gateway. As you can see, there's nothing going on in the function.

export const exampleMethod = (event, context) => {
   return { statusCode: 200 };
};

Here are some numbers using the above - these numbers are all for cold starts

  • 128mb - consistently took 30-35 seconds to complete - the API gateway endpoint always timed out (29s max timeout in AWS)
  • 256mb - consistently took about 15-17 seconds to complete
  • 512mb - consistently took about 7-9 seconds to complete
  • 1024mb - consistently took about 4-5 seconds to complete
  • 2048mb - consistently took about 3-4 seconds to complete
  • 4096mb - consistently took between 2 and 3 seconds to complete
  • 10240mb - consistently took between 2 and 3 seconds to complete

Without the layer installed, 128mb of memory finished a cold start in 2 seconds. 10240mb finished in 1.7 seconds.

Based on the above, anything that requires some level of performance will need a memory allocation somewhere between 2gbs and 4gbs or provisioned concurrency. These can both get expensive over time, especially when the function used to only require 128mbs.

Expected Behaviour

Something much faster without large amounts of resources.

If there is nothing that can be done to improve this, then your documentation should be updated to include increasing memory allocation as part of integrating. The documentation on the serverless plugin should also be updated (I know this is a separate repository).

Your Environment

  • Node.js 18
  • Deployed via Serverless Framework using the serverless-newrelic-lambda-layer plugin
  • Currently using version 38 of the NewRelic Lambda Layer
  • The project is an ESM project (not CommonJS)
  • Our config in the serverless file is below. We also have the NEW_RELIC_USE_ESM environment variable set.
    newRelic:
        accountId: ####
        trustedAccountKey: ####
        apiKey: ${ssm:/aws/reference/secretsmanager/NewRelicAPIKey}
        enableExtension: true
        enableIntegration: true
        enableFunctionLogs: true

ARM Support for New Relic Lambda Layers

Summary

Given AWS's recent announcement and easy configuration change to switch to ARM Graviton processors for Lambda, please could you look at cross-compiling the lambda layers to support these new ARM processors.

AWS Announcement: https://aws.amazon.com/blogs/aws/aws-lambda-functions-powered-by-aws-graviton2-processor-run-your-functions-on-arm-and-get-up-to-34-better-price-performance/

Desired Behaviour

That by re-configuring our lambdas for ARM support + using an ARM compatible New Relic Layer, we can continue using the lambda layer approach to monitor our lambdas.

Additional context

Currently when you change your function to ARM and have a New Relic Lambda Layer attached, the layer no longer functions to operate and an error is provided in your cloudwatch logs.

`2021-10-05T09:20:50.120+01:00 | EXTENSION Name: newrelic-lambda-extension State: LaunchError Events: [] Error Type: UnknownError
2021-10-05T09:20:50.120+01:00 | RequestId: a729c43f-194d--SNIP Error: fork/exec /opt/extensions/newrelic-lambda-extension: exec format error Extension.LaunchError

2021-10-05T09:21:49.760+01:00 | START RequestId: 9ded5d80-77f9--SNIP Version: $LATEST
2021-10-05T09:21:49.765+01:00 | EXTENSION Name: newrelic-lambda-extension State: LaunchError Events: [] Error Type: UnknownError
2021-10-05T09:21:49.765+01:00 | END RequestId: 9ded5d80-77f9-SNIP
2021-10-05T09:21:49.765+01:00 | REPORT RequestId: 9ded5d80-77f9-SNIP Duration: 2.89 ms Billed Duration: 3 ms Memory Size: 512 MB Max Memory Used: 3 MB`

Thanks :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.