Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.

Commit b33db3f

Browse files
authored
Merge pull request #2184 from splunk/pwilliams-function-handler-example
Add JSON example to function handler step
2 parents 7207eb4 + 6e31d15 commit b33db3f

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

gdi/get-data-in/serverless/aws/otel-lambda-layer/instrumentation/dotnet-lambdas.rst

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,28 @@ To instrument a .NET function in AWS Lambda for Splunk APM, follow these steps:
8585
}
8686
}
8787
88-
2. Make sure that the new function handler ``TracingFunctionHandler`` is configured as the main entry point by editing the aws-lambda-tools-defaults.json file and changing the ``function-handler`` entry. You can also do this using the AWS web console, changing the handler in :guilabel:`Runtime settings`.
88+
2. Make sure that the main entry point is set to ``TracingFunctionHandler`` by updating the ``function-handler`` field in the ``aws-lambda-tools-defaults.json`` file to ``<project-name>::<class-namespace-with-class-name>::TracingFunctionHandler``. You can also do this using the AWS web console, by changing the handler in :guilabel:`Runtime settings`.
89+
90+
The following is an example of a ``aws-lambda-tools-defaults.json`` file with the function handler set to ``TracingFunctionHandler``. Don't paste the contents of the example into your file, as most of it won't match your environment. The part that must match is ``TracingFunctionHandler``.
91+
92+
.. code-block:: json
93+
94+
{
95+
"Information": [
96+
"This file provides default values for the deployment wizard inside Visual Studio and the AWS Lambda commands added to the .NET Core CLI.",
97+
"To learn more about the Lambda commands with the .NET Core CLI execute the following command at the command line in the project root directory.",
98+
"dotnet lambda help",
99+
"All the command line options for the Lambda command can be specified in this file."
100+
],
101+
"profile": "default",
102+
"region": "us-west-2",
103+
"configuration": "Release",
104+
"function-architecture": "x86_64",
105+
"function-runtime": "dotnet8",
106+
"function-memory-size": 512,
107+
"function-timeout": 30,
108+
"function-handler": "AWSLambdaSample::AWSLambdaSample.Function::TracingFunctionHandler"
109+
}
89110
90111
3. The template expects the following environment variables:
91112

0 commit comments

Comments
 (0)