Skip to content

metrics: remove peer id label from p2p metrics to prevent cardinality explosion. #2600

@hendrikhofstadt

Description

@hendrikhofstadt

I just reviewed the PR #2425.

The metrics introduced are very insightful and important for people running nodes. However the newly introduced p2p metrics somehow clash with Prometheus' guidelines.

A quote from their manual:

Remember that every unique combination of key-value label pairs represents a new time series, which can dramatically increase the amount of data stored. Do not use labels to store dimensions with high cardinality (many different label values), such as user IDs, email addresses, or other unbounded sets of values.

With the new metric we are creating a label per peer ID which can easily grow up to a really high amount over time or under an intentional attack.

Normally these are not the kind of metrics you would track using Prometheus.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C:p2pComponent: P2P pkgT:bugType Bug (Confirmed)T:observabilityType: Observabilitystalefor use by stalebot

    Type

    No type

    Projects

    Status

    Done/Merged

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions