[PR #19966] [MERGED] Closes #19965: Expand Prometheus metrics #15776

Closed
opened 2025-12-30 00:24:00 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/19966
Author: @jeremystretch
Created: 7/28/2025
Status: Merged
Merged: 7/31/2025
Merged by: @arthanson

Base: featureHead: 19965-prometheus-metrics


📝 Commits (5)

  • f315597 Subclass django_prometheus middleware to capture REST API metrics
  • 55e1929 Introduce is_graphql_request() utility function
  • 16aa8d3 Add metric for total GraphQL queries
  • 3ae4e18 Update docs
  • d9ca82c Correct metric name

📊 Changes

5 files changed (+81 additions, -3 deletions)

View changed files

📝 docs/integrations/prometheus-metrics.md (+2 -0)
netbox/netbox/metrics.py (+40 -0)
📝 netbox/netbox/middleware.py (+29 -1)
📝 netbox/netbox/settings.py (+2 -2)
📝 netbox/utilities/api.py (+8 -0)

📄 Description

Closes: #19965

  • Introduce is_graphql_request() utility function
  • Subclass Metrics to add REST & GraphQL API request counters
  • Create subclasses of the stock before & after middleware
  • Extend PrometheusAfterMiddleware to increase counters for REST & GraphQL API requests

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/19966 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 7/28/2025 **Status:** ✅ Merged **Merged:** 7/31/2025 **Merged by:** [@arthanson](https://github.com/arthanson) **Base:** `feature` ← **Head:** `19965-prometheus-metrics` --- ### 📝 Commits (5) - [`f315597`](https://github.com/netbox-community/netbox/commit/f3155973f6f9620f8147243f53917a08e9bfd369) Subclass django_prometheus middleware to capture REST API metrics - [`55e1929`](https://github.com/netbox-community/netbox/commit/55e1929744a0269726200be276e49078bedd286c) Introduce is_graphql_request() utility function - [`16aa8d3`](https://github.com/netbox-community/netbox/commit/16aa8d3a3ffbd28abeaedce395a21da8e57cecf2) Add metric for total GraphQL queries - [`3ae4e18`](https://github.com/netbox-community/netbox/commit/3ae4e18f8e2c1f92056efdba89e0726df1b14eed) Update docs - [`d9ca82c`](https://github.com/netbox-community/netbox/commit/d9ca82c8fc493e71234fb9cb8783a96128457a23) Correct metric name ### 📊 Changes **5 files changed** (+81 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `docs/integrations/prometheus-metrics.md` (+2 -0) ➕ `netbox/netbox/metrics.py` (+40 -0) 📝 `netbox/netbox/middleware.py` (+29 -1) 📝 `netbox/netbox/settings.py` (+2 -2) 📝 `netbox/utilities/api.py` (+8 -0) </details> ### 📄 Description ### Closes: #19965 - Introduce `is_graphql_request()` utility function - Subclass `Metrics` to add REST & GraphQL API request counters - Create subclasses of the stock before & after middleware - Extend PrometheusAfterMiddleware to increase counters for REST & GraphQL API requests --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-30 00:24:00 +01:00
adam closed this issue 2025-12-30 00:24:00 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15776