Skip to content

[raft] Improve logging#1537

Open
the-glu wants to merge 9 commits into
interuss:masterfrom
Orbitalize:raft_logging
Open

[raft] Improve logging#1537
the-glu wants to merge 9 commits into
interuss:masterfrom
Orbitalize:raft_logging

Conversation

@the-glu

@the-glu the-glu commented Jun 16, 2026

Copy link
Copy Markdown
Member

This PR follow #1536

It improve raft logging by:

  • Switching to Debug level consensus messages
  • Normalize internal raft logging to use zap as well

Before:

2026-06-16T11:58:25.925Z        warn    core-service/main.go:260        The raft datastore is experimental and its implementation is in progress. See issue for more details: https://github.com/interuss/dss/issues/1463        {"address": ":8082"}
2026-06-16T11:58:25.928Z        info    consensus/storage.go:118        Loaded previous hardstate and entries to Raft memory storage    {"address": ":8082", "component": "storage", "hard-state": {"term":0,"vote":0,"commit":0}, "entries-number": 0}
raft2026/06/16 11:58:25 INFO: 1 switched to configuration voters=()
raft2026/06/16 11:58:25 INFO: 1 became follower at term 0
raft2026/06/16 11:58:25 INFO: newRaft 1 [peers: [], term: 0, commit: 0, applied: 0, lastindex: 0, lastterm: 0]
raft2026/06/16 11:58:25 INFO: 1 became follower at term 1
raft2026/06/16 11:58:25 INFO: 1 switched to configuration voters=(1)
2026-06-16T11:58:25.928Z        info    consensus/consensus.go:112      proposing value {"address": ":8082", "id": "c5ccc086-c6cc-493f-9dfc-149683290df9", "db": "aux_", "request_type": "saveOwnMetadata", "read_only": false}
2026-06-16T11:58:25.929Z        info    consensus/consensus.go:252      publishing entries      {"address": ":8082", "numEntries": 1, "firstIndex": 1, "lastIndex": 1}
raft2026/06/16 11:58:25 INFO: 1 switched to configuration voters=(1)
raft2026/06/16 11:58:27 INFO: 1 is starting a new election at term 1
raft2026/06/16 11:58:27 INFO: 1 became candidate at term 2
raft2026/06/16 11:58:27 INFO: 1 received MsgVoteResp from 1 at term 2
raft2026/06/16 11:58:27 INFO: 1 has received 1 MsgVoteResp votes and 0 vote rejections
raft2026/06/16 11:58:27 INFO: 1 became leader at term 2
raft2026/06/16 11:58:27 INFO: raft.node: 1 elected leader 1 at term 2
2026-06-16T11:58:27.840Z        info    consensus/consensus.go:252      publishing entries      {"address": ":8082", "numEntries": 2, "firstIndex": 2, "lastIndex": 3}
2026-06-16T11:58:27.841Z        info    core-service/main.go:392        Starting DSS HTTP server        {"address": ":8082"}
2026-06-16T11:58:30.944Z        info    logging/http.go:108     GET /healthy HTTP/1.1   {"address": ":8082", "req_dump": "", "resp_dump": "ok", "req_headers": {"Accept":["*/*"],"Connection":["close"],"User-Agent":["Wget"]}, "resp_status_code": 200, "resp_status_text": "OK", "peer_address": "[::1]:53486", "start_time": "2026-06-16T11:58:30.944Z", "duration": "44.258µs"}
2026-06-16T11:59:02.560Z        info    consensus/consensus.go:112      proposing value {"address": ":8082", "id": "881e5523-7bd5-4b23-b99f-ce5d387385cf", "db": "aux_", "request_type": "getDSSMetadata", "read_only": true}
2026-06-16T11:59:02.570Z        info    consensus/consensus.go:252      publishing entries      {"address": ":8082", "numEntries": 1, "firstIndex": 4, "lastIndex": 4}
2026-06-16T11:59:02.571Z        info    logging/http.go:108     GET /aux/v1/pool/dss_instances HTTP/1.1 {"address": ":8082", "req_dump": "", "req_sub": "manual_tester", "resp_dump": "{\"dss_instances\":[{\"id\":\"local_dev\",\"public_endpoint\":\"http://127.0.0.1:8082\"}]}\n", "req_headers": {"Accept":["*/*"],"Authorization":["Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJsb2NhbGhvc3QiLCJleHAiOjE3ODE2MTQ3NDIsImlzcyI6ImxvY2FsaG9zdCIsInNjb3BlIjoiaW50ZXJ1c3MucG9vbF9zdGF0dXMucmVhZCIsInN1YiI6Im1hbnVhbF90ZXN0ZXIifQ.[REDACTED]"],"Content-Type":["application/json"],"User-Agent":["curl/8.20.0"]}, "resp_status_code": 200, "resp_status_text": "OK", "peer_address": "172.18.0.1:52114", "start_time": "2026-06-16T11:59:02.560Z", "duration": "10.368429ms"}

