Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

OpenTelemetry Lambda Java Example

This repo contains a simple AWS Lambda Java function instrumented with OpenTelemetry.

Prerequisites

This example assumes you have the following:

It also assumes you have the following installed:

Run

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
cp collector.yaml .aws-sam/build/function/collector.yaml

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-java

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/

View your data in the New Relic UI

After invoking the function you should see newrelic-example-opentelemetry-lambda-java under Services - OpenTelemetry in your New Relic account.