Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Structured logging #33

Open
almereyda opened this issue Apr 19, 2023 · 0 comments
Open

Structured logging #33

almereyda opened this issue Apr 19, 2023 · 0 comments

Comments

@almereyda
Copy link
Contributor

Is your feature request related to a problem? Please describe.

As a Pathfinder operator, I need to make use of structured logging, in order to correlate log lines with events.

Describe the solution you'd like

We need IDs for requests, and have the logs output a JSON dictionary per line, http://ndjson.org/

Describe alternatives you've considered

Adding time stamps to log lines just makes things more messy. This should be cared about from log aggregation.

Additional context

Here we can see that sometimes load_safes_binary injects its log line in between a series of correlated logs that were triggered by compute_transfer.

# docker compose logs pathfinder2 | grep -B 3 -A 3 'Capacity lost' | tail -n 46
srv-pathfinder2-1  | Computing flow
srv-pathfinder2-1  | 121711 safes, 121711 tokens
srv-pathfinder2-1  | Max flow: 1047623845217673410968
srv-pathfinder2-1  | Capacity lost by transfer count reduction: 493.63
srv-pathfinder2-1  | Num transfers: 29
srv-pathfinder2-1  | After simplification: 22
srv-pathfinder2-1  | Computed flow with max distance None: 0x1e08348d1a226df297
srv-pathfinder2-1  | Request: {"id":"6be3979b-6ce2-4432-a7e2-5be749550c69","method":"compute_transfer","params":{"from":"0x20E024439fa1320C3E31a6e4677D503889867DDd","to":"0x9BA1Bcd88E99d6E1E03252A70A63FEa83Bf1208c","value":"79442175123273
600000","max_transfers":30}}
srv-pathfinder2-1  | Computing flow
srv-pathfinder2-1  | Max flow: 1047623845217673410968
srv-pathfinder2-1  | Capacity lost by transfer count reduction: 0+eps
srv-pathfinder2-1  | Num transfers: 20
srv-pathfinder2-1  | After simplification: 15
srv-pathfinder2-1  | Computed flow with max distance None: 0x44e7b4d5f3718cc00
--
srv-pathfinder2-1  | Request: {"id":"16aeb017-7448-4198-acb3-891d67e10543","method":"compute_transfer","params":{"from":"0x20E024439fa1320C3E31a6e4677D503889867DDd","to":"0x9BA1Bcd88E99d6E1E03252A70A63FEa83Bf1208c","value":"10000000000000
00000000000000000000","max_transfers":30}}
srv-pathfinder2-1  | Computing flow
srv-pathfinder2-1  | Max flow: 1047623845217673410968
srv-pathfinder2-1  | Capacity lost by transfer count reduction: 493.63
srv-pathfinder2-1  | Num transfers: 29
srv-pathfinder2-1  | After simplification: 22
srv-pathfinder2-1  | Computed flow with max distance None: 0x1e08348d1a226df297
--
srv-pathfinder2-1  | Computing flow
srv-pathfinder2-1  | Request: {"id":"638175007934429372","method":"load_safes_binary","params":{"file":"/var/pathfinder2/data/capacity_graph.db"}}
srv-pathfinder2-1  | Max flow: 1047623845217673410968
srv-pathfinder2-1  | Capacity lost by transfer count reduction: 0+eps
srv-pathfinder2-1  | Num transfers: 20
srv-pathfinder2-1  | After simplification: 15
srv-pathfinder2-1  | Computed flow with max distance None: 0x44e7c37fd93f33530
--
srv-pathfinder2-1  | Request: {"id":"f90ee7a8-9ca8-4201-bd8c-5464864eed0c","method":"compute_transfer","params":{"from":"0x20E024439fa1320C3E31a6e4677D503889867DDd","to":"0x9BA1Bcd88E99d6E1E03252A70A63FEa83Bf1208c","value":"10000000000000
00000000000000000000","max_transfers":30}}
srv-pathfinder2-1  | Computing flow
srv-pathfinder2-1  | Max flow: 1047623845217673410968
srv-pathfinder2-1  | Capacity lost by transfer count reduction: 493.63
srv-pathfinder2-1  | Num transfers: 29
srv-pathfinder2-1  | After simplification: 22
srv-pathfinder2-1  | Computed flow with max distance None: 0x1e08348d1a226df297
--
srv-pathfinder2-1  | Request: {"id":"3062e1a0-9761-438d-b375-7b7394027562","method":"compute_transfer","params":{"from":"0x20E024439fa1320C3E31a6e4677D503889867DDd","to":"0x9BA1Bcd88E99d6E1E03252A70A63FEa83Bf1208c","value":"79442441322800
530000","max_transfers":30}}
srv-pathfinder2-1  | Computing flow
srv-pathfinder2-1  | Max flow: 1047623845217673410968
srv-pathfinder2-1  | Capacity lost by transfer count reduction: 0+eps
srv-pathfinder2-1  | Num transfers: 20
srv-pathfinder2-1  | After simplification: 15
srv-pathfinder2-1  | Computed flow with max distance None: 0x44e7c3f7a9f56c250
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant