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

Unbundle metrics with 2 labels #426

Closed
dapplion opened this issue May 12, 2023 · 0 comments · Fixed by #433
Closed

Unbundle metrics with 2 labels #426

dapplion opened this issue May 12, 2023 · 0 comments · Fixed by #433
Assignees

Comments

@dapplion
Copy link
Contributor

CPU profiles show that the cost of handling metrics with 2 labels is relatively high for hot paths like once per message. The two current offenders could be unrolled into multiple metrics with a single label:

Biggest offender

msgReceivedStatus: register.gauge<{ topic: TopicLabel; status: MessageStatus }>({
name: 'gossipsub_msg_received_status_total',
help: 'Tracks distribution of recv msgs by duplicate, invalid, valid',
labelNames: ['topic', 'status']
}),

Rest of good targets to unbundle

msgPublishPeersByGroup: register.gauge<{ topic: TopicLabel; peerGroup: keyof ToSendGroupCount }>({
name: 'gossipsub_msg_publish_peers_by_group',
help: 'Total count of peers (by group) that we publish a msg to',
labelNames: ['topic', 'peerGroup']
}),

asyncValidationResult: register.gauge<{ topic: TopicLabel; acceptance: TopicValidatorResult }>({
name: 'gossipsub_async_validation_result_total',
help: 'Message validation result for each topic',
labelNames: ['topic', 'acceptance']
}),

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 a pull request may close this issue.

2 participants