This repo contains a simple AWS Lambda .NET function instrumented with OpenTelemetry.
This example assumes you have the following:
- A New Relic account. If you don't have one, create one for free.
- An AWS account. If you don't have one, create one for free.
- A New Relic license key from your New Relic account.
It also assumes you have the following installed:
Set the following environment variable:
export NEW_RELIC_LICENSE_KEY=<your license key here>
Replacing <your license key here>
with your New Relic license key.
Then build the example function:
sam build
Then deploy it to your AWS account:
sam deploy \
--capabilities CAPABILITY_NAMED_IAM \
--parameter-overrides "newRelicLicenseKey=${NEW_RELIC_LICENSE_KEY}" \
--resolve-s3 \
--stack-name newrelic-example-opentelemetry-lambda-dotnet
The deploy will output an apiEndpoint
which you can use to invoke the function:
curl https://xxxxxxxxxx.execute-api.us-east-1.amazonaws.com/api/
After invoking the function you should see newrelic-example-opentelemetry-lambda-dotnet
under Services - OpenTelemetry
in your New Relic account.