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

Add prometheus metrics - Redo #15514

Closed

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

Copy link

netlify bot commented Dec 14, 2024

Deploy Preview for frigate-docs canceled.

Name Link
🔨 Latest commit 39d0f65
🔍 Latest deploy log https://app.netlify.com/sites/frigate-docs/deploys/675dd5b9c388260008a59fb6

@mitchross mitchross mentioned this pull request Dec 14, 2024
@mitchross
Copy link
Contributor Author

@NickM-27 how am I supposed to address the merge commit blocked issue?

@NickM-27 NickM-27 changed the base branch from dev to 0.16 December 14, 2024 22:01
@NickM-27
Copy link
Collaborator

This will need to target 0.16, I think it should be good to go now though once another maintainer can take a look

@mitchross
Copy link
Contributor Author

This will need to target 0.16, I think it should be good to go now though once another maintainer can take a look

thank you!

@hawkeye217
Copy link
Collaborator

Looks like the merge with the 0.16 branch brought in more changes than the original PR. The only thing I'd like to see is at least a mention somewhere in the docs for the new functionality/capabilities that this PR offers.

@mitchross
Copy link
Contributor Author

Looks like the merge with the 0.16 branch brought in more changes than the original PR. The only thing I'd like to see is at least a mention somewhere in the docs for the new functionality/capabilities that this PR offers.

Ok I added docs.. Not sure how many files i should check in for docs. I ran it locally, it had a ton of docs changed.. let me know if Im supposed to check all the newly generated files in?

@hawkeye217
Copy link
Collaborator

Looks like the merge with the 0.16 branch brought in more changes than the original PR. The only thing I'd like to see is at least a mention somewhere in the docs for the new functionality/capabilities that this PR offers.

Ok I added docs.. Not sure how many files i should check in for docs. I ran it locally, it had a ton of docs changed.. let me know if Im supposed to check all the newly generated files in?

I'd drop this under the Integrations sidebar entries under MQTT rather than Configuration. Otherwise, looks good.

@blakeblackshear
Copy link
Owner

Generally you are going to be better off rebasing your work on the 0.16 branch. That will get rid of the extra unrelated changes so the PR is cleaner.

@mitchross mitchross force-pushed the prometheus-metrics-redo branch from 8e29fec to d5a4cf3 Compare December 15, 2024 18:00
@mitchross mitchross closed this Dec 15, 2024
@mitchross
Copy link
Contributor Author

redoing on new branch -> #15521

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.

5 participants