Skip to content

Conversation

@ltitanb
Copy link
Collaborator

@ltitanb ltitanb commented Mar 19, 2025

follow up of #254, fix for #225

  • make logging more predictable, and add more information in each log line. I also removed nested spans to make parsing json logs easier. Now each request has a single span, with a method field and optionally more information (depending on the call).
  • refactor the [logs] section of the config

For pasing, JSON format should be used, which has a span field.
get_header

{"timestamp":"2025-03-19T18:31:21.086988Z","level":"INFO","ua":"","ms_into_slot":46506681086,"span":{"method":"/eth/v1/builder/header/{slot}/{parent_hash}/{pubkey}","parent_hash":"0x0000000000000000000000000000000000000000000000000000000000000000","req_id":"5c8c6604-6400-4757-b6a3-00e2a32ca2a4","slot":0,"validator":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","name":""}}
{"timestamp":"2025-03-19T18:31:21.087032Z","level":"DEBUG","message":"using default config","relays":1,"pubkey":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","span":{"method":"/eth/v1/builder/header/{slot}/{parent_hash}/{pubkey}","parent_hash":"0x0000000000000000000000000000000000000000000000000000000000000000","req_id":"5c8c6604-6400-4757-b6a3-00e2a32ca2a4","slot":0,"validator":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","name":""}}
{"timestamp":"2025-03-19T18:31:21.088663Z","level":"DEBUG","message":"received new header","relay_id":"mock_3201","latency":"1.336617ms","version":"deneb","value_eth":"0.000000000000000010","block_hash":"0x0100000000000000000000000000000000000000000000000000000000000000","span":{"method":"/eth/v1/builder/header/{slot}/{parent_hash}/{pubkey}","parent_hash":"0x0000000000000000000000000000000000000000000000000000000000000000","req_id":"5c8c6604-6400-4757-b6a3-00e2a32ca2a4","slot":0,"validator":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","name":""}}
{"timestamp":"2025-03-19T18:31:21.090516Z","level":"INFO","message":"received header","value_eth":"0.000000000000000010","block_hash":"0x0100000000000000000000000000000000000000000000000000000000000000","span":{"method":"/eth/v1/builder/header/{slot}/{parent_hash}/{pubkey}","parent_hash":"0x0000000000000000000000000000000000000000000000000000000000000000","req_id":"5c8c6604-6400-4757-b6a3-00e2a32ca2a4","slot":0,"validator":"0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","name":""}}

get_payload

{"timestamp":"2025-03-19T18:46:20.850360Z","level":"INFO","ua":"","ms_into_slot":46507580850,"span":{"block_hash":"0x0000000000000000000000000000000000000000000000000000000000000000","block_number":0,"method":"/eth/v1/builder/blinded_blocks","parent_hash":"0x0000000000000000000000000000000000000000000000000000000000000000","req_id":"a206c8dd-cadd-4dcf-aa03-430a39bd68ce","slot":0,"name":""}}
{"timestamp":"2025-03-19T18:46:20.851189Z","level":"DEBUG","message":"received unblinded block","relay_id":"mock_3801","retry":0,"latency":"562.511µs","version":"deneb","block_hash":"0x0000000000000000000000000000000000000000000000000000000000000000","span":{"block_hash":"0x0000000000000000000000000000000000000000000000000000000000000000","block_number":0,"method":"/eth/v1/builder/blinded_blocks","parent_hash":"0x0000000000000000000000000000000000000000000000000000000000000000","req_id":"a206c8dd-cadd-4dcf-aa03-430a39bd68ce","slot":0,"name":""}}
{"timestamp":"2025-03-19T18:46:20.851242Z","level":"INFO","message":"received unblinded block","span":{"block_hash":"0x0000000000000000000000000000000000000000000000000000000000000000","block_number":0,"method":"/eth/v1/builder/blinded_blocks","parent_hash":"0x0000000000000000000000000000000000000000000000000000000000000000","req_id":"a206c8dd-cadd-4dcf-aa03-430a39bd68ce","slot":0,"name":""}}

@ltitanb ltitanb changed the title Ltitanb/new logs feat: refactor log formats Mar 19, 2025
@ltitanb ltitanb requested a review from ManuelBilbao March 19, 2025 18:53
@ltitanb ltitanb merged commit 3617e61 into main Mar 21, 2025
2 of 3 checks passed
@ltitanb ltitanb deleted the ltitanb/new-logs branch March 21, 2025 10:50
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

Successfully merging this pull request may close these issues.

3 participants