-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ntc-netbox-plugin-metrics-ext plugin
Through copying it to the -deploy directory and applying manually the needed change (see PR bellow). Adapting freeze_requirements.sh accordingly so it's included in the wheels. Ideally only temporarily the time to check that it's working fine. Longer term is either networktocode/ntc-netbox-plugin-metrics-ext#22 gets merged and a new pypi is released. Or we decide to maintain our own fork. Bug: T311052 Change-Id: I31a347a29d7b1e8c2e5d75eaaa0828890bbbf8af
- Loading branch information
Showing
28 changed files
with
2,666 additions
and
41 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
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,4 @@ | ||
*.egg-info | ||
__pycache__ | ||
*.swp | ||
dist |
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,3 @@ | ||
[pydocstyle] | ||
convention = google | ||
inherit = false |
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,24 @@ | ||
[MASTER] | ||
# Include the pylint_django plugin to avoid spurious warnings about Django patterns | ||
load-plugins=pylint_django | ||
|
||
# Don't cache data for later comparisons | ||
persistent=no | ||
|
||
[BASIC] | ||
# Don't require docstrings for inner Meta classes (or private classes starting with _) | ||
no-docstring-rgx=^(_|Meta$) | ||
|
||
[MISCELLANEOUS] | ||
# Don't currently throw warnings for TODO comments - we should eventually remove this | ||
notes=FIXME,XXX, | ||
|
||
[MESSAGE CONTROL] | ||
# Disabled due to contention with Black: bad-continuation, line-too-long | ||
# Disabled due to noise: too-few-public-methods, too-many-ancestors, too-many-instance-attributes | ||
disable=bad-continuation, | ||
line-too-long, | ||
too-few-public-methods, | ||
too-many-ancestors, | ||
too-many-instance-attributes, | ||
duplicate-code |
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,40 @@ | ||
--- | ||
language: python | ||
python: | ||
- '3.6' | ||
- '3.7' | ||
- '3.8' | ||
env: | ||
# Each version of NetBox listed here must have a corresponding directory/configuration file | ||
# under development/netbox_<NETBOX_VER>/configuration.py | ||
matrix: | ||
- NETBOX_VER=v2.8.9 | ||
- NETBOX_VER=v2.9.11 | ||
- NETBOX_VER=v2.10.4 | ||
|
||
services: | ||
- docker | ||
# -------------------------------------------------------------------------- | ||
# Tests | ||
# -------------------------------------------------------------------------- | ||
before_script: | ||
- pip install invoke docker-compose | ||
- curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py > /tmp/get-poetry.py | ||
- python /tmp/get-poetry.py -y --version 1.0.2 | ||
- source $HOME/.poetry/env | ||
|
||
script: | ||
- invoke build --python-ver $TRAVIS_PYTHON_VERSION | ||
- invoke tests --python-ver $TRAVIS_PYTHON_VERSION | ||
# -------------------------------------------------------------------------- | ||
# Deploy | ||
# -------------------------------------------------------------------------- | ||
deploy: | ||
provider: script | ||
script: poetry config pypi-token.pypi $PYPI_TOKEN && poetry publish --build | ||
skip_cleanup: true | ||
on: | ||
tags: true | ||
branch: master | ||
condition: $NETBOX_VER = master | ||
python: 3.7 |
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,9 @@ | ||
--- | ||
extends: default | ||
|
||
rules: | ||
truthy: disable | ||
brackets: { min-spaces-inside: 0, max-spaces-inside: 1 } | ||
braces: { min-spaces-inside: 0, max-spaces-inside: 1 } | ||
line-length: { allow-non-breakable-inline-mappings: true, allow-non-breakable-words: true, max: 180 } | ||
comments-indentation: disable |
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,19 @@ | ||
# Frequently Asked Questions | ||
|
||
## NetBox already expose a metrics endpoint, why do I need another one ? | ||
|
||
> System metrics and application level metrics are complementary with each other | ||
> - **SYSTEM Metrics** are very useful to instrument code, track ephemeral information and get a better visibility into what is happening. (Example of metrics: nbr of requests, requests per second, nbr of exceptions, response time, etc ...) The idea is that if we have multiple NetBox instances running behind a load balancer each one will produce a different set of metrics and the monitoring system needs to collect these metrics from all running instances and aggregate them in a dashboard. NetBox exposes some system metrics by default at `localhost/metrics`. | ||
> - **APPLICATION Metrics** are at a higher level and represent information that is the same across all instances of an application running behind a load balancer. if I have 3 instances of NetBox running, there is no point to ask each of them how many Device objects I have in the database, since they will always return the same information. In this case, the goal is to expose only 1 endpoint that can be served by any running instance. | ||
## Do I need an API token to access the application metrics endpoint ? | ||
|
||
> No, currently no authentication is required (or possible). | ||
## I don't see the plugin in the API documentation, is it expected ? | ||
|
||
> Yes, this is expected. This API endpoint is not published in the swagger documentation because it's not a REST compatible endpoint. | ||
## Does this plugin support NetBox 2.9 ? | ||
|
||
> Yes |
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,15 @@ | ||
Apache Software License 2.0 | ||
|
||
Copyright (c) 2020, Network to Code, LLC | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. |
Oops, something went wrong.