Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Announcement: Try the Ask AI chatbot for answers to your technical questions about Juniper products and solutions.

close
header-navigation
keyboard_arrow_up
close
keyboard_arrow_left
Juniper Apstra 5.1.0 User Guide
Table of Contents Expand all
list Table of Contents
file_download PDF
{ "lLangCode": "en", "lName": "English", "lCountryCode": "us", "transcode": "en_US" }
English
keyboard_arrow_right

Apstra Telemetry Streaming Plugin for Telegraf

date_range 21-Mar-25

In Juniper Apstra release 5.1, the Apstra streaming input plugin is maintained and supported as an external plugin, outside of Telegraf's source code. This doc provides information about the plugin, and how to enable it in Telegraf.

Introduction

Juniper Apstra 5.1 introduces an Apstra telemetry streaming input plugin for Telegraf. Supported and maintained as an external input plugin for Telegraf, the Apstra streaming plugin runs through Telegraf’s execd plugin. Previously, the Apstra plugin’s source code was compiled within Telegraf, making it dependent on custom Telegraf forks for each Telegraf release.

In order to address version compatibility issues and improve the user experience, Juniper Apstra 5.1 has transitioned to an external plugin model for Apstra telemetry streaming. The plugin is a statically linked executable binary file. Building the plugin as an external plugin model means that it is deployed and updated independently of Telegraf’s updates, enabling users to integrate the Apstra streaming plugin into most current monitoring stacks without compatibility issues. Additionally, Telegraf provides detailed documentation for external plugins, with configuration and deployment information.

Apstra Streaming Input Plugin Overview

As stated in Telegraf’s official execd documentation, the input plugin is part of Telegraf’s extensible architecture, which lets Telegraf execute external scripts for data collection as long-running processes. In the case of Asptra’s streaming input plugin, execd lets Telegraf interface with the binary to run Apstra’s telemetry streaming scripts.

The Apstra plugin streams the following data types:

  • perfmon (performance data)

  • alerts

  • events

The available execd configuration options and their descriptions are available in the official documentation.

Apstra Plugin Metrics

Telegraf Metrics in the Apstra Plugin

The following sections list the various Telegraf metrics that the Apstra plugin streams. Telegraf uses these metrics to model data during processin. These metrics contain four main components:

  • Measurement name: Description and namespace for the metric.

  • Tags: Key/Value string pairs, used to identify the metric.

  • Fields: Key/Value pairs that are typed and usually contain the metric data.

  • Timestamp: Date and time associated with the fields.

For output to InfluxDB, Telegraf converts metrics to InfluxDB line protocol. For more information, see Telegraf's official documentation at https://docs.influxdata.com/telegraf/v1/metrics/.

Consider the following example:


When applied to an Apstra Telegraf plugin metric like alert_streaming for example, the line protocol output might look something like the following:

content_copy zoom_out_map
alert_bgp_neighbor_mismatch,addr_family=IPV4,blueprint=rack-based-blueprint-bae3967a,blueprint_id=rack-based-
blueprint-bae3967a,device=spine2,device_key=505400F516DC,device_name=spine2,lcl_asn=5,lcl_hostname=spine2,lcl_ipaddr=172.10.0.6,
rmt_asn=1,rmt_ipaddr=172.10.0.7,rmt_name=racktype-1-001-leaf1,role=spine_leaf,severity=ALERT_CRITICAL,
vrf_name=default status=1i,sequence_number=8i expected_state="BGP_SESSION_UP",actual_state="BGP_SESSION_DOWN" 1738596731833786640

Measurement: alert_bgp_neighbor_mismatch

Tags: addr_family, blueprint, device...etc

Fields: expected_state, actual_state, status, sequence_number

Timestamp: 1738596731833786640

Note: Some metrics, such as certain Events metrics, don't stream any field metric data.

Perfmon Metrics

Perfmon metrics values are shows as:

  • int: integer, or whole number

  • float: floating number, or number with decimal places

  • string: letters or numbers

interface_counters (interface counters info per interface per second)

tags

blueprint (blueprint label)

blueprint_id (blueprint id)

device (device name)

device_key (device id)

device_name (device label)

host (apstra server hostname)

interface (interface name)

role (device role)

