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

usage reporting: report utilized CPU time #8282

Merged

Conversation

dimitarvdimitrov
Copy link
Contributor

@dimitarvdimitrov dimitarvdimitrov commented Jun 5, 2024

What this PR does

This takes a similar approach to Loki's grafana/loki#12970 and replaces number of CPU cores to the actual CPU utilization

Which issue(s) this PR fixes or relates to

Fixes #

Checklist

  • Tests updated.
  • Documentation added.
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX].
  • about-versioning.md updated with experimental features.

@56quarters
Copy link
Contributor

Why does usage reporting need to include CPU usage? This seems like operation data that isn't appropriate to include in usage stats and something better done with metrics.

@dimitarvdimitrov
Copy link
Contributor Author

this is for GEM billing purposes. That's what Loki (and GEL) did, so we followed suit. I think it's equally viable to do this in GEM only.

@pr00se
Copy link
Contributor

pr00se commented Jun 6, 2024

The usage report already contains:

  • The Mimir memory utilization and number of goroutines.
  • The number of logical CPU cores available to the Mimir process.

This is an improvement to the second item, bringing it more inline with the first (usage rather than raw available core count).

pkg/usagestats/report.go Outdated Show resolved Hide resolved
@dimitarvdimitrov dimitarvdimitrov force-pushed the dimitar/usage-stats/add-cpu-percentage-reporting branch from 47e224a to b4128fe Compare June 6, 2024 14:10
@dimitarvdimitrov dimitarvdimitrov marked this pull request as ready for review June 7, 2024 10:44
Copy link
Member

@jdbaldry jdbaldry left a comment

Choose a reason for hiding this comment

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

Docs changes lgtm

Copy link
Contributor

@pr00se pr00se left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

This takes a similar approach to Loki

Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>
Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>
Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>
Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>
Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>
@dimitarvdimitrov dimitarvdimitrov force-pushed the dimitar/usage-stats/add-cpu-percentage-reporting branch from e8a873c to b23008a Compare June 12, 2024 09:10
@dimitarvdimitrov dimitarvdimitrov enabled auto-merge (squash) June 12, 2024 09:11
@dimitarvdimitrov dimitarvdimitrov merged commit 39a7eff into main Jun 13, 2024
29 checks passed
@dimitarvdimitrov dimitarvdimitrov deleted the dimitar/usage-stats/add-cpu-percentage-reporting branch June 13, 2024 10:42
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.

4 participants