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

chore: more efficient metrics usage #3298

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Ivansete-status
Copy link
Collaborator

@Ivansete-status Ivansete-status commented Feb 13, 2025

Description

  • Bound the metrics-label-values in arbitrary queries.
  • The metrics-label-values for prepared statements are kept as
    they already represent a fixed set.
  • Store error metrics labels simplification to avoid overwhelm prometheus
  • waku/waku_store_legacy/protocol_metrics.nim: change the metrics' names to separate store-v2 (legacy) metrics from store-v3

Issue

closes #3282

* Bound the metrics-label-values in arbitrary queries.
* The metrics-label-values for prepared statements are kept as
  they already represent a fixed set.
Copy link

You can find the image built from this PR at

quay.io/wakuorg/nwaku-pr:3298

Built from 6787618

Copy link
Contributor

@jakubgs jakubgs left a comment

Choose a reason for hiding this comment

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

I would appreciate some reviews from @waku-org/waku team as this is generating alerting noise for our metrics cluster.

waku/waku_store_legacy/protocol_metrics.nim Show resolved Hide resolved
Comment on lines +240 to +245
if query.contains("contentTopic IN"):
return ContentTopicQuery
elif query.contains("SELECT version()"):
return SelectVersionQuery
elif query.contains("WITH min_timestamp"):
return MessagesLookupQuery
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't you have like a key-value map in Nim?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Don't you have like a key-value map in Nim?

Yes. In this case, the query variable has longer content and we are just filtering by a substring.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, but can't you just use keys as prefixes and iterate over them?

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 this pull request may close these issues.

bug: waku_store_errors_created metrics puts whole errors into labels
2 participants