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

Fix p2p sdk metric labels #2561

Merged
merged 1 commit into from
Dec 29, 2023
Merged

Conversation

StephenButtolph
Copy link
Contributor

Why this should be merged

Fixes:

ERROR ... gossip/handler.go:167 failed to get received count metric {"error": "inconsistent label cardinality: expected 1 label values but got 0 in prometheus.Labels(nil)"}

How this works

Previously the pushLabels was incorrectly left uninitialized. This removes all labels from structs and converts them into package private global constants.

How this was tested

  • CI
  • Locally using the 5 node network

@StephenButtolph StephenButtolph added bug Something isn't working monitoring This primarily focuses on logs, metrics, and/or tracing networking This involves networking labels Dec 29, 2023
@StephenButtolph StephenButtolph added this to the v1.10.18 milestone Dec 29, 2023
@StephenButtolph StephenButtolph self-assigned this Dec 29, 2023
@@ -54,9 +49,6 @@ type Handler[T Gossipable] struct {
set Set[T]
metrics Metrics
targetResponseSize int

pullLabels prometheus.Labels
pushLabels prometheus.Labels
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was the source of the bug - only pullLabels was initialized in NewHandler.

@StephenButtolph StephenButtolph added this pull request to the merge queue Dec 29, 2023
Merged via the queue into dev with commit 4bcf7ee Dec 29, 2023
17 checks passed
@StephenButtolph StephenButtolph deleted the simplify-p2p-sdk-metric-labels branch December 29, 2023 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working monitoring This primarily focuses on logs, metrics, and/or tracing networking This involves networking
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants