Commit 914fdd7
authored
Replace Console with bunyan logger in Sample App (#186)
*Description of changes:*
There are currently no OTel supported logs being emitted from the
sample-app.
Replaces sample-app logging with `bunyan` in order for OpenTelemetry to
auto-instrument the logging library from the app.
/aws-sdk-s3:
```
{"name":"express-app","hostname":"ip-172-31-7-29.us-west-2.compute.internal","pid":2522078,"level":30,"msg":"done aws sdk s3 request","time":"2025-05-28T17:52:53.115Z","v":0}
{"name":"express-app","hostname":"ip-172-31-7-29.us-west-2.compute.internal","pid":2522078,"level":50,"msg":"Exception thrown: Invalid value \"undefined\" for header \"X-Amzn-Trace-Id\"","time":"2025-05-28T17:52:54.132Z","v":0}
```
/http:
```
{"name":"express-app","hostname":"ip-172-31-7-29.us-west-2.compute.internal","pid":2522078,"level":30,"msg":"random value from http request: [94]\n","time":"2025-05-28T17:54:09.786Z","v":0}
```
/rolldice:
```
{"name":"express-app","hostname":"ip-172-31-7-29.us-west-2.compute.internal","pid":2522987,"level":30,"msg":"rolldice: 1","time":"2025-05-28T17:54:52.830Z","v":0}
```
By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.1 parent f0eba5f commit 914fdd7
File tree
1 file changed
+17
-5
lines changed- sample-applications/simple-express-server
1 file changed
+17
-5
lines changedLines changed: 17 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
11 | 15 | | |
12 | 16 | | |
13 | 17 | | |
14 | 18 | | |
| 19 | + | |
15 | 20 | | |
| 21 | + | |
16 | 22 | | |
17 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
18 | 26 | | |
19 | 27 | | |
20 | 28 | | |
| |||
29 | 37 | | |
30 | 38 | | |
31 | 39 | | |
32 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
33 | 43 | | |
34 | 44 | | |
35 | 45 | | |
| |||
45 | 55 | | |
46 | 56 | | |
47 | 57 | | |
48 | | - | |
| 58 | + | |
49 | 59 | | |
50 | 60 | | |
51 | 61 | | |
52 | | - | |
| 62 | + | |
53 | 63 | | |
54 | 64 | | |
55 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
56 | 68 | | |
57 | 69 | | |
58 | 70 | | |
| |||
0 commit comments