Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Establish a Dial-out Telemetry Connection

This topic describes the procedure to establish a dial-out telemetry connection. Configure the gRPC service, streaming server profile, sensor profile, export profile, and data collector based on the sensor information you want to collect from the Junos device.

In dial-out mode, the Juniper device initiates a connection to an external telemetry collector and streams telemetry data. This method is preferred when centralized management of telemetry data is required, as the device pushes data to the collector without requiring the collector to initiate connections.

  • Ensure the Juniper device runs a compatible Junos OS version that supports JTI dial-out telemetry.

  • Set up a telemetry collector (for example, Juniper Telemetry Collector, Prometheus, or InfluxDB) compatible with the chosen transport protocol (for example, UDP, gRPC).

  • Ensure network connectivity between the Juniper device and the collector (for example, TCP port 50051 for gRPC or a custom port for UDP).

  • If using TLS with gRPC, prepare certificates for the device and collector.

  • Refer to the Junos YANG Data Model Explorer (introduced in Junos OS Release 23.2R2-S2) or Junos Telemetry Sensor Explorer (for releases 20.2R1 to 23.1R1) for supported sensors.

  • For legacy gRPC dial-out connections you can configure the IP address and routing instance, see Configure gRPC service for Legacy Dial-Out Connection.

To monitor a specific system resource, you configure a sensor. Each sensor configuration requires three main components:

  • Streaming server profile—Specifies the server for collecting data and related parameters, including the destination IP address and port number. Before you begin configure a connection from your Juniper Networks device to a server that is using in-band management interfaces.

  • Sensor profile—Enables the system resource to monitor and allows you to set related parameters, such as the destination server to send data.

  • Export profile—Specifies the attributes for the process of exporting collected data, such as the transport protocol to use and the interval at which to collect data.

Best Practice:

We recommend that you configure at least one export profile and at least one streaming server before you configure a sensor profile. This way you can associate an export profile and a streaming server with the sensor profile configuration.

