Skip to content

Conversation

@Starosdev
Copy link
Owner

@Starosdev Starosdev commented Nov 29, 2025

Summary

Adds Prometheus metrics endpoint for monitoring integration.

Origin

Cherry-picked from upstream PR: AnalogJ#830
Original author: @jianyun8023

Changes

  • Adds /metrics endpoint for Prometheus scraping
  • Exposes disk health and SMART metrics

Closes #1

- Added configuration options for enabling Prometheus metrics in `example.scrutiny.yaml` and `config.go`.
- Introduced a new `metrics` package to handle metrics collection and registration.
- Created a `ScrutinyCollector` to gather device metrics and expose them via a `/metrics` endpoint.
- Updated the web server to conditionally register the metrics endpoint based on configuration.
- Implemented caching for device details to optimize metrics collection.
- Added tests for utility functions related to metrics sanitization and parsing.

This commit enhances the monitoring capabilities of Scrutiny by integrating Prometheus metrics support.
@Starosdev Starosdev self-assigned this Nov 29, 2025
@Starosdev Starosdev added enhancement New feature or request priority:medium Medium priority labels Nov 29, 2025
@Starosdev Starosdev added this to the v1.2.0 - Features milestone Nov 29, 2025
@Starosdev Starosdev merged commit 7384f7d into master Nov 30, 2025
12 of 13 checks passed
@Starosdev
Copy link
Owner Author

Merged to Fork (2025-11-30)

Cherry-picked into Starosdev/scrutiny.

Changes Made

  1. Implemented Prometheus metrics support
    • Added /metrics endpoint for Prometheus scraping
    • Exposes device health, temperature, and SMART attributes
    • Enables integration with Prometheus/Grafana monitoring stacks
PR #16
Release v1.1.0
Docker ghcr.io/starosdev/scrutiny

Thanks for the contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request priority:medium Medium priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SCR-5] Merge upstream PR #830: Add Prometheus metrics support

3 participants