Skip to content

Commit 2f64d4d

Browse files
committed
Update
1 parent 95ee2e5 commit 2f64d4d

File tree

3 files changed

+14
-18
lines changed

3 files changed

+14
-18
lines changed

Monitoring-Debugging/Tracing-with-X-Ray/README.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
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

115
Create 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
2317
cd example
@@ -26,6 +20,17 @@ pipenv shell
2620
pipenv install aws-xray-sdk flask zappa requests
2721
pipenv lock -r > requirements.txt
2822
zappa 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
2934
zappa deploy
3035
```
3136

Monitoring-Debugging/Tracing-with-X-Ray/example/app.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,7 @@
2424

2525
# Boto3 resources
2626
dynamodb = 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('/')

Monitoring-Debugging/Tracing-with-X-Ray/example/zappa_settings.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
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
}

0 commit comments

Comments
 (0)