-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3271 from digitalocean/develop
Release v2.6.0
- Loading branch information
Showing
180 changed files
with
6,807 additions
and
1,795 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
sudo: required | ||
services: | ||
- postgresql | ||
- redis-server | ||
addons: | ||
postgresql: "9.4" | ||
language: python | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Caching | ||
|
||
To improve performance, NetBox supports caching for most object and list views. Caching is implemented using Redis, | ||
and [django-cacheops](https://github.com/Suor/django-cacheops) | ||
|
||
Several management commands are avaliable for administrators to manaully invalidate cache entries in extenuating circumstances. | ||
|
||
To invalidate a specifc model instance (for example a Device with ID 34): | ||
``` | ||
python netbox/manage.py invalidate dcim.Device.34 | ||
``` | ||
|
||
To invalidate all instance of a model: | ||
``` | ||
python netbox/manage.py invalidate dcim.Device | ||
``` | ||
|
||
To flush the entire cache database: | ||
``` | ||
python netbox/manage.py invalidate all | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Prometheus Metrics | ||
|
||
NetBox supports optionally exposing native Prometheus metrics from the application. [Prometheus](https://prometheus.io/) is a popular time series metric platform used for monitoring. | ||
|
||
NetBox exposes metrics at the `/metrics` HTTP endpoint, e.g. `https://netbox.local/metrics`. Metric exposition can be toggled with the `METRICS_ENABLED` configuration setting. Metrics are not exposed by default. | ||
|
||
## Metric Types | ||
|
||
NetBox makes use of the [django-prometheus](https://github.com/korfuri/django-prometheus) library to export a number of different types of metrics, including: | ||
|
||
- Per model insert, update, and delete counters | ||
- Per view request counters | ||
- Per view request latency histograms | ||
- Request body size histograms | ||
- Response body size histograms | ||
- Response code counters | ||
- Database connection, execution, and error counters | ||
- Cache hit, miss, and invalidation counters | ||
- Django middleware latency histograms | ||
- Other Django related metadata metrics | ||
|
||
For the exhaustive list of exposed metrics, visit the `/metrics` endpoint on your NetBox instance. | ||
|
||
## Multi Processing Notes | ||
|
||
When deploying NetBox in a multiprocess mannor--such as using Gunicorn as recomented in the installation docs--the Prometheus client library requires the use of a shared directory | ||
to collect metrics from all the worker processes. This can be any arbitrary directory to which the processes have read/write access. This directory is then made available by use of the | ||
`prometheus_multiproc_dir` environment variable. | ||
|
||
This can be setup by first creating a shared directory and then adding this line (with the appropriate directory) to the `[program:netbox]` section of the supervisor config file. | ||
|
||
``` | ||
environment=prometheus_multiproc_dir=/tmp/prometheus_metrics | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.