From 7bd262130608ca4db9b2951768c25f371ff4d802 Mon Sep 17 00:00:00 2001 From: Jacob Affinito Date: Wed, 12 Jun 2024 11:20:31 -0700 Subject: [PATCH] feat: Add support for .NET agent lambdas using the layer. (#440) Co-authored-by: Alex Hemsath Co-authored-by: Alex Hemsath <57361211+nr-ahemsath@users.noreply.github.com> --- src/index.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/index.ts b/src/index.ts index 3396c6c..60ccd10 100644 --- a/src/index.ts +++ b/src/index.ts @@ -32,6 +32,9 @@ const wrappableRuntimeList = [ "java11", "java17", "java21", + "dotnet6", + "dotnet7", + "dotnet8", ]; export default class NewRelicLambdaLayerPlugin { @@ -538,6 +541,15 @@ or make sure that you already have Serverless 3.x installed in your project. environment.NEW_RELIC_SERVERLESS_MODE_ENABLED = "true"; } + // Uses same layer as CLI so the paths will be the same + if (runtime.match("dotnet")) { + environment.CORECLR_ENABLE_PROFILING = "1"; + environment.CORECLR_PROFILER = "{36032161-FFC0-4B61-B559-F6C5D41BAE5A}"; + environment.CORECLR_NEWRELIC_HOME = "/opt/lib/newrelic-dotnet-agent"; + environment.CORECLR_PROFILER_PATH = + "/opt/lib/newrelic-dotnet-agent/libNewRelicProfiler.so"; + } + const extensionDisabled = !_.isUndefined(this.config.enableExtension) && (this.config.enableExtension === "false" ||