Skip to content

Commit c2ef5ab

Browse files
committed
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
1 parent babc712 commit c2ef5ab

28 files changed

+2666
-41
lines changed

artifacts/artifacts.bullseye.tar.gz

1.88 MB
Binary file not shown.

artifacts/artifacts.buster.tar.gz

-57.7 MB
Binary file not shown.

freeze_requirements.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ REQUIREMENTS=${BASE}/requirements.txt
1212
REQUIREMENTS_FIXED=${BASE}/frozen-requirements-${DISTRO}.txt
1313

1414
pip3 install -r "$REQUIREMENTS"
15+
pip3 install ${BASE}/plugins/ntc-netbox-plugin-metrics-ext
1516
pip3 freeze --all --local --requirement "$REQUIREMENTS_FIXED" > "$REQUIREMENTS_FIXED"
1617
# https://github.com/pypa/pip/issues/4668
1718
sed -i '/pkg-resources==0.0.0/d' "$REQUIREMENTS_FIXED"

frozen-requirements-bullseye.txt

Lines changed: 43 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
aniso8601==7.0.0
33
asgiref==3.5.2
44
async-timeout==4.0.2
5-
attrs==21.4.0
5+
attrs==22.1.0
66
cachetools==5.2.0
7-
certifi==2022.6.15
8-
cffi==1.15.0
9-
charset-normalizer==2.0.12
7+
certifi==2022.9.24
8+
cffi==1.15.1
9+
charset-normalizer==2.1.1
1010
click==8.1.3
1111
coreapi==2.3.3
1212
coreschema==0.0.4
13-
cryptography==37.0.3
13+
cryptography==38.0.1
1414
debtcollector==2.5.0
1515
defusedxml==0.7.1
1616
Deprecated==1.2.13
@@ -35,35 +35,36 @@ djangorestframework==3.13.1
3535
dnspython==1.16.0
3636
drf-yasg==1.20.0
3737
eventlet==0.33.1
38-
Flask==2.1.2
38+
Flask==2.2.2
3939
ghp-import==2.1.0
40-
google-api-core==2.8.2
41-
google-api-python-client==2.51.0
42-
google-auth==2.8.0
40+
google-api-core==2.10.2
41+
google-api-python-client==2.64.0
42+
google-auth==2.12.0
4343
google-auth-httplib2==0.1.0
44-
googleapis-common-protos==1.56.3
44+
googleapis-common-protos==1.56.4
4545
graphene==2.1.9
4646
graphene-django==2.15.0
4747
graphql-core==2.3.2
4848
graphql-relay==2.0.1
49-
greenlet==1.1.2
49+
greenlet==1.1.3.post0
5050
gunicorn==20.1.0
5151
httplib2==0.20.4
52-
idna==3.3
53-
importlib-metadata==4.11.4
52+
idna==3.4
53+
importlib-metadata==5.0.0
5454
inflection==0.5.1
55-
iso8601==1.0.2
55+
invoke==1.7.3
56+
iso8601==1.1.0
5657
itsdangerous==2.1.2
5758
itypes==1.2.0
5859
Jinja2==3.1.2
5960
jsonschema==3.2.0
60-
keystoneauth1==4.6.0
61-
lxml==4.9.0
61+
keystoneauth1==5.0.0
62+
lxml==4.9.1
6263
Markdown==3.3.6
6364
markdown-include==0.6.0
6465
MarkupSafe==2.1.1
6566
mergedeep==1.3.4
66-
mkdocs==1.3.0
67+
mkdocs==1.4.0
6768
mkdocs-autorefs==0.4.1
6869
mkdocs-material==8.2.11
6970
mkdocs-material-extensions==1.0.3
@@ -72,73 +73,74 @@ mkdocstrings-python-legacy==0.2.2
7273
msgpack==1.0.4
7374
netaddr==0.8.0
7475
netifaces==0.11.0
75-
oauthlib==3.2.0
76+
ntc-netbox-plugin-metrics-ext @ file:///deploy/plugins/ntc-netbox-plugin-metrics-ext
77+
oauthlib==3.2.1
7678
os-service-types==1.7.0
77-
oslo.config==8.8.0
79+
oslo.config==9.0.0
7880
oslo.i18n==5.1.0
79-
oslo.serialization==4.3.0
80-
oslo.utils==5.0.0
81+
oslo.serialization==5.0.0
82+
oslo.utils==6.0.1
8183
packaging==21.3
8284
PasteDeploy==2.1.1
83-
pbr==5.9.0
85+
pbr==5.10.0
8486
phabricator==0.9.1
8587
Pillow==9.1.0
86-
pip==22.1.2
88+
pip==22.2.2
8789
prometheus-client==0.14.1
8890
promise==2.3
89-
protobuf==4.21.1
91+
protobuf==4.21.7
9092
psycopg2-binary==2.9.3
9193
pyasn1==0.4.8
9294
pyasn1-modules==0.2.8
9395
pycparser==2.21
9496
pycryptodome==3.9.9
9597
pyeclib==1.6.1
9698
Pygments==2.11.2
97-
PyJWT==2.4.0
99+
PyJWT==2.5.0
98100
pymdown-extensions==9.3
99101
PyMySQL==1.0.2
100102
pynetbox==4.3.3
101103
pyparsing==3.0.9
102104
pyrsistent==0.18.1
103105
python-cas==1.6.0
104106
python-dateutil==2.8.2
105-
python-keystoneclient==4.5.0
106-
python-ldap==3.4.0
107+
python-keystoneclient==5.0.1
108+
python-ldap==3.4.3
107109
python-magic==0.4.27
108-
python-swiftclient==4.0.0
110+
python-swiftclient==4.1.0
109111
python3-openid==3.2.0
110112
pytkdocs==0.16.1
111-
pytz==2022.1
113+
pytz==2022.4
112114
PyYAML==6.0
113115
pyyaml_env_tag==0.1
114-
redis==4.3.3
115-
requests==2.28.0
116+
redis==4.3.4
117+
requests==2.28.1
116118
requests-oauthlib==1.3.1
117119
rfc3986==2.0.0
118-
rq==1.10.1
119-
rsa==4.8
120+
rq==1.11.1
121+
rsa==4.9
120122
ruamel.yaml==0.17.21
121123
ruamel.yaml.clib==0.2.6
122124
Rx==1.6.1
123-
setuptools==62.6.0
125+
setuptools==65.4.1
124126
singledispatch==3.7.0
125127
six==1.16.0
126128
social-auth-app-django==5.0.0
127129
social-auth-core==4.2.0
128-
sqlparse==0.4.2
129-
stevedore==3.5.0
130+
sqlparse==0.4.3
131+
stevedore==4.0.0
130132
svgwrite==1.4.2
131-
swagger-spec-validator==2.7.4
132-
swift==2.29.1
133+
swagger-spec-validator==2.7.6
134+
swift==2.30.0
133135
tablib==3.2.1
134136
text-unidecode==1.3
135137
tzdata==2022.1
136138
uritemplate==4.1.1
137-
urllib3==1.26.9
139+
urllib3==1.26.12
138140
watchdog==2.1.9
139-
Werkzeug==2.1.2
141+
Werkzeug==2.2.2
140142
wheel==0.34.2
141143
wmflib==1.2.0
142144
wrapt==1.14.1
143145
xattr==0.9.9
144-
zipp==3.8.0
146+
zipp==3.9.0
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*.egg-info
2+
__pycache__
3+
*.swp
4+
dist
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[pydocstyle]
2+
convention = google
3+
inherit = false
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[MASTER]
2+
# Include the pylint_django plugin to avoid spurious warnings about Django patterns
3+
load-plugins=pylint_django
4+
5+
# Don't cache data for later comparisons
6+
persistent=no
7+
8+
[BASIC]
9+
# Don't require docstrings for inner Meta classes (or private classes starting with _)
10+
no-docstring-rgx=^(_|Meta$)
11+
12+
[MISCELLANEOUS]
13+
# Don't currently throw warnings for TODO comments - we should eventually remove this
14+
notes=FIXME,XXX,
15+
16+
[MESSAGE CONTROL]
17+
# Disabled due to contention with Black: bad-continuation, line-too-long
18+
# Disabled due to noise: too-few-public-methods, too-many-ancestors, too-many-instance-attributes
19+
disable=bad-continuation,
20+
line-too-long,
21+
too-few-public-methods,
22+
too-many-ancestors,
23+
too-many-instance-attributes,
24+
duplicate-code
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
language: python
3+
python:
4+
- '3.6'
5+
- '3.7'
6+
- '3.8'
7+
env:
8+
# Each version of NetBox listed here must have a corresponding directory/configuration file
9+
# under development/netbox_<NETBOX_VER>/configuration.py
10+
matrix:
11+
- NETBOX_VER=v2.8.9
12+
- NETBOX_VER=v2.9.11
13+
- NETBOX_VER=v2.10.4
14+
15+
services:
16+
- docker
17+
# --------------------------------------------------------------------------
18+
# Tests
19+
# --------------------------------------------------------------------------
20+
before_script:
21+
- pip install invoke docker-compose
22+
- curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py > /tmp/get-poetry.py
23+
- python /tmp/get-poetry.py -y --version 1.0.2
24+
- source $HOME/.poetry/env
25+
26+
script:
27+
- invoke build --python-ver $TRAVIS_PYTHON_VERSION
28+
- invoke tests --python-ver $TRAVIS_PYTHON_VERSION
29+
# --------------------------------------------------------------------------
30+
# Deploy
31+
# --------------------------------------------------------------------------
32+
deploy:
33+
provider: script
34+
script: poetry config pypi-token.pypi $PYPI_TOKEN && poetry publish --build
35+
skip_cleanup: true
36+
on:
37+
tags: true
38+
branch: master
39+
condition: $NETBOX_VER = master
40+
python: 3.7
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
extends: default
3+
4+
rules:
5+
truthy: disable
6+
brackets: { min-spaces-inside: 0, max-spaces-inside: 1 }
7+
braces: { min-spaces-inside: 0, max-spaces-inside: 1 }
8+
line-length: { allow-non-breakable-inline-mappings: true, allow-non-breakable-words: true, max: 180 }
9+
comments-indentation: disable
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Frequently Asked Questions
2+
3+
## NetBox already expose a metrics endpoint, why do I need another one ?
4+
5+
> System metrics and application level metrics are complementary with each other
6+
> - **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`.
7+
> - **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.
8+
9+
## Do I need an API token to access the application metrics endpoint ?
10+
11+
> No, currently no authentication is required (or possible).
12+
13+
## I don't see the plugin in the API documentation, is it expected ?
14+
15+
> Yes, this is expected. This API endpoint is not published in the swagger documentation because it's not a REST compatible endpoint.
16+
17+
## Does this plugin support NetBox 2.9 ?
18+
19+
> Yes

0 commit comments

Comments
 (0)