Skip to content

Commit 6577b88

Browse files
authored
Add new Lambda X-Ray samples (#226)
1 parent 54f20f0 commit 6577b88

24 files changed

+492
-9069
lines changed

lambda-xray/Makefile

Lines changed: 4 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,7 @@
1-
export AWS_ACCESS_KEY_ID ?= test
2-
export AWS_SECRET_ACCESS_KEY ?= test
3-
export AWS_DEFAULT_REGION=us-east-1
4-
5-
usage: ## Show this help
6-
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
7-
8-
install: ## Install dependencies
9-
@npm install
10-
@which serverless || npm install -g serverless
11-
@which localstack || pip install localstack
12-
@which awslocal || pip install awscli-local
13-
14-
run: ## Deploy the app locally and run a Lambda test invocation
15-
echo "Deploying Serverless app to local environment"; \
16-
SLS_DEBUG=1 npm run deploy && \
17-
echo "Serverless app successfully deployed. Now invoking the Lambda function to generate XRay traces." && \
18-
awslocal lambda invoke --function-name test-xray-local-hello /tmp/out.tmp; \
19-
TIME=$$(date +%s); \
20-
ID=$$(awslocal xray get-trace-summaries --start-time $$(($$TIME-120)) --end-time $$TIME | jq -r '.TraceSummaries[0].Id'); \
21-
awslocal xray batch-get-traces --trace-ids $$ID
22-
23-
start:
24-
localstack start -d
25-
26-
stop:
27-
@echo
28-
localstack stop
29-
ready:
30-
@echo Waiting on the LocalStack container...
31-
@localstack wait -t 30 && echo Localstack is ready to use! || (echo Gave up waiting on LocalStack, exiting. && exit 1)
32-
33-
logs:
34-
@localstack logs > logs.txt
1+
for-each-dir:
2+
../make-for-each.sh $$MAKE_TARGET $$CMD
353

364
test-ci:
37-
make start install ready run; return_code=`echo $$?`;\
38-
make logs; make stop; exit $$return_code;
39-
40-
.PHONY: usage install start run stop ready logs test-ci
5+
MAKE_TARGET='test-ci' make for-each-dir
416

7+
.PHONY: for-each-dir test-ci

lambda-xray/README.md

Lines changed: 0 additions & 72 deletions
This file was deleted.

lambda-xray/config.yml

Lines changed: 0 additions & 4 deletions
This file was deleted.

lambda-xray/handler.js

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)