Skip to content

Commit

Permalink
moving lab files to aclabs
Browse files Browse the repository at this point in the history
  • Loading branch information
noredistribution committed Oct 14, 2024
1 parent 3bb3629 commit 40a9889
Show file tree
Hide file tree
Showing 61 changed files with 19 additions and 13,499 deletions.
Binary file added docs/_media/aclabs-telemetryA-grafana-ex1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_media/aclabs-telemetryA-grafana-ex2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_media/aclabs-telemetryA-grafana-ex3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_media/aclabs-telemetryA-grafana-ex4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
112 changes: 19 additions & 93 deletions docs/telemetry/adapters/gnmic/prometheus-grafana-demo/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,112 +7,38 @@ categories:

## Introduction

Prometheus is an open-source monitoring and alerting toolkit designed primarily for cloud-native
environments, including Kubernetes. Developed by SoundCloud in 2012, it has gained popularity due
to its ability to collect and store metrics as time-series data, which includes timestamps and
optional key-value pairs known as labels. (1) // --> TODO add citation

Prometheus operates on a pull-based model, where it scrapes metrics from HTTP endpoints exposed
by monitored services, storing this data in a time-series database. Users can query this data
using PromQL, a powerful query language, to generate alerts and visualize metrics through tools
like Grafana. (2) // --> TODO add citation

