-
Notifications
You must be signed in to change notification settings - Fork 0
/
w8.txt
95 lines (63 loc) · 3.16 KB
/
w8.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
w8.txt
Q: What does it mean "Launch the service locally..."
A: docker-compose up. Then try making API calls
poetry run flask --app todo run -p 6400
$ conda uninstall poetry
$ conda install poetry
# No need to do the below, it already exists (see pyproject.toml)
$ poetry add watchtower
$ poetry add psycopg2-binary
$ poetry add flask-sqlalchemy
URL (from docker-compose up): http://127.0.0.1:6400/
CloudWatch > Log Insights
log_group: taskoverflow
fields request_id, url, method, @timestamp, message.message, @message, @log @ingestionTime
| filter not isempty(request_id)
| limit 400
generate new query
run query
> logs (390)
Q: How do you refine your logging? Should I refine on AWS CloudWatch or python?
A:
https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_AnalyzeLogData-discoverable-fields.html
https://docs.python.org/3/howto/logging.html
It appears you need to re-run docker-compose up when you update create_app()
When you do API calls, you should see logs appear 1m later on CloudWatch
Q: Why was k6 built with JavaScript in mind?
A:
Q: Should I stop docker-compose up when I run terraform apply?
A: Yes. See image.tf, a ecr_repo is setup.
E: https://k6.io/docs/javascript-api/jslib/utils/randomintbetween/
Q: Where do I get the URL from?
A: ECS > Clusters > taskoverflow > Services >taskoverflow > Tasks > 295412d31c2e43979db59adc8aba0bad > Configuration
http://44.222.100.133:6400/
P: ECS service taskoverflow logs...
exec /app/bin/docker-entrypoint: exec format error
Add '--platform=linux/amd64' to Dockerfile header
P: Why do I get...
WARN[0376] Request Failed error="Delete \"$%7Burl%7D/$%7BwrongId%7D\": unsupported protocol scheme \"\""
A: `${url}/${wrongId}` backticks are needed, not quotes ''
P: Why did I get 85.60% checks?
A:
P: Why did I get 4.02% checks after fixing the string format error?
A:
T: Fake data https://k6.io/docs/examples/data-parameterization/
w8 sat review...
checks 85.52%
Q: Why has taskoverflow been left in an unusual state? What do the logs tell me?
A:
Q: What are correlation ids?
uuid4 is a correlation id, named request_id
Request started at beginning of request
Request finished at end of request (see what happens in between these messages)
fields request_id, url, method, @timestamp, message.message, @message, @method
| filter not isempty(request_id)
| pattern @message
| limit 1000
Why do we get this undefined token_value?
token_value: "/api/v1/todos/undefined"
{"timestamp": 1714187496.4487123, "location": "requests", "message": "Request finished", "request_id": "45b500a2-6ae1-4dfe-a2c7-2aa022a7e116", "url": "/api/v1/todos/undefined", "method": "DELETE"}
{"timestamp": 1714187496.4487123, "location": "requests", "message": {"timestamp": 1714187496.4487123, "location": "requests", "message": "Request finished", "request_id": "45b500a2-6ae1-4dfe-a2c7-2aa022a7e116", "url": "/api/v1/todos/undefined", "method": "DELETE"}, "request_id": "45b500a2-6ae1-4dfe-a2c7-2aa022a7e116", "url": "/api/v1/todos/undefined", "method": "DELETE"}
Update: 28/04 12:52am w/ 85% check
planner ✓ [===========] 20 VUs 07m00.4s/10m0s 400/400 shared iters
studier ✓ [===========] 0000/2500 VUs 6m0s