Clean up warnings (+fallback metrics) #685

Merged
floatingghost merged 5 commits from Oneric/akkoma:metrics into develop 2024-02-17 11:41:11 +00:00
Member

All in all this cuts out ~20 lines of warnings from the startup of mix phx.server, mix test, etc

  • The first three commits do not change any functionality whatsoever and are in effect purely cosmetic.
  • The fourth commit changes the memory display unit from kB to MB only for the live dashboard since the numbers in kB were large enough to get their most significant digits cut off (and even idle Akkoma already consumes >100MB anyway)

Now the final, fifth commit attempts to provide fallbacks for the unavailable summary metrics. I’m not too familiar with Prometheus/Grafana/... so my assumption of sum+counter being a useful substitute may be off. Feel free to adjust or just drop this commit if you think it’s flawed or not worth the effort

All in all this cuts out ~20 lines of warnings from the startup of `mix phx.server`, `mix test`, etc - The first three commits do not change any functionality whatsoever and are in effect purely cosmetic. - The fourth commit changes the memory display unit from kB to MB _only_ for the live dashboard since the numbers in kB were large enough to get their most significant digits cut off (and even idle Akkoma already consumes >100MB anyway) Now the final, fifth commit attempts to provide fallbacks for the unavailable summary metrics. I’m not too familiar with Prometheus/Grafana/... so my assumption of `sum`+`counter` being a useful substitute may be off. Feel free to adjust or just drop this commit if you think it’s flawed or not worth the effort
Oneric added 5 commits 2024-02-12 02:38:17 +00:00
The exporter doesn’t support them thus we don't lose anything by this,
but it avoids a bunch of warnings each time the server starts up.
Otherwise we get warnings on startup as local captures
and anonymous functions are supposedly less performant.
Commit e9f1897cfd added this private
function but it never had any users resulting in warnings each startup
With kilobyte the resulting numbers got too large and were cut off
in the charts, making them useless. However, even an idle Akkoma
server’s memory usage is in the lower hundreths of megabytes, so
we don’t need this much precision to begin with for the dashboard.

Other metric users might prefer base units and can handle scaling in a
smarter way, so keep this configurable.
Use fallbacks of summary metrics for prometheus
Some checks are pending
ci/woodpecker/pr/build-amd64 Pipeline is pending
ci/woodpecker/pr/build-arm64 Pipeline is pending
ci/woodpecker/pr/docs Pipeline is pending
ci/woodpecker/pr/lint Pipeline is pending
ci/woodpecker/pr/test Pipeline is pending
29f564f700

all looks good, and works locally, thanks!

all looks good, and works locally, thanks!
floatingghost merged commit 755c75d8a4 into develop 2024-02-17 11:41:11 +00:00
floatingghost deleted branch metrics 2024-02-17 11:41:11 +00:00

so i don't leave the question hanging for anyone that looks at this in the future

I’m not too familiar with Prometheus/Grafana/... so my assumption of sum+counter being a useful substitute may be off.

it should be close enough and it looked ok on my dash

if anyone notices it being weird, ping this issue and we'll look at it again

so i don't leave the question hanging for anyone that looks at this in the future >I’m not too familiar with Prometheus/Grafana/... so my assumption of sum+counter being a useful substitute may be off. it should be close enough and it looked ok on my dash if anyone notices it being weird, ping this issue and we'll look at it again
Sign in to join this conversation.
No description provided.