fields
tx_unicast_packets (int, packets per second)
tx_unicast_pps (int, packets per second)
tx_broadcast_packets (int, packets per second)
tx_broadcast_pps (int, packets per second)
tx_multicast_packets (int, packets per second)
tx_multicast_pps (int, packets per second)
tx_bytes (int, bytes per second)
tx_bps (int, bits per second)
rx_unicast_packets (int, packets per second)
rx_unicast_pps (int, packets per second)
rx_broadcast_packets (int, packets per second)
rx_broadcast_pps (int, packets per second)
rx_multicast_packets (int, packets per second)
rx_multicast_pps (int, packets per second)
rx_bytes (int, bytes per second)
rx_bps (int, bits per second)
tx_error_packets (int, packets per second)
tx_error_pps (int, packets per second)
tx_discard_packets (int, packets per second)
tx_discard_pps (int, packets per second)
rx_error_packets (int, packets per second)
rx_error_pps (int, packets per second)
rx_discard_packets (int, packets per second)
rx_discard_pps (int, packets per second)
alignment_errors (int, per second)
fcs_errors (int, per second)
symbol_errors (int, per second)
runts (int, per second)
giants (int, per second)
delta_seconds (int, delta time in seconds between the current and previous interface counters measurement)
delta_microseconds (int, delta time in microseconds between the current and previous interface counters measurement)

system_info (system resource usage info)

tags

blueprint (blueprint label)

blueprint_id (blueprint id)

device (device name)

device_key (device id)

device_name (device label)

host (apstra server hostname)

role (device role)

fields

cpu_idle (float, percentage)

cpu_system (float, percentage)

cpu_user (float, percentage)

memory_total (int, bytes)

memory_used (int, bytes)

process_info (process resource usage info per device)

tags

blueprint (blueprint label)

blueprint_id (blueprint id)

device (device name)

device_key (device id)

device_name (device label)

host (apstra server hostname)

process_name (process name)

role (device role)

fields

cpu_system (float, percentage)

cpu_user (float, percentage)

memory_used (int, bytes)

file_info (file info per device)

tags

blueprint (blueprint label)

blueprint_id (blueprint id)

device (device name)

device_key (device id)

device_name (device label)

file_name (file name)

host (apstra server hostname)

role (device role)

fields

file_size (int, bytes)

probe_message (probe message data)

tags

blueprint (blueprint label)

blueprint_id (blueprint id)

device (device name)

device_key (device id)

device_name (device label)

host (apstra server hostname)

probe_id (string, probe id)

probe_label (string, probe label)

role (device role)

stage_name (string, probe stage name)

fields

blueprint_id (string, blueprint id)

item_id (string, probe message item id)

property.* (string, probe property key-value pairs, where * is a property name)

value (string, int or float, probe message value)

Alerts

Alert metrics include a value of 0 or 1 in the status field:

  • 1: Indicates that the alert is active

  • 0: Indicates that the alert is resolved or not raised

alert_arp (Address Resolution Protocol alert)

tags

blueprint (blueprint label)

blueprint_id (blueprint id)

device (device name)

device_key (device id)

device_name (device label)

host (apstra server hostname)

role (device role)

ip_address (IP address)

mac (MAC address)

intfname (interface name)

alert_bgp_neighbor_mismatch (BGP neighbor mismatch alert)

tags

blueprint (blueprint label)

blueprint_id (blueprint id)

device (device name)

device_key (device id)

device_name (device label)

host (apstra server hostname)

role (device role)

lcl_hostname (local hostname)

lcl_ipaddr (local IP address)

lcl_asn (local ASN)

rmt_ipaddr (remote IP address)

rmt_name (remote name)

vrf_name (VRF name)

addr_family (address family)

fields

expected_state (string, expected state)

actual_state (string, actual state)

status

sequence_number

alert_blueprint_rendering (blueprint rendering alert)

tags

blueprint (blueprint label)

blueprint_id (blueprint id)

device (device name)

device_key (device id)

device_name (device label)

host (apstra server hostname)

role (device role)

fields

failed_systems (str, comma-separated list of failed systems)

alert_cable_peer_mismatch (cable peer mismatch alert)

tags

blueprint (blueprint label)

blueprint_id (blueprint id)

device (device name)

device_key (device id)

device_name (device label)

host (apstra server hostname)

role (device role)

lcl_hostname (local hostname)

lcl_ifname (local interface name)

fields

exp_hostname (string, expected hostname)

exp_ifname (string, expected interface name)

rmt_hostname (string, remote hostname)

rmt_ifname (string, remote interface name)

rmt_sysdescr (string, remote system description)

alert_config_deviation (config deviation alert)

tags

blueprint (blueprint label)

blueprint_id (blueprint id)

device (device name)

device_key (device id)

device_name (device label)

