File tree Expand file tree Collapse file tree 3 files changed +14
-18
lines changed
Monitoring-Debugging/Tracing-with-X-Ray Expand file tree Collapse file tree 3 files changed +14
-18
lines changed Original file line number Diff line number Diff line change 11# Tracing with X-Ray
22
3- ## Create SSM Parameter
4-
5- ``` sh
6- aws ssm put-parameter --type String --name " /dev/example/table_name" --value " Flask"
7- ```
8-
93## Create DynamoDB Table
104
115Create table ` Flask ` with primary partition key ` key ` :
@@ -17,7 +11,7 @@ aws dynamodb create-table --table-name Flask \
1711 --billing-mode=PAY_PER_REQUEST
1812```
1913
20- ## Configure Zappa
14+ ## Configure [ Zappa] ( https://github.com/Miserlou/Zappa )
2115
2216``` sh
2317cd example
@@ -26,6 +20,17 @@ pipenv shell
2620pipenv install aws-xray-sdk flask zappa requests
2721pipenv lock -r > requirements.txt
2822zappa init
23+ ```
24+
25+ Add the following property to ` zappa_settings.json ` :
26+
27+ ``` json
28+ "xray_tracing" : true
29+ ```
30+
31+ Deploy the application:
32+
33+ ``` sh
2934zappa deploy
3035```
3136
Original file line number Diff line number Diff line change 2424
2525# Boto3 resources
2626dynamodb = boto3 .resource ('dynamodb' )
27- ssm = boto3 .client ('ssm' )
28-
29- table_param = ssm .get_parameter (Name = '/dev/example/table_name' )
30- table_name = table_param ['Parameter' ]['Value' ]
31- table = dynamodb .Table (table_name )
27+ table = dynamodb .Table ('Flask' )
3228
3329
3430@app .route ('/' )
Original file line number Diff line number Diff line change 66 "project_name" : " example" ,
77 "runtime" : " python3.7" ,
88 "s3_bucket" : " zappa-kh2jm4it1" ,
9- "xray_tracing" : true ,
10- "extra_permissions" : [{
11- "Effect" : " Allow" ,
12- "Action" : [" ssm:GetParameter" ],
13- "Resource" : " *"
14- }]
9+ "xray_tracing" : true
1510 }
1611}
You can’t perform that action at this time.
0 commit comments