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

Overhaul stats: Add announced Peer to HTTP core announce event #1376

Open
josecelano opened this issue Mar 12, 2025 · 0 comments
Open

Overhaul stats: Add announced Peer to HTTP core announce event #1376

josecelano opened this issue Mar 12, 2025 · 0 comments
Assignees

Comments

@josecelano
Copy link
Member

Depends on: #1341

IMPORTANT: This has to be implemented after #1341.

I'm refactoring events to include more metadata:

pub enum Event {
    TcpAnnounce { connection: ConnectionContext },
    TcpScrape { connection: ConnectionContext },
}

It would also be convenient to include information about the announce request, in the event, like the peer.

pub enum Event {
    TcpAnnounce { connection: ConnectionContext, peer: Peer, original_peer_ip: IpAddr },
    TcpScrape { connection: ConnectionContext },
}

Where the Peer is the peer defined in primitive types.

NOTICE: The tracker might change the peer IP, depending on tracker configuration, like whether the tracker is running behind a reverse proxy or not. I have also added the original_peer_ip to the event; otherwise, that info would be lost. I want the events to have all the info needed to re-build exactly the tracker history if needed.

That's the only information that the tracker might change now. I do not think the tracker will ever change other data but maybe we should include the received peer and announce peer in the event:

pub enum Event {
    TcpAnnounce { connection: ConnectionContext, peer_announcement: Peer, peer_added: Peer },
    TcpScrape { connection: ConnectionContext },
}

cc @da2ce7

@josecelano josecelano self-assigned this Mar 12, 2025
@josecelano josecelano changed the title Overhaul stats: add announced Peer to HTTP core announce event Overhaul stats: Add announced Peer to HTTP core announce event Mar 18, 2025
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