Skip to content

LLT-6820: Add pubkey info to logs - #78

Open
stalowyjez wants to merge 4 commits into
mainfrom
LLT-6820-add_pubkey_info_to_logs
Open

LLT-6820: Add pubkey info to logs#78
stalowyjez wants to merge 4 commits into
mainfrom
LLT-6820-add_pubkey_info_to_logs

Conversation

@stalowyjez

Copy link
Copy Markdown
Contributor

Problem

Currently it's hard to match neptun logs with a peer because there is no peer info attached

Solution

Add peer field to tracing logs with masked public key

@stalowyjez
stalowyjez force-pushed the LLT-6820-add_pubkey_info_to_logs branch from 4f050c3 to 199e985 Compare August 31, 2026 09:17
@codecov

codecov Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 37.03704% with 85 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.66%. Comparing base (a45a31d) to head (dc459f9).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
neptun/src/device/mod.rs 9.37% 29 Missing ⚠️
neptun/src/noise/mod.rs 52.27% 21 Missing ⚠️
neptun/src/noise/handshake.rs 0.00% 12 Missing ⚠️
neptun/src/noise/timers.rs 11.11% 8 Missing ⚠️
neptun/src/serialization.rs 75.86% 7 Missing ⚠️
neptun/src/device/packet_workers.rs 0.00% 4 Missing ⚠️
neptun/src/device/peer.rs 20.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #78      +/-   ##
==========================================
- Coverage   73.02%   72.66%   -0.37%     
==========================================
  Files          20       20              
  Lines        4601     4642      +41     
==========================================
+ Hits         3360     3373      +13     
- Misses       1241     1269      +28     
Flag Coverage Δ
linux 76.22% <38.46%> (-0.38%) ⬇️
macos 57.12% <30.95%> (-0.25%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tomaszklak

Copy link
Copy Markdown
Contributor

Can you attach a sample of new logs?

@tomaszklak tomaszklak 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.

Could we use tracing::Span(::enter) to avoid modifying all the logs explicitly?

Comment thread neptun/src/serialization.rs Outdated

impl PubKey {
/// Raw key material.
#[allow(dead_code)]

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.

Why is allow(dead_code) needed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed

Comment thread neptun/src/serialization.rs Outdated
Comment on lines +6 to +7
/// Separator rendered between the kept fragments of a masked public key.
const MASK_SEPARATOR: &str = "...";

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.

nit: I don't see the point of putting this into a const

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed

}

impl std::fmt::Display for PubKey {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {

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.

Can you explain why is there so much more code than the old format_pubkey_short ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Simplified

@stalowyjez

Copy link
Copy Markdown
Contributor Author

@tomaszklak I guess it makes ss makes more sense, to capture tracing formatting:
image

@tomaszklak

Copy link
Copy Markdown
Contributor

That's from tests, but libtelio has it's own logging setup and I'm curious (and would want ta make sure) how it will look like in production logs.

@stalowyjez
stalowyjez force-pushed the LLT-6820-add_pubkey_info_to_logs branch from 199e985 to dc459f9 Compare August 31, 2026 15:14
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.

2 participants