Skip to content

Conversation

@Frando
Copy link
Member

@Frando Frando commented Nov 17, 2025

Description

This adds back basic metrics to feat-multipath.

  • Refactor the conn_ metrics (they were all currently unused on feat-multipath) into something meaningful:
    • Track the total number of opened and closed connections - their diff at any time is the number of currently-active connections.
    • Record, once for each connection, if it was relay-only, ip-only or used both ip and relay transports. This replaced the conn_became_direct metric we had previously. "Direct" connections are conn_open - conn_relay_only.
  • Removes metrics that are unused and - IMO - not going to come back
  • Comments out metrics that are unused and likely to come back

Breaking Changes

Notes & open questions

Change checklist

  • Self-review.
  • Documentation updates following the style guide, if relevant.
  • Tests if relevant.
  • All breaking changes documented.
    • List all breaking changes in the above "Breaking Changes" section.
    • Open an issue or PR on any number0 repos that are affected by this breaking change. Give guidance on how the updates should be handled or do the actual updates themselves. The major ones are:

pub send_relay_error: Counter,

// Data packets (non-disco)
pub send_data: Counter,
Copy link
Member Author

@Frando Frando Nov 17, 2025

Choose a reason for hiding this comment

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

This was unused, and it would be just the sum of send_ipv4, send_ipv6, send_relay, so I removed it because the sum can be calculated client-side.


// Data packets (non-disco)
pub send_data: Counter,
pub send_data_network_down: Counter,
Copy link
Member Author

Choose a reason for hiding this comment

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

This was unused, not sure if we'd want this back?

pub actor_tick_other: Counter,

/// Number of endpoints we have attempted to contact.
pub endpoints_contacted: Counter,
Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think we ever could do this in a good way, because we don't keep lists of endpoint ids over restarts, so this was already a bad metric for a while - removed it.

/// Number of endpoints we have attempted to contact.
pub endpoints_contacted: Counter,
/// Number of endpoints we have managed to contact directly.
pub endpoints_contacted_directly: Counter,
Copy link
Member Author

Choose a reason for hiding this comment

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

same as above, I don't think there's a good way to do it meaningfully.

/// Number of connections with a successful handshake.
pub connection_handshake_success: Counter,
/// Number of connections with a successful handshake that became direct.
pub connection_became_direct: Counter,
Copy link
Member Author

Choose a reason for hiding this comment

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

These two are better handled by the new conn_ metrics above

@github-actions
Copy link

github-actions bot commented Nov 17, 2025

Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh/pr/3672/docs/iroh/

Last updated: 2025-11-18T10:45:36Z

@Frando Frando linked an issue Nov 17, 2025 that may be closed by this pull request
@n0bot n0bot bot added this to iroh Nov 17, 2025
@github-project-automation github-project-automation bot moved this to 🏗 In progress in iroh Nov 17, 2025
@Frando Frando requested a review from flub November 18, 2025 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🏗 In progress

Development

Successfully merging this pull request may close these issues.

Multipath metrics

2 participants