Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Streaming Guide

Apstra Streaming Plugin Overview

You can configure Apstra to generate Google Protocol Buffer (protobuf) streams for counter data (perfmon), alerts, and events. Each data type is streamed to a receiver over its own TCP socket, maintaining separate connections even if configured for the same receiver. This also allows for all three data types to be sent to three different streaming receivers. You can choose from the many open-source projects, or develop your own solutions to capture, store, and analyze the protobuf data.

Juniper Apstra 5.1 introduces an external execd plugin for Telegraf, called the Apstra Streaming plugin. This plugin is maintained outside of Telegraf’s source code, simplifying telemetry data processing and ensuring compatibility, independent of Telegraf versions.

The plugin provides an effective way to consume telemetry data and integrates seamlessly into the following example telemetry stack, or other telemetry monitoring stacks.

This guide details how to use the plugin with the following example stack, consisting of:

  • A graphical interface based on Grafana (port 3000, username: admin, password: admin)

  • Prometheus for Counters and Alerts (port 9090, username: admin, password: admin)

  • Influxdb for Events (port 8086)

  • 2 Collectors, one for each database based on Telegraf.

Grafana

From a web browser, enter the URL http://<apstra-streaming>:3000 and enter username admin (default) and password admin (default).

The Grafana GUI includes two main sections (top left). Apstra AOS Blueprint describes overall telemetry alerts and traffic throughput. Apstra AOS Device visualizes individual devices for interface telemetry.


Blueprints are learned automatically using the Apstra ‘telegraf’ Docker container; no further configuration is necessary.


In the screenshot above, we can observe traffic in the demo Apstra environment, and aggregate CPU, traffic, and errors. To filter telemetry events based on specific and individual devices, change the dashboard at the top to Apstra AOS Device.


Scroll down to view device statistics such as CPU and Memory:


Prometheus

Prometheus is used for alerts and device telemetry counter storage in the Apstra-streaming appliance. From a web browser, enter the URL http://<apstra-streaming>:9090 to access the Prometheus GUI.

When incoming events appear, Apstra dynamically builds each of the queries. To see example query names, begin typing under ‘execute’. Starting with ‘alert’ it tab-completes available alerts that Prometheus has received from Apstra.


Here is an example of streaming status alerts for the apstra-streaming VM. 


InfluxDB

Per official documentation, the web admin UI of InfluxDB is deprecated as of InfluxDB 1.1. If you want to interact with InfluxDB, we recommend using the CLI. For information about CLI commands, see https://archive.docs.influxdata.com/influxdb/v1.2/tools/shell/.

The example outputs below show the process of accessing the InfluxDB container and running a query for BGP information.

First, we run an -execute command to access the InfluxDB container, then launch the influx shell.

After connecting to the InfluxDB container, run a command to view available databases. In the case of Apstra Streaming, we access the aos database.

View the available query sources.

In our example, we query alert_bgp_neighbor_mismatch.

Configure Apstra-Streaming

To configure Apstra telemetry streaming as part of this example stack, you'll edit variables.env, run the make start command, and restart the containers. No Apstra server configuration is required.

The Telegraf project connects to the Apstra API and posts an IP:Port that Apstra uses to stream realtime telemetry data back to.

  1. Copy variables.default to variables.env.
  2. Configure variables.env.
    • AOS_SERVER - the IP address of the Apstra VM that sends telemetry data to the apstra-streaming VM.

    • LOCAL_IP - the IP address assigned to ens33 (first ethernet interface). In this case, it is learned via DHCP on this VM. See ip addr show dev ens33.

    • Grafana configuration options to specify the username and password for the grafana web interface.

    • AOS_LOGIN, AOS_PASSWORD, AOS_PORT - You can customize username, port and password information.

  3. Run the command to bring up the containers.
    The following is an example docker-compose.yml for the Telegraf container.
    Note that the Telegraf configuration file - ./aos-telegraf.conf - is mapped to /etc/telegraf/apstra-telegraf-plugin.conf on the container.

Reconfigure Apstra Streaming after Apstra Server Upgrade

After you upgrade the Apstra server, you must reconfigure the apstra-streaming VM to ensure a proper streaming connection.

  1. If you upgraded and installed the Apstra server onto a different VM, (or if the server IP address is different for any reason), update the variables.env file with the new Apstra server IP address.
  2. Run the docker ps command to verify that the current Telegraf container image is Telegraf v1.31.3 or later.
  3. If required, modify the docker-compose.yml file and point to the correct Docker image.
  4. Run the command docker-compose up -d to restart the service.
  5. Run the docker ps command to verify that the container is running with the new image.

Build Apstra-Streaming VM (Optional)

You can build your own apstra-streaming VM, which is a Docker container. The following steps show you how to set up a basic Docker server.

Install Ubuntu 24.04.1

Download the Ubuntu 24.04.1 ISO and provision a new VM. The default username is admin and the password is admin.

For larger blueprints, we recommend changing RAM to at least 8GB and CPU to at least 2 vCPU. More disk space may also be required.

Resource

Quantity

Ram

8GB

CPU

2 vCPU

Network

1 vNIC

Install Packages

Install required packages, based on Ubuntu 24.04.1

Update the system to ensure all packages are up to date.

Add the Apstra user to the Docker group. This allows ‘apstra-streaming' to make Docker configuration changes without having to escalate to sudo.

Download the Apstra plugin from the Juniper Downloads site, under Apstra 5.1. Untar the Apstra streaming image files.

Create a softlink (apstra-telegraf-plugin) to the uncompressed image. This ensures that you can use the same apstra-telegraf-plugin image name across newer image versions. If there are any existing images in your directory, delete them and create a new softlink to refer to the newest image.

Set Container Restart Policy

The Apstra streaming package does not set the Docker restart policy; this is up to your orchestration toolchain. Open apstra-streaming/docker-compose.yml and add restart: always to each of the service directives. This ensures that Docker containers are online after a service reboot.

Follow the steps in the Configure Apstra Streaming section to set up variables.env and start the containers.

Change System Hostname

Modify /etc/hostname to apstra-streaming, and change the loopback IP in /etc/hosts to apstra-streaming from ubuntu.

Troubleshooting

You can run the following commands to monitor the health of your environment.

Check for Logs from Apstra to the Apstra-streaming VM

Check docker logs.

You should see a blueprint ID, and some influxdb "write" events when telemetry events occur on AOS - BGP, liveness, config deviation...etc.

Verify Containers are Running

Ensure that all expected containers are running.