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

feat: gauge support #8

Merged
merged 3 commits into from
Jan 10, 2025
Merged

Conversation

PaulOlteanu
Copy link
Contributor

@PaulOlteanu PaulOlteanu commented Jan 9, 2025

Description

It'd be nice to have support for Gauge metrics. For example it'd be useful in the relay to see how many actor tasks are running and to notice if actor tasks are being leaked (just an example, not something I necessarily believe).

Breaking Changes

I think none

Notes & open questions

Change checklist

  • Self-review.
  • Documentation updates following the style guide, if relevant.
  • Tests if relevant.
  • All breaking changes documented.

@Arqu Arqu self-requested a review January 9, 2025 16:41
Copy link
Contributor

@Arqu Arqu left a comment

Choose a reason for hiding this comment

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

So aside from the nitpick, code looks great, thank you.

Just to give some background why we haven't added these (and maybe it's useful for you too). Gauges are good only if you're interested in a ballpark point in time value to look at live.

In a case where between a single sampling period you have lots of activity but but then also close it all out and end up decreasing to 0, it would look like nothing happened if you plot it as a time series. In reality a lot of stuff happened.

The solution we use and I also generally recommend is running two counters, one for increases and one for decreases. That way you can plot activity on both cases independently, calculate the diff to get the point in time value the same as a gauge, but also be able to see activity on both directions.

Im happy to approve this once the nit is resolved.

.gitignore Outdated Show resolved Hide resolved
@PaulOlteanu
Copy link
Contributor Author

Yeah using 2 counters is a good point. Usually I like to create some Guard type that wraps a Gauge and increments it on creation and decrements it on drop. I guess that's doable with 2 counters as well.

@PaulOlteanu PaulOlteanu marked this pull request as ready for review January 10, 2025 03:12
@Arqu Arqu changed the title Feat gauge support feat: gauge support Jan 10, 2025
@Arqu Arqu merged commit 2cd2e98 into n0-computer:main Jan 10, 2025
23 of 27 checks passed
@PaulOlteanu PaulOlteanu deleted the feat-gauge-support branch January 10, 2025 16:31
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.

2 participants