Skip to content

Commit

Permalink
Various fixes and adding README front-matter with icon
Browse files Browse the repository at this point in the history
  • Loading branch information
cmsirbu committed Nov 30, 2023
1 parent 504bcfb commit 2178648
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 24 deletions.
27 changes: 15 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
# Metrics & Monitoring Extension App

A plugin for [Nautobot](https://github.com/nautobot/nautobot) to expose additional metrics information.
<p align="center">
<img src="https://raw.githubusercontent.com/nautobot/nautobot-plugin-capacity-metrics/develop/docs/images/icon-nautobot-capacity-metrics.svg" class="logo" height="200px">
<br>
<a href="https://github.com/nautobot/nautobot-plugin-capacity-metrics/actions"><img src="https://github.com/nautobot/nautobot-plugin-capacity-metrics/actions/workflows/ci.yml/badge.svg?branch=main"></a>
<a href="https://docs.nautobot.com/projects/capacity-metrics/en/latest/"><img src="https://readthedocs.org/projects/nautobot-plugin-capacity-metrics/badge/"></a>
<a href="https://pypi.org/project/nautobot-capacity-metrics/"><img src="https://img.shields.io/pypi/v/nautobot-capacity-metrics"></a>
<a href="https://pypi.org/project/nautobot-capacity-metrics/"><img src="https://img.shields.io/pypi/dm/nautobot-capacity-metrics"></a>
<br>
An <a href="https://www.networktocode.com/nautobot/apps/">App</a> for <a href="https://nautobot.com/">Nautobot that exposes additional metrics information</a>.
</p>

The plugin is composed of multiple features that can be used independently:
## Metrics Endpoints

- Application Metrics Endpoint: prometheus endpoint at `/api/plugins/capacity-metrics/app-metrics`

# Application Metrics Endpoint

Nautobot already exposes some information via a Prometheus endpoint but the information currently available are mostly at the system level and not at the application level.
Nautobot already exposes some information via a Prometheus endpoint but the information currently available are mostly at the system level and not at the application level. 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 when multiple instances of Nautobot are 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. Nautobot exposes some system metrics at `localhost/metrics` [Nautobot DOC](https://nautobot.readthedocs.io/en/stable/additional-features/prometheus-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 Nautobot 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.

System metrics and application level metrics are complementary with each other
- **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 Nautobot 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. The prometheus endpoint is at `/api/plugins/capacity-metrics/app-metrics`.

Currently the plugin exposes these simple metrics by default:
Currently the app exposes these simple metrics by default:

- Jobs stats
- Models count (configurable via nautobot_config.py)

In addition, it is possible to use the plugin configuration to expose metrics about the versions of Python, Django, Nautobot and the installed Nautobot plugins.
In addition, it is possible to use the app configuration to expose metrics about the versions of Python, Django, Nautobot and the installed Nautobot apps/plugins.

## Try it out!

Expand Down
3 changes: 0 additions & 3 deletions docs/admin/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ sudo systemctl restart nautobot nautobot-worker nautobot-scheduler

## App Configuration

!!! warning "Developer Note - Remove Me!"
Any configuration required to get the App set up. Edit the table below as per the examples provided.

The plugin behavior can be controlled with the following list of settings:

| Key | Example | Default | Description |
Expand Down
1 change: 1 addition & 0 deletions docs/images/icon-nautobot-capacity-metrics.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 6 additions & 5 deletions docs/user/faq.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
# Frequently Asked Questions

## Nautobot already expose a metrics endpoint, why do I need another one ?
## Nautobot already exposes a metrics endpoint, why do I need another one?

> System metrics and application level metrics are complementary with each other
> 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 Nautobot 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. Nautobot 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 Nautobot 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 ?
## 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 ?
## 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 Nautobot 2.0 ?
## Does this plugin support Nautobot 2.0?

> Yes
8 changes: 4 additions & 4 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@ nav:
- Compatibility Matrix: "admin/compatibility_matrix.md"
- Release Notes:
- "admin/release_notes/index.md"
- v1.0: "admin/release_notes/version_1.0.md"
- v1.1: "admin/release_notes/version_1.1.md"
- v2.0: "admin/release_notes/version_2.0.md"
- v2.1: "admin/release_notes/version_2.1.md"
- v3.0: "admin/release_notes/version_3.0.md"
- v2.1: "admin/release_notes/version_2.1.md"
- v2.0: "admin/release_notes/version_2.0.md"
- v1.1: "admin/release_notes/version_1.1.md"
- v1.0: "admin/release_notes/version_1.0.md"
- Developer Guide:
- Extending the App: "dev/extending.md"
- Contributing to the App: "dev/contributing.md"
Expand Down

0 comments on commit 2178648

Please sign in to comment.