Every Sumo Logic Lambda Layer can be tested with the following sample applications provided by OpenTelemetry Lambda.
-
Checkout repository
git clone --recurse-submodules https://github.com/SumoLogic/sumologic-otel-lambda.git
-
Download sample application function code
-
javawget https://github.com/SumoLogic/sumologic-otel-lambda/releases/download/java-v1.30.1/java-sample-app.jar -o java/sample-apps/java-sample-app.jar
-
nodejswget https://github.com/SumoLogic/sumologic-otel-lambda/releases/download/nodejs-v1.17.1/nodejs-sample-app.zip -o nodejs/sample.zip unzip nodejs/sample.zip -d nodejs/sample-apps
-
pythonwget https://github.com/SumoLogic/sumologic-otel-lambda/releases/download/python-v1.20.0/python-sample-app.zip -o python/sample.zip unzip python/sample.zip -d python/sample-apps
-
-
Unzip downloaded code
In one of the directories
nodejsorpythonunzip the sample application running. Note: omit step ifjava.cd sample-apps unzip function.zip -d sample_function -
Set Sumo Logic HTTP Traces Source URL and AWS Region
export SUMO_OTLP_HTTP_ENDPOINT_URL=https://YOUR_OTLP_HTTP_SOURCE_URL export AWS_REGION=YOUR_AWS_REGION
-
Deploy sample application lambda function
For
nodejsandpythonexecute:sam build -u && sam deploy --stack-name sumo-logic-example-function \ --template template.yaml \ --parameter-overrides ParameterKey=SumoHttpTracesSourceUrl,ParameterValue=${SUMO_OTLP_HTTP_ENDPOINT_URL} \ --capabilities CAPABILITY_IAM \ --region ${AWS_REGION} \ --resolve-s3
For
javaexecute:sam deploy --stack-name sumo-logic-example-function \ --template template.yaml \ --parameter-overrides ParameterKey=SumoHttpTracesSourceUrl,ParameterValue=${SUMO_OTLP_HTTP_ENDPOINT_URL} \ --capabilities CAPABILITY_IAM \ --region ${AWS_REGION} \ --resolve-s3
-
Invoke function
After successful deployment of the sample lambda function, the
SampleAppApiEndpointshould be displayed. Please use its value as URL.curl SampleAppApiEndpointValue