Skip to content

Conversation

@mitchross
Copy link
Contributor

Redo of -> #5594
Addresses #2266

Proposed change

This PR adds comprehensive Prometheus metrics support to Frigate, enabling better monitoring and observability of the system. The integration:

  • Exposes a /metrics endpoint in Prometheus format
  • Leverages existing stats collection system
  • Provides detailed metrics for:
    • Camera performance (FPS, detection rates)
    • System resources (CPU, memory, GPU usage)
    • Storage utilization
    • Detection performance
    • Service health metrics
    • Temperature monitoring

This will allow users to:

  • Monitor Frigate performance using industry-standard tools
  • Create custom dashboards in Grafana
  • Set up alerts based on metrics
  • Track long-term performance trends

The implementation piggybacks on the existing stats collection system, ensuring minimal overhead while providing valuable monitoring capabilities.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code
  • Documentation Update

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • The code has been formatted using Ruff (ruff format frigate)

Additional Notes:

  • The implementation uses the official prometheus_client library
  • Metrics follow Prometheus naming conventions
  • No breaking changes to existing functionality
  • Minimal performance impact as it uses existing stats collection
  • All metrics are properly documented with descriptions
  • Labels are used consistently for better querying

@mitchross mitchross mentioned this pull request Dec 15, 2024
10 tasks
@mitchross
Copy link
Contributor Author

@hawkeye217 @NickM-27 @blakeblackshear - redid the branch

@hawkeye217
Copy link
Collaborator

Looks good, thanks!

@NickM-27 NickM-27 merged commit 5fc028f into blakeblackshear:0.16 Dec 15, 2024
6 checks passed
@jangrewe
Copy link

Thanks @mitchross! ♥️

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