host (apstra server hostname)

role (device role)

alert_deployment (deployment alert)

tags

blueprint (blueprint label)

blueprint_id (blueprint id)

device (device name)

device_key (device id)

device_name (device label)

host (apstra server hostname)

role (device role)

fields

expected_deployment_state (string, expected deployment state)

actual_deployment_state (string, actual deployment state)

alert_extensible (extensible alert)

tags

blueprint (blueprint label)

blueprint_id (blueprint id)

device (device name)

device_key (device id)

device_name (device label)

host (apstra server hostname)

role (device role)

fields

key (string, alert key)

expected (string, expected value)

actual (string, actual value)

alert_hostname (hostname alert)

tags

blueprint (blueprint label)

blueprint_id (blueprint id)

device (device name)

device_key (device id)

device_name (device label)

host (apstra server hostname)

role (device role)

fields

expected_hostname (string, expected hostname)

actual_hostname (string, actual hostname)

alert_interface_link_status_mismatch (interface link status mismatch alert)

tags

blueprint (blueprint label)

blueprint_id (blueprint id)

device (device name)

device_key (device id)

device_name (device label)

host (apstra server hostname)

role (device role)

hostname (hostname)

ifname (interface name)

fields

expected_ifstatus (string, expected interface status)

actual_ifstatus (string, actual interface status)

alert_lag (LAG alert)

tags

blueprint (blueprint label)

blueprint_id (blueprint id)

device (device name)

device_key (device id)

device_name (device label)

host (apstra server hostname)

role (device role)

hostname (hostname)

lagname (LAG name)

fields

expected_ifup_count (int, expected interface up count)

actual_ifup_count (int, actual interface up count)

expected_interfaces_up (string, expected list of comma-separated interfaces that are up)