To enable export of statistics, include the export-profile and sensor statements at the [edit services analytics] hierarchy level. The export profile must include the reporting rate, the transport service (for example, gRPC), and the format (for example, gbp-gnmi). The sensor configuration should include the name of the collector (the server’s name), the name of the export profile, and the resource path. An example of a resource path is /interfaces/interface[name='fxp0'.

Note:

When configuring an export profile for gNMI dial out, the export profile parameters, such as {'dscp', 'forwarding-class', 'payload-size'} are not applicable. Configuring any of these options generates an error.

Follow the procedures listed below to establish a dial-out telemetry connection:

Configure a Streaming Server Profile

A server profile defines the parameters of the server that collects exported telemetry data. You can define more than one server profile. You can also associate the same server profile with more than one sensor profile. Starting in Junos OS Release 15.1F6, you can associate more than one server with a specific sensor.

To define the profile of a streaming server to collect exported telemetry data:

  1. Specify the name of the streaming sever.

    For example, to specify a streaming-server name of telemetry server:

  2. Specify a destination IP address for the exported packets.

    For example, to specify a destination address of 192.0.2.2 for a streaming server with the name telemetry-server:

  3. Specify a destination port number for the exported packets.

    For example, to specify a destination port number of 30000 for a streaming server with the name telemetry-server:

Configure a Sensor Profile

A sensor profile defines the parameters of the system resource to monitor and stream data. You can enable only one system resource to monitor for each sensor profile. Configure a different sensor profile for each system resource you want to monitor. You can, however, configure more than one sensor to monitor the same system resource. For example, you might want to configure different parameters for exporting data for the same system resource.

To configure a sensor profile:

  1. Specify the name of the sensor.

    For example, to specify a sensor name of interface-1:

  2. Specify the system resource to monitor and stream data.

    For example, to enable monitoring of logical interfaces for sensor interface-1:

    Note:

    You must enter the resource string exactly.

  3. (Optional) Specify a regular expression to filter data for the system resource you specified in Step 2. If you do not specify a regular expression, the system resource is monitored globally, that is, systemwide.

    For example, to filter data only for Ethernet logical interfaces for sensor interface-1:

  4. Specify the name of a export profile configured at the [edit export-profile profile-name] hierarchy level to associate with the sensor profile. This export profile defines the parameters for exporting telemetry data.

    For example, to associate an export profile named export-params with a sensor named interface-1:

  5. Specify the name of a streaming server name configured at the [edit services analytics streaming-server server-name] hierarchy level to collect exported data.
    Note:

    Starting in Junos OS Release 15.1F6, you can specify more than one streaming server for a sensor profile. To specify more than one streaming server for a sensor, you must enclose the names in brackets.

    For example, to associate a streaming server name telemetry-server with a sensor named interface-1:

Configure an Export Profile

An export profile defines the parameters of the export process of data generated through the Junos telemetry interface. You must configure at least one export profile, but you can configure multiple export profiles. Each export profile can be associated with multiple sensor profiles. However, you can associate only one export profile with a specific sensor profile.

Platform-Specific Export Profile Behavior

Use Feature Explorer to confirm platform and release support for specific features.

Use the following table to review platform-specific behaviors for your platforms:

Table 1: Platform-Specific Export Profile Behavior

Platform

Difference

MX Series

Starting with Junos OS Release 17.3R1 on MX Series routers only, you can specify a packet loss priority for an export profile. As a result, you can apply the appropriate packet loss priority to each sensor. Loss priority settings help determine which packets are dropped from the network during periods of congestion. Previously, you could specify only the forwarding class and the DSCP value in an export profile. The following packet loss priority settings are supported: high, low, medium-high and medium-low. For more information about packet loss priority settings, see Mapping PLP to RED Drop Profiles.

To configure an export profile:

  1. Specify a name for the export profile.

    For example, to specify an export-profile name of export-params:

  2. Specify the source IP address of exported packets.

    For example, to specify a source IP address of 192.0.2.3 for an export profile with the name export-params:

  3. Specify the source port number of exported packets.

    For example, to specify a source port number of 21111 for an export profile with the name export-params:

  4. Specify the interval, in seconds, at which the sensor generates telemetry data.

    For example, to specify an interval of 20 seconds at which any sensor associated with the export-profile with the name export-params generates telemetry data :

  5. Specify the format to define the structure of the exported data.
    Note:

    The only currently supported format is Google protocol buffers (gpb).

    For example, to specify the Google protocol buffers format for exported data for an export-profile with the name export-params:

  6. Specify the transport protocol to carry the telemetry data in the IP packets.

    For example, to specify the UDP as the transport protocol for telemetry data for an export profile with the name export-params:

    Note: Configuring the transport protocol as udp and the exported data format as gpb-gnmi together is erroneous.
  7. (Optional) Specify the DiffServ code point (DSCP) value to assign to exported packets.
    Note:

    The default value is 0 (zero).

    Any interface-level DSCP rewrite rules you have configured override the DSCP value you specify for the export profile. You need to specify a DSCP value for the export profile only if you do not configure DSCP rewrite rules on the outgoing interface. For more information, see Configuring Rewrite Rules.

    For example, to specify a DSCP value of 20 for an export profile with the name export-params:

  8. (Optional) Specify a forwarding class to assign to exported packets.
    Note:

    You can specify a forwarding class only for packets exported by Packet Forwarding Engine sensors. The default value is best-effort.

    For example, to specify a forwarding class of assured-forwarding for an export-profile with the name export-params:

  9. (Optional) (MX Series routers only on Junos OS Release 17.3R1 or later) Specify a packet loss priority to assign to exported packets.

    For example, to specify a loss priority of high for an export profile with the name export-params:

Configure the Data Collector

  1. Ensure the collector is ready to receive data from the Juniper device:
    • IP Address: The device’s management IP (192.168.1.100).
    • Port: The configured port (for example, 2000 for UDP, 50051 for gRPC).
    • Protocol: Match the transport protocol (for example, UDP or gRPC).
    • Credentials: If TLS is enabled, configure the collector with the appropriate client certificate and key.
    • Data format: Ensure the collector supports Google Protocol Buffers (gpb) and has the necessary protobuf definitions to decode sensor data.

    Example collector configuration (for a UDP-based collector):

    Configure the collector to listen on 192.168.1.100:2000 and process gpb-encoded data.

  2. On the data collector, verify if the data is received. For example, if Prometheus or Grafana is used as a data collector, check the logs or visualizations. For custom collectors, verify the data stream matches the configured sensor paths.
  3. To decode Junos Telemetry Interface Data, see Decoding Junos Telemetry Interface Data With UNIX Utilities.

Verify the Junos Telemetry Interface Sensor Configuration

Purpose

Confirm your configuration.

Action

From configuration mode, confirm your configuration by entering the show services analytics command. If your output does not display the intended configuration, repeat the instructions in this configuration procedure to correct the configuration.

After you commit the configuration, verify that the sensor is enabled by issuing the show agent sensors operational command.

Note:

The show agent sensors command output for gRPC sensors is truncated on the Junos OS Evolved platform to align with the output format of the Junos OS platform.

Selecting Sensor Paths

Sensor Explorer and Guidelines for Selecting Sensor Paths

Use the Juniper Networks Junos YANG Data Model Explorer to view all the supported resource paths, their corresponding leaves, and the device platforms that support them.

Note: The Junos YANG Data Model Explorer was introduced in the 23.2R2-S2 releases. From releases 20.2R1 up to 23.1R1, the sensor information is available in the Junos Telemetry Sensor Explorer.

To search and view other telemetry sensors and specific information about some legacy sensors, see Legacy Sensor Paths.

For information on guidelines and best practices for configuring sensor paths, see Explore Sensor Paths.

Decoding Junos Telemetry Interface Data With UNIX Utilities

You can use UNIX utilities to decode Junos telemetry interface data on a server, or collector, that is streaming data from a Juniper Networks device. The example in this section shows you how to decode a single packet of streamed data.

Preparing the Collector to Decode Data

This example requires the following:

  • UNIX OS with the Netcat (nc) utility.

  • Protocol buffers compiler.

  • Junos telemetry interface protocol buffers files.

This procedure shows how to prepare the collector to decode data using the Ubuntu OS.

  1. Install the Netcat utility.

  2. Install the protocol buffers compiler.

  3. Install the protocol buffers developer’s library.

  4. Verify that the library files are installed.

  5. Download and install the latest version of the Junos Telemetry interface protocol buffers files.

    From a Web browser, navigate to the All Junos Platforms software download URL on the Juniper Networks page: https://www.juniper.net/support/downloads/. After you select the name of the Junos OS platform and the release number, go to the Tools section and download the Junos telemetry interface Data Model Files package.

    Note:

    Be sure to note the location of the extracted files.

Decoding Data on the Collector

This procedure shows you how to capture data, decode raw data, and use the protocol buffers files to decode data.

To decode data:

  1. Capture the data.

    Run netcat on a destination streaming telemetry server, or collector, in UDP listener mode to store all incoming datagrams into a file. Use the destination port number configured in streaming-server profile on your Juniper Networks device.

    Note:

    This command stores datagrams into a file named data.gpb. Run this program to capture data. When you want to stop receiving data, stop with the program by sending the break signal (Control + C)

  2. Decode raw data.

    Note:

    This step is optional. It is not required if you know the encoded message type of the data.

    Decode the message from the data.gpb file.

    The next nested structure under 2636 identifies the sensor type. The numerical value 2636 identifies the JuniperNetworksSensor message, which is defined in the telemetry_top.proto file. In this example, the numerical identifier 7 corresponds to the LogicalPort message defined in the logical_port.proto file. Use this information in the next step to generate more detailed output.

  3. Decode the message to include field names.

    Run the protocol buffers compiler with the decode option. Additionally, specify the top-level message type (TelemetryStream) and the file with the message definition, logical_port.proto. You must also include the Goggle protocol buffers (gpb) library.

Decoding Junos Telemetry Interface UDP Data at the Collector

The collector must start a listener on the remote address or port combination to read the incoming data. The incoming data can be decoded using the telemetry_top.proto and the sensor proto files.

To simplify the decoding procedure, the collectors can load all the proto files shipped as part of the Telemetry Software package to decode the incoming data.

Note:
  1. Verify streaming data on both management and WAN interfaces. Specify the appropriate address in the streaming server profile.
  2. Enums and float are streamed as strings for UDP streaming. Enums will be retained as strings as gNMI uses the same format.
  3. The handling of float data type is scoped for a future release.

When telemetry data is streamed over UDP, ensure that data is decoded correctly, and unknown fields are not decoded at the collector.

Below are some issues observed while streaming telemetry data over UDP:

  1. Incorrect Decoding: Incorrect decoding implies that telemetry data is not correctly streamed over UDP. In the following example, the data highlighted in bold indicates that the data was not decoded correctly. This behaviour is either due to incorrect encoding or wrong proto file packaging.

    Below is the example of the data being decoded correctly:

  2. Incomplete data streaming: Streaming of incomplete data must be verified through data validation in the output file.

Change History Table

Feature support is determined by the platform and release you are using. Use Feature Explorer to determine if a feature is supported on your platform.

Release
Description
17.3R1
Starting with Junos OS Release 17.3R1 on MX Series routers only, you can specify a packet loss priority for an export profile.