Skip to content

Commit

Permalink
chore: Update lambda handler environment variable to match other Agen…
Browse files Browse the repository at this point in the history
…ts (#2485)
  • Loading branch information
chynesNR authored May 16, 2024
1 parent 79047db commit ccde882
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Agent/NewRelic/Home/Home.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</Target>

<ItemGroup>
<PackageReference Include="NewRelic.Agent.Internal.Profiler" Version="10.21.1.66"/>
<PackageReference Include="NewRelic.Agent.Internal.Profiler" Version="10.24.0.10"/>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ namespace NewRelic { namespace Profiler { namespace Configuration
return;
}

lambdaInstPoint = _systemCalls->TryGetEnvironmentVariable(_X("NEW_RELIC_LAMBDA_FUNCTION_HANDLER"));
lambdaInstPoint = _systemCalls->TryGetEnvironmentVariable(_X("NEW_RELIC_LAMBDA_HANDLER"));
if (lambdaInstPoint != nullptr)
{
AddInstrumentationPointToCollectionFromEnvironment(*lambdaInstPoint);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,12 @@ private static string GetHandlerMethodName()
}
private static string GetHandlerName()
{
var handlerName = Environment.GetEnvironmentVariable("NEW_RELIC_LAMBDA_FUNCTION_HANDLER") ??
var handlerName = Environment.GetEnvironmentVariable("NEW_RELIC_LAMBDA_HANDLER") ??
Environment.GetEnvironmentVariable("_HANDLER");

if (string.IsNullOrWhiteSpace(handlerName))
{
throw new Exception("The lambda handler is missing. Please ensure that the correct handler is defined in either the NEW_RELIC_LAMBDA_FUNCTION_HANDLER or _HANDLER environment variables.");
throw new Exception("The lambda handler is missing. Please ensure that the correct handler is defined in either the NEW_RELIC_LAMBDA_HANDLER or _HANDLER environment variables.");
}

return handlerName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public LambdaTestToolFixture(RemoteApplication remoteApplication, string newReli
SetAdditionalEnvironmentVariable("NEW_RELIC_ACCOUNT_ID", TestConfiguration.NewRelicAccountId);
SetAdditionalEnvironmentVariable("AWS_LAMBDA_RUNTIME_API", $"localhost:{LambdaTestTool.Port}");

AddAdditionalEnvironmentVariableIfNotNull("NEW_RELIC_LAMBDA_FUNCTION_HANDLER", newRelicLambdaHandler);
AddAdditionalEnvironmentVariableIfNotNull("NEW_RELIC_LAMBDA_HANDLER", newRelicLambdaHandler);
AddAdditionalEnvironmentVariableIfNotNull("_HANDLER", lambdaHandler);
AddAdditionalEnvironmentVariableIfNotNull("AWS_LAMBDA_FUNCTION_NAME", lambdaName);
AddAdditionalEnvironmentVariableIfNotNull("AWS_LAMBDA_FUNCTION_VERSION", lambdaVersion);
Expand Down

0 comments on commit ccde882

Please sign in to comment.