actual_interfaces_up (string, actual list of comma-separated interfaces that are up

alert_liveness (liveness alert)

tags

blueprint (blueprint label)

blueprint_id (blueprint id)

device (device name)

device_key (device id)

device_name (device label)

host (apstra server hostname)

role (device role)

fields

expected_agents (string, list of comma-separated expected agents)

actual_agents (string, list of comma-separated actual agents)

alive (int, alive status)

alert_mac (MAC alert)

tags

blueprint (blueprint label)

blueprint_id (blueprint id)

device (device name)

device_key (device id)

device_name (device label)

host (apstra server hostname)

role (device role)

macaddress (MAC address)

fields

intfname (string, interface name)

vlan (int, VLAN ID)

movecount (int, move count)

actual_move_interval (int, actual move interval)

expected_max_interval (int, expected max interval)

alert_mlag (MLAG alert)

tags

blueprint (blueprint label)

blueprint_id (blueprint id)

device (device name)

device_key (device id)

device_name (device label)

host (apstra server hostname)

role (device role)

hostname (hostname)

domain_id (domain id)

mlag_id (mlag id)

ifname (interface name)

peer_link (peer link)

fields

expected_domain_state (string, expected domain state)

actual_domain_state (string, actual domain state)

expected_intf_state (string, expected interface state)

actual_intf_state (string, actual interface state)

peer_link_status (string, peer link status)

expected_peer_link_status (string, expected peer link status)

alert_probe (probe alert

tags

blueprint (blueprint label)

blueprint_id (blueprint id)

device (device name)

device_key (device id)

device_name (device label)

host (apstra server hostname)

role (device role)

probe_id (probe id)

stage_name (probe stage name)

properties.* (probe property key-value pairs, where * is a property name)

item_id (probe message item id)

probe_label (probe label)

predefined_probe_name (predefined probe name, if predefined)

fields

expected_int (int, expected value if the output is an integer)

actual_int (int, actual value if the output is an integer)

expected_int_max (int, expected maximum value if the output is an integer)

expected_float (float, expected value if the output is a float)

actual_float (float, actual value if the output is a float)

expected_float_max (float, expected maximum value if the output is a float)

expected_discrete_state (int, expected discrete state if the output is a discrete state)

actual_discrete_state (int, actual discrete state if the output is a discrete state)

expected_text (string, expected text if the output is a text)

actual_text (string, actual text if the output is a text)

alert_route (route alert)

tags

blueprint (blueprint label)

blueprint_id (blueprint id)

device (device name)

device_key (device id)

device_name (device label)

host (apstra server hostname)

role (device role)

ip (IP address)

fields

expected_dest_status (string, expected destination status)

actual_dest_status (string, actual destination status)

alert_streaming (streaming alert)

tags

blueprint (blueprint label)

blueprint_id (blueprint id)

device (device name)

device_key (device id)

device_name (device label)

host (apstra server hostname)

role (device role)

aos_server (Apstra server address)

streaming_type (type of streamed messages)

protocol (protocol)

sequecing_mode (sequencing mode)

fields

reason (string, reason why streaming is not working)

Events

event_arp_state (Address Resolution Protocol state alert)

tags

blueprint (blueprint label)

blueprint_id (blueprint id)

device (device name)

device_key (device id)

device_name (device label)

host (apstra server hostname)

role (device role)

ipaddress (IP address)

mac (MAC address)

intfname (interface name)

vrfname (VRF name)

fields

state (string, ARP state)

event_bgp_neighbor (BGP neighbor events)

tags

blueprint (blueprint label)

blueprint_id (blueprint id)

device (device name)

device_key (device id)

device_name (device label)

host (apstra server hostname)

role (device role)

lcl_hostname (local hostname)

lcl_ipaddr (local IP address)

lcl_asn (local ASN)

rmt_ipaddr (remote IP address)

rmt_asn (remote ASN)

vrf_name (VRF name)

addr_family (address family)

fields

state (string, BGP neighbor state)

event_cable_peer (cable peer events)

tags

blueprint (blueprint label)

blueprint_id (blueprint id)

device (device name)

device_key (device id)

device_name (device label)

host (apstra server hostname)

role (device role)

lcl_device_id (local device id)

lcl_hostname (local hostname)

lcl_ifname (local interface name)

rmt_hostname (remote hostname)

rmt_ifname (remote interface name)

rmt_sysdescr (remote system description)

event_device_state (device state events)

tags

blueprint (blueprint label)

blueprint_id (blueprint id)

device (device name)

device_key (device id)

device_label (device label)

host (apstra server hostname)

role (device role)

fields

state (string, device state)

event_extensible_event

tags

blueprint (blueprint label)

blueprint_id (blueprint id)

device (device name)

device_key (device id)

device_label (device label)

host (apstra server hostname)

role (device role)

fields

key (string, event key)

value (string, event value)

event_lag_state (Link Aggregation state events)

tags

blueprint (blueprint label)

blueprint_id (blueprint id)

device (device name)

device_key (device id)

device_label (device label)

host (apstra server hostname)

role (device role)

hostname (hostname)

lagname (LAG name)

fields

interfacesupcount (int, interface up count)

interfacesup (string, list of comma-separated interfaces that are up)

event_link_status

tags

blueprint (blueprint label)

blueprint_id (blueprint id)

device (device name)

device_key (device id)

device_label (device label)

host (apstra server hostname)

role (device role)

hostname (hostname)

ifname (interface name)

fields

state (string, link state)

event_mac_state

tags

blueprint (blueprint label)

blueprint_id (blueprint id)

device (device name)

device_key (device id)

device_label (device label)

host (apstra server hostname)

role (device role)

macaddress (MAC address)

intfname (interface name)

vlan (int, VLAN ID)

fields

state (string, MAC state)

event_mlag_state

tags

blueprint (blueprint label)

blueprint_id (blueprint id)

device (device name)

device_key (device id)

device_label (device label)

host (apstra server hostname)

role (device role)

domain_id (domain id)

fields

domain_state (string, domain state)

event_route_state

tags

blueprint (blueprint label)

blueprint_id (blueprint id)

device (device name)

device_key (device id)

device_label (device label)

host (apstra server hostname)

role (device role)

dest_network (destination network)

hostname (hostname)

fields

status (string, route status)

event_streaming

tags

blueprint (blueprint label)

blueprint_id (blueprint id)

device (device name)

device_key (device id)

device_label (device labe

host (apstra server hostname)

role (device role)

aos_server (Apstra server address)

streaming_type (type of streamed messages)

protocol (protocol)

sequencing_mode (sequencing mode)

fields

status (string, streaming status)

Backwards Incompatible Changes

The Apstra Telegraf plugin for Juniper Apstra 5.1 is not backwards compatible with the previous (deprecated) version. The following data measurements are not supported in this (5.1) version.

Removed:

  • event_traffic

  • alert_counters

  • alert_headroom

  • alert_config_mismatch_alert

  • generic

The following new fields and tags are supported:

  • For all streamed messages, except alert_streaming and event_streaming, the blueprint_id tag was added.

  • For alert_probe measurement, the predefined_probe_name tag was added.

  • For interface_counters measurement, the delta_microseconds field was added.

The following changes were made to existing fields and tags:

  • Previously, for all event and alert measurements, all data fields streamed as fields. Starting with the Apstra 5.1.0 plugin, the subset of fields is moved to tags. For detailed information, see the Apstra Plugin Metrics section.

  • Previously, the Apstra Telegraf plugin divided interface_counters measurement values into delta_seconds field that caused incorrect values. The following list of fields returns the correct per second values.

    • tx_bps

    • tx_unicast_pps

    • tx_broadcast_pps

    • tx_multicast_pps

    • tx_error_pps

    • tx_discard_pps

    • rx_bps

    • rx_unicast_pps

    • rx_broadscase_pps

    • rx_multicast_pps

    • rx_error_pps

    • rx_discard_pps

  • The following streamed sets of tags and fields was changed for the probe_message messages:

    • The probe_id, probe_label, and stage_name fields are streamed as tags.

    • The format of the property field was changed. This field is divided into multiple fields in the property.<key> format, where the <key> is property key name and the value of the field is the property value.

    • The value field returns the correct data type depending on the processor output. The value field is also divided into multiple fields for the following processor outputs, according to the mapping.

      For the Active Floodlist processor, the following fields are streamed:

      • value.state

      • value.system_id

      • value.vni

      • value.vtep

    For EVPN Type 3 processor, the following fields are streamed:

    • value.state

    • value.vni

    • value.nexthop

    • value.rd

    • value.rt

    For EVPN Type 5 processor, the following fields are streamed:

    • value.state

    • value.system_id

    • value.af

    • value.subnet

    • value.nexthop

    • value.rd

    • value.rt

    For Interface Utilization processor the following fields are streamed:

    • value.tx_utilization

    • value.rx_utilization

    • value.tx_unicast_pps

    • value.tx_broadcast_pps

    • value.tx_multicast_pps

    • value.tx_bps

    • value.tx_error_pps

    • value.tx_discard_pps

    • value.rx_unicast_pps

    • value.rx_broadcast_pps

    • value.rx_multicast_pps

    • value.rx_bps

    • value.rx_error_pps

    • value.rx_discard_pps

    • value.alignment_errors_per_second

    • value.fcs_errors_per_second

    • value.symbol_errors_per_second

    • value.runts_per_second

    • value.giants_per_second

    For System Interface Utilization processor, the following fields are streamed:

    • value.aggregate_tx_bps

    • value.aggregate_rx_bps

    • value.max_ifc_tx_utilization

    • value.max_ifc_rx_utilization

    • value.aggregate_tx_utilization

    • value.aggregate_rx_utilization

Enable the Apstra Streaming Plugin in Telegraf

Before you proceed, you must have a Telegraf installation. Note that this plugin is compatible with Telegraf v1.31.3 or later. For information about how to use the Apstra streaming plugin in an example telemetry stack, see Apstra Streaming Guide.
To enable the Apstra streaming input plugin in Telegraf:
  1. Download the Apstra plugin binary file (apstra-telegraf-plugin-5.1.0-26.gz) on the Juniper Downloads page, under Juniper Apstra 5.1.
  2. Untar the file.
    content_copy zoom_out_map
    tar -xzf apstra-streaming.tar.gz
  3. In Telegraf, create a plugin .conf file.
    The file below (inputs.aos) is an example of recommended Telegraf input settings.
    content_copy zoom_out_map
    [[inputs.aos]]
      # TCP Port to listen for incoming sessions from the Apstra Server.
      port = 7777
    
      # Address of the server running Telegraf. It must to be reachable from the Apstra Server.
      address = "<telegraf-server-ip>"
    
      # Streaming Type Can be "perfmon", "alerts" or "events".
      streaming_type = [ "perfmon", "alerts" ]
    
      # Define parameters to configure the Apstra Server using the REST API.
      # These paramters are not required when the receiver is configured from the Apstra GUI.
      aos_server = "<apstra-server-ip>"
      aos_port = 443
      aos_login = "admin"
      aos_password = "admin"
      aos_protocol = "https"
  4. Run the input plugin.
    Note that the path to the plugin and path to the plugin config are examples. Your filepaths might be different.
    content_copy zoom_out_map
    [[inputs.execd]]
      command = ["/apstra-telegraf-plugin", "-config", "/etc/telegraf/apstra-telegraf-plugin.conf"]
The Apstra streaming plugin is active. For information about how to use this plugin in an example monitoring stack, see the Apstra Streaming Guide.
footer-navigation