Since joining the Cloud Native Computing Foundation in 2016, Prometheus has become a cornerstone
in the monitoring landscape, particularly suited for dynamic service-oriented architectures and
microservices. (3) // --> TODO add citation
This lab deploys a small cEOS-lab topology using containerlab and uses [gNMIc](https://gnmic.openconfig.net/) to subscribe and collect telemetry states and output them into [Prometheus](https://prometheus.io/docs/prometheus/latest/getting_started/) and visualize the data in [Grafana](https://grafana.com/).

## Prerequisite

- [Containerlab](https://containerlab.dev/)
- [Docker](https://www.docker.com/)
- [cEOS](https://containerlab.dev/manual/kinds/ceos/)
- github account
- laptop or server with [Docker](https://www.docker.com/) and [git](https://git-scm.com/downloads) installed
- [arista.com] account to download cEOS-lab

cEOS lab will need to be downloaded from the arista software downloads
and imported via docker with a tag of e.g. 4.32.2F
cEOS-lab is autodownloaded using the arista.com token in either codespaces or the devcontainer examples.

## Environment

![topology](../../../../_media/topology.drawio.png)
Check for more details on the prerequisites on the [Arista Community Labs QuickStart](https://aclabs.arista.com/quickstart/).

The Containerlab file
## Lab Topology

<details><summary>Reveal output</summary>
<p>
![topology](../../../../_media/topology.drawio.png)

```yaml
--8<-- "src/gnmic-prometheus/topology.yaml"
```
### Running the lab

</p>
</details>
The lab can be run in multiple ways:
- codespaces
- locally using devcontainer (either on local PC/laptop or using Remote SSH to a server via vscode)

Looking at the `gnmic.yml` file
To run it codespaces please press the button below and follow:

<details><summary>Reveal output</summary>
<p>
[Start :octicons-play-16: gNMIc-Prometheus-Grafana Lab :octicons-mark-github-24:](https://codespaces.new/aristanetworks/aclabs/tree/main?quickstart=1&devcontainer_path=.devcontainer%2Fgnmic-prometheus-grafana%2Fdevcontainer.json){ .md-button .md-button--primary target=_blank}

```bash
--8<-- "src/gnmic-prometheus/gnmic.yml"
```
After the lab is deployed, the containerlab topology will automatically start and Codespaces will send a notification and reveal the `Open in Browser` button where Grafana can be accessed.

We can see that we're going to use `gnmic` to subscribe to several OpenConfig and EOS native paths
and write the data into Prometheus either in their raw states or modifying them
with [processors](https://gnmic.openconfig.net/user_guide/event_processors/intro/), which
are needed due to Prometheus only accepting numerical values.
![grafana1](_media/aclabs-telemetryA-grafana-ex1.png)

</p>
</details>
![grafana2](assets/img/aclabs-telemetryA-grafana-ex2.png)

### Running the lab
![grafana3](assets/img/aclabs-telemetryA-grafana-ex3.png)

```bash
cd src/gnmic-prometheus/
containerlab -t topology.yaml deploy
```

or

`containerlab -t topology.yaml deploy --reconfigure` on subsequent runs when modifications are made

Our environment should look as the following:

```shell
+----+--------------------+--------------+-------------------------------------------------------------+-------+---------+--------------------+------------------------+
| # | Name | Container ID | Image | Kind | State | IPv4 Address | IPv6 Address |
+----+--------------------+--------------+-------------------------------------------------------------+-------+---------+--------------------+------------------------+
| 1 | clab-om-avd | 2b71ef8fe868 | ghcr.io/aristanetworks/avd/universal:python3.12-avd-v4.10.2 | linux | running | 172.144.100.230/24 | 2001:172:144:100::7/80 |
| 2 | clab-om-client1 | 5d6f06a162d3 | alpine-host | linux | running | 172.144.100.8/24 | 2001:172:144:100::8/80 |
| 3 | clab-om-client2 | 95642c587a14 | alpine-host | linux | running | 172.144.100.9/24 | 2001:172:144:100::9/80 |
| 4 | clab-om-client3 | d4fd040c251b | alpine-host | linux | running | 172.144.100.10/24 | 2001:172:144:100::a/80 |
| 5 | clab-om-client4 | f98b0a992d42 | alpine-host | linux | running | 172.144.100.11/24 | 2001:172:144:100::c/80 |
| 6 | clab-om-gnmic | 7676f355ade9 | ghcr.io/openconfig/gnmic:0.38.2 | linux | running | 172.144.100.200/24 | 2001:172:144:100::2/80 |
| 7 | clab-om-grafana | 0fa1af12aac9 | grafana/grafana:11.2.0 | linux | running | 172.144.100.220/24 | 2001:172:144:100::d/80 |
| 8 | clab-om-om-pe11 | bd4888d56a1a | ceosimage:4.32.2F | ceos | running | 172.144.100.4/24 | 2001:172:144:100::4/80 |
| 9 | clab-om-om-pe12 | 51fe187893c7 | ceosimage:4.32.2F | ceos | running | 172.144.100.5/24 | 2001:172:144:100::b/80 |
| 10 | clab-om-om-pe21 | b9ed639155cb | ceosimage:4.32.2F | ceos | running | 172.144.100.6/24 | 2001:172:144:100::3/80 |
| 11 | clab-om-om-pe22 | 2b0061a2aec0 | ceosimage:4.32.2F | ceos | running | 172.144.100.7/24 | 2001:172:144:100::f/80 |
| 12 | clab-om-om-spine1 | 582e33ddbdb6 | ceosimage:4.32.2F | ceos | running | 172.144.100.2/24 | 2001:172:144:100::5/80 |
| 13 | clab-om-om-spine2 | a5f28f53582e | ceosimage:4.32.2F | ceos | running | 172.144.100.3/24 | 2001:172:144:100::6/80 |
| 14 | clab-om-prometheus | 04cdbdd65795 | prom/prometheus:v2.54.1 | linux | running | 172.144.100.210/24 | 2001:172:144:100::e/80 |
+----+--------------------+--------------+-------------------------------------------------------------+-------+---------+--------------------+------------------------+
```

Now we're ready to access Grafana at http://myserver:3001 (arista/arista)

To add configurations to the switches, such as configuring EVPN, we can use the clab-om-avd
container and run the Ansible playbook inside.:

```shell
docker exec -it clab-om-avd zsh
cd project
ansible-playbook playbooks/fabric-deploy-config.yaml -i inventory.yaml
```

> NOTE You might need to create the avd user on the host if it doesn't exist, otherwise the
container won't be able to create files.

```shell
useradd avd
usermod -aG wheel avd
chown -R avd:avd ./
```
For more details and to run it in devcontainer please check the [Arista Community Labs](https://aclabs.arista.com/telemetry) site.
121 changes: 0 additions & 121 deletions src/gnmic-prometheus/.topology.yaml.bak

This file was deleted.

21 changes: 0 additions & 21 deletions src/gnmic-prometheus/Makefile

This file was deleted.

15 changes: 0 additions & 15 deletions src/gnmic-prometheus/ansible.cfg

This file was deleted.

41 changes: 0 additions & 41 deletions src/gnmic-prometheus/ceos.cfg.tpl

This file was deleted.

Loading

0 comments on commit 40a9889

Please sign in to comment.