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

Hackathon Improvements, Dec 2023 #79

Merged
merged 49 commits into from
Mar 11, 2024
Merged

Hackathon Improvements, Dec 2023 #79

merged 49 commits into from
Mar 11, 2024

Conversation

logyball
Copy link
Contributor

@logyball logyball commented Dec 7, 2023

Large-scale changes for unused-exporter! Outcome of the December 2023 Grafana hackathon team: Garbage Pail Kids aka Los Basuritos

What

A more comprehensive unused-exporter. Adding a total_size metric as well as dramatically improving polling performance using caching.

Why

Because it's fun! Also so that we could make this something that actually runs as a service.

Major Changes

  • Authorization changes: all providers can now be authorized from environment vars
  • Create a cache that allows prometheus metrics to be created on a pre-defined polling interval, rather than on-demand when scraped
    • This is so that these metrics, which seldom change, are not polled every 15s or so

Minor Changes

  • Logger swapped out, now we use slog
  • Added provider ID to the provider struct

Follow-ups

  • Push docker image to a public repository?

inkel and others added 30 commits December 1, 2023 14:44
Signed-off-by: Logan Ballard <[email protected]>

updating readme

updating to a single loop

adding size to labels for logging

updating metric name based on CR

Update cmd/unused-exporter/exporter.go

Co-authored-by: Leandro López <[email protected]>

updating readme

updating readme
Creating rudimentary size tracking of unused disks
These will be used to cache the results of polling each provider for
unused disks, making the *exporter.Collect method faster and less
prone to timeouts.
This should make the code more readable.
The previous code was using defer, which would release the
context.WithTimeout when the program ends, not on each iteration, thus
causing deferred functions to pile up, consuming unnecessary memory.
This makes the code more readable.
removing binary accidentally committed
Logyball/cache updates followup / Verbose logging flag
Copy link
Collaborator

@inkel inkel left a comment

Choose a reason for hiding this comment

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

I did an initial review, and it looks good! Just left a change request and a comment, happy to discuss it before we merge this.

.github/workflows/go.yml Outdated Show resolved Hide resolved
Makefile Show resolved Hide resolved
@logyball logyball self-assigned this Mar 11, 2024
@logyball logyball changed the title DRAFT: hackathon improvments Hackathon Improvements Mar 11, 2024
@logyball logyball changed the title Hackathon Improvements Hackathon Improvements, Dec 2023 Mar 11, 2024
inkel
inkel previously approved these changes Mar 11, 2024
Copy link
Collaborator

@inkel inkel left a comment

Choose a reason for hiding this comment

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

@logyball logyball marked this pull request as ready for review March 11, 2024 20:33
inkel
inkel previously approved these changes Mar 11, 2024
rooneyshuman
rooneyshuman previously approved these changes Mar 11, 2024
Copy link
Contributor

@rooneyshuman rooneyshuman left a comment

Choose a reason for hiding this comment

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

LGTM!

@logyball logyball enabled auto-merge March 11, 2024 21:02
@rooneyshuman rooneyshuman dismissed stale reviews from inkel and themself via 3602638 March 11, 2024 21:09
@logyball logyball merged commit 458e85c into main Mar 11, 2024
3 checks passed
@logyball logyball deleted the dev/hackathon-dec-2023 branch March 11, 2024 21:11
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.

3 participants