After

2026-06-16T12:10:09.415Z        warn    core-service/main.go:260        The raft datastore is experimental and its implementation is in progress. See issue for more details: https://github.com/interuss/dss/issues/1463        {"address": ":8082"}
2026-06-16T12:10:09.416Z        info    consensus/storage.go:118        Loaded previous hardstate and entries to Raft memory storage    {"address": ":8082", "component": "storage", "hard-state": {"term":4,"vote":1,"commit":14}, "entries-number": 15}
2026-06-16T12:10:09.416Z        info    v3@v3.6.0/raft.go:1981  1 switched to configuration voters=()   {"address": ":8082"}
2026-06-16T12:10:09.416Z        info    v3@v3.6.0/raft.go:897   1 became follower at term 4     {"address": ":8082"}
2026-06-16T12:10:09.416Z        info    v3@v3.6.0/raft.go:493   newRaft 1 [peers: [], term: 4, commit: 14, applied: 0, lastindex: 15, lastterm: 4]      {"address": ":8082"}
2026-06-16T12:10:09.416Z        info    v3@v3.6.0/raft.go:1981  1 switched to configuration voters=(1)  {"address": ":8082"}
2026-06-16T12:10:10.817Z        info    v3@v3.6.0/raft.go:988   1 is starting a new election at term 4  {"address": ":8082"}
2026-06-16T12:10:10.817Z        info    v3@v3.6.0/raft.go:912   1 became candidate at term 5    {"address": ":8082"}
2026-06-16T12:10:10.827Z        info    v3@v3.6.0/raft.go:1077  1 received MsgVoteResp from 1 at term 5 {"address": ":8082"}
2026-06-16T12:10:10.827Z        info    v3@v3.6.0/raft.go:1693  1 has received 1 MsgVoteResp votes and 0 vote rejections        {"address": ":8082"}
2026-06-16T12:10:10.827Z        info    v3@v3.6.0/raft.go:970   1 became leader at term 5       {"address": ":8082"}
2026-06-16T12:10:10.827Z        info    v3@v3.6.0/node.go:370   raft.node: 1 elected leader 1 at term 5 {"address": ":8082"}
2026-06-16T12:10:10.829Z        info    core-service/main.go:392        Starting DSS HTTP server        {"address": ":8082"}
2026-06-16T12:10:14.441Z        info    logging/http.go:108     GET /healthy HTTP/1.1   {"address": ":8082", "req_dump": "", "resp_dump": "ok", "req_headers": {"Accept":["*/*"],"Connection":["close"],"User-Agent":["Wget"]}, "resp_status_code": 200, "resp_status_text": "OK", "peer_address": "[::1]:49008", "start_time": "2026-06-16T12:10:14.440Z", "duration": "26.771µs"}
2026-06-16T12:13:14.471Z        info    logging/http.go:108     GET /healthy HTTP/1.1   {"address": ":8082", "req_dump": "", "resp_dump": "ok", "req_headers": {"Accept":["*/*"],"Connection":["close"],"User-Agent":["Wget"]}, "resp_status_code": 200, "resp_status_text": "OK", "peer_address": "[::1]:44458", "start_time": "2026-06-16T12:13:14.471Z", "duration": "42.551µs"}
2026-06-16T12:13:28.928Z        info    logging/http.go:108     GET /aux/v1/pool/dss_instances HTTP/1.1 {"address": ":8082", "req_dump": "", "req_sub": "manual_tester", "resp_dump": "{\"dss_instances\":[{\"id\":\"local_dev\",\"public_endpoint\":\"http://127.0.0.1:8082\"}]}\n", "req_headers": {"Accept":["*/*"],"Authorization":["Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJsb2NhbGhvc3QiLCJleHAiOjE3ODE2MTU2MDgsImlzcyI6ImxvY2FsaG9zdCIsInNjb3BlIjoiaW50ZXJ1c3MucG9vbF9zdGF0dXMucmVhZCIsInN1YiI6Im1hbnVhbF90ZXN0ZXIifQ.[REDACTED]"],"Content-Type":["application/json"],"User-Agent":["curl/8.20.0"]}, "resp_status_code": 200, "resp_status_text": "OK", "peer_address": "172.18.0.1:36842", "start_time": "2026-06-16T12:13:28.917Z", "duration": "10.623594ms"}

@MariemBaccari MariemBaccari left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool !

@the-glu the-glu mentioned this pull request Jun 16, 2026
@barroco barroco added the dss-raft Relating to the application-layer consensus implemenation based on raft label Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dss-raft Relating to the application-layer consensus implemenation based on raft

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants