Skip to content

Omit the django-prometheus middleware if METRICS_ENABLED is false #16010

Closed
@jeremystretch

Description

@jeremystretch

Proposed Changes

NetBox supports the export of Prometheus metrics via django-prometheus if configured to do so. Metrics export is disabled by default, however the middleware is still active. This issue proposes enabling the middleware only when METRICS_ENABLED is true.

Justification

We may be able to optimize performance and shrink our bug surface a bit by disabling this middleware when metrics are not in use.

Metadata

Metadata

Assignees

Labels

status: acceptedThis issue has been accepted for implementationtype: housekeepingChanges to the application which do not directly impact the end user

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions