Establish a Dial-out Telemetry Connection
Use this 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 that the Juniper device runs a compatible Junos OS version that supports Junos 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 that the 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 configure the IP address and routing instance, see Configure gRPC service for Legacy Dial-Out Connection.
Configure a sensor to monitor a specific system resource. 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— Allows monitoring of the system resource and enables you to set related parameters, such as the destination server that is used to receive data.
-
Export profile— Specifies attributes for exporting collected data, such as the transport protocol to use and the interval to collect data.
We recommend you configure at least one export profile and at least one streaming server before you configure a sensor profile. You can then 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 must
include the collector's name, the export profile's name, and the resource path.
Resource path example: /interfaces/interface[name='fxp0'.
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.
Guidelines for Streaming Telemetry Data Over UDP:
- Telemetry data streams directly from the source application to the collector over UDP. The configuration depends on the type of connection to the collector. The collector must be reachable over the management interface or a WAN interface.
- In the case of line card sensors, the line cards can directly export the data to the collector if the remote address is reachable over the WAN interface. If the telemetry data must be exported over the management interface for line card sensors, route the data to the Routing Engine and then send it to the collector.
- Only the .gpb format is supported for transporting telemetry data
over UDP. Below is a sample configuration to stream telemetry data over
UDP for the sensor path
/junos/system/linecard/interface/. Data is exported every “10” seconds to the collector with a maximum payload size of “5000” to the remote address 143.1.1.2 with port number 3026:set services analytics streaming-server server_test remote-address 143.1.1.2 set services analytics streaming-server server_test remote-port 3026 set services analytics export-profile export_test local-port 0 set services analytics export-profile export_test reporting-rate 10 set services analytics export-profile export_test payload-size 5000 set services analytics export-profile export_test format gpb set services analytics export-profile export_test transport udp set services analytics sensor resource_test server-name server_test set services analytics sensor resource_test export-name export_test set services analytics sensor resource_test resource /junos/system/linecard/interface/
To define the profile of a streaming server to collect exported telemetry data:
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, consider configuring different parameters for exporting data from the same system resource.
To configure a sensor profile:
Configure an Export Profile
An export profile defines the parameters of the export process of data generated through the Junos Telemetry mechanism. You must configure at least one export profile, you can also 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:
|
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: |
To configure an export profile:
Configure the Data Collector
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 the configuration procedure
to correct it.
user@host# show services analytics
streaming-server telemetry-server {
remote-address 192.0.2.2;
remote-port 30000;
}
export-profile export-params {
local-address 192.0.2.3;
local-port 21111;
dscp 20;
forwarding-class assured-forwarding;
loss-priority high;
reporting-rate 20;
format gpb;
transport udp;
}
sensor interface-1 {
server-name telemetry-server;
export-name export-params;
resource /junos/system/linecard/interface/logical/usage/;
resource-filter et-*;
}
After you commit the configuration, verify that the sensor is enabled by issuing
the show agent sensors operational command.
user@host> show agent sensors
Sensor Information :
Name : interface-1
Resource : /junos/system/linecard/interface/logical/usage/
Version : 1.0
Sensor-id : 193570469
Resource-filter : et-*
Server Information :
Name : telemetry-server
Scope-id : 0
Remote-Address : 192.0.2.2
Remote-port : 30000
Profile Information :
Name : export-params
Rep-interval : 20
Address : 192.0.2.3
Port : 21111
Timestamp : 1
Format : GPB
Transport : UDP
DSCP : 20
Forwarding-class : assured-forwarding
Loss-priority : high
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.
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
- Decoding Data on the Collector
- Decoding Junos Telemetry Interface UDP Data at the Collector
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.
Install the Netcat utility.
sudo apt-get install netcat
Install the protocol buffers compiler.
sudo apt-get install protobuf-compiler
Install the protocol buffers developer’s library.
sudo apt-get install libprotobuf-dev
Verify that the library files are installed.
ls /usr/include/google/protobuf/descriptor.proto /usr/include/google/protobuf/descriptor.proto
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.
tar –xvzf junos-telemetry-interface-15.1F6.9.tgz junos-telemetry-interface/telemetry_top.proto junos-telemetry-interface/logical_port.proto junos-telemetry-interface/lsp_mon.proto junos-telemetry-interface/firewall.proto junos-telemetry-interface/lsp_stats.proto junos-telemetry-interface/port.proto junos-telemetry-interface/NOTICE junos-telemetry-interface/license.txt
Note:Ensure that you make a note of 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:
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.
nc -ul 0.0.0.0 20000 > data.gpb
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)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.gpbfile.protoc --decode_raw < ../data.gpb 1: "hillrock:160.1.1.25" 2: 0 4: "S1:/junos/system/linecard/interface/logical/usage/:/junos/system/linecard/interface/logical/usage/:PFE" 5: 65265 6: 1477686534474 7: 1 8: 1 101 { 2636 { 7 { 1 { 1: "et-0/0/4:2.32767" 2: 1477642750 3: 813 4 { 12: 0x37363732332e3165 } . . .The next nested structure under
2636identifies the sensor type. The numerical value2636identifies theJuniperNetworksSensormessage, which is defined in thetelemetry_top.protofile. In this example, the numerical identifier7corresponds to theLogicalPortmessage defined in thelogical_port.protofile. Use this information in the next step to generate more detailed output.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.protoc --decode TelemetryStream logical_port.proto -I /usr/include -I . < data.gpb system_id: "hillrock:160.1.1.25" component_id: 0 sensor_name: "S1:/junos/system/linecard/interface/logical/usage/:/junos/system/linecard/interface/logical/usage/:PFE" sequence_number: 65268 timestamp: 1477686536484 version_major: 1 version_minor: 1 enterprise { [juniperNetworks] { [jnprLogicalInterfaceExt] { interface_info { if_name: "et-0/0/4:2.32767" init_time: 1477642750 snmp_if_index: 813 parent_ae_name: "ae1.32767" ingress_stats { if_packets: 0 if_octets: 0 } egress_stats { if_packets: 0 if_octets: 0 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/7:3.0" init_time: 1477642750 snmp_if_index: 520 parent_ae_name: "ae0.0" ingress_stats { if_packets: 61203309 if_octets: 6487548454 } egress_stats { if_packets: 87416547 if_octets: 9266153982 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/13:0.0" init_time: 1477642750 snmp_if_index: 2512 ingress_stats { if_packets: 26266247 if_octets: 2784214806 } egress_stats { if_packets: 26247215 if_octets: 2781829290 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/13:0.1" init_time: 1477642750 snmp_if_index: 2522 ingress_stats { if_packets: 26266249 if_octets: 2784214972 } egress_stats { if_packets: 26249115 if_octets: 2781935590 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/13:0.2" init_time: 1477642750 snmp_if_index: 2523 ingress_stats { if_packets: 26266248 if_octets: 2784214912 } egress_stats { if_packets: 26249106 if_octets: 2781935086 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/13:0.3" init_time: 1477642750 snmp_if_index: 2524 ingress_stats { if_packets: 26266248 if_octets: 2784214820 } egress_stats { if_packets: 26248520 if_octets: 2781902320 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/13:0.4" init_time: 1477642750 snmp_if_index: 2525 ingress_stats { if_packets: 26266247 if_octets: 2784214760 } egress_stats { if_packets: 26247302 if_octets: 2781834112 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/13:0.5" init_time: 1477642750 snmp_if_index: 2526 ingress_stats { if_packets: 26266247 if_octets: 2784214760 } egress_stats { if_packets: 26247209 if_octets: 2781828904 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/13:0.6" init_time: 1477642750 snmp_if_index: 2527 ingress_stats { if_packets: 26266248 if_octets: 2784214820 } egress_stats { if_packets: 26247196 if_octets: 2781828226 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/13:0.7" init_time: 1477642750 snmp_if_index: 2528 ingress_stats { if_packets: 26266247 if_octets: 2784214760 } egress_stats { if_packets: 26247203 if_octets: 2781828618 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/13:0.8" init_time: 1477642750 snmp_if_index: 2529 ingress_stats { if_packets: 26266247 if_octets: 2784214760 } egress_stats { if_packets: 26247225 if_octets: 2781829850 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/13:0.9" init_time: 1477642750 snmp_if_index: 2530 ingress_stats { if_packets: 26266247 if_octets: 2784214760 } egress_stats { if_packets: 26247209 if_octets: 2781828954 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/13:0.32767" init_time: 1477642750 snmp_if_index: 648 ingress_stats { if_packets: 4 if_octets: 240 } egress_stats { if_packets: 0 if_octets: 0 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/4:2.32767" init_time: 1477642750 snmp_if_index: 813 parent_ae_name: "ae1.32767" ingress_stats { if_packets: 0 if_octets: 0 } egress_stats { if_packets: 0 if_octets: 0 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/7:3.0" init_time: 1477642750 snmp_if_index: 520 parent_ae_name: "ae0.0" ingress_stats { if_packets: 61206122 if_octets: 6487846632 } egress_stats { if_packets: 87420567 if_octets: 9266580102 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/13:0.0" init_time: 1477642750 snmp_if_index: 2512 ingress_stats { if_packets: 26267458 if_octets: 2784343172 } egress_stats { if_packets: 26248420 if_octets: 2781957020 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/13:0.1" init_time: 1477642750 snmp_if_index: 2522 ingress_stats { if_packets: 26267460 if_octets: 2784343338 } egress_stats { if_packets: 26250320 if_octets: 2782063320 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/13:0.2" init_time: 1477642750 snmp_if_index: 2523 ingress_stats { if_packets: 26267459 if_octets: 2784343278 } egress_stats { if_packets: 26250311 if_octets: 2782062816 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/13:0.3" init_time: 1477642750 snmp_if_index: 2524 ingress_stats { if_packets: 26267460 if_octets: 2784343292 } egress_stats { if_packets: 26249725 if_octets: 2782030050 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/13:0.4" init_time: 1477642750 snmp_if_index: 2525 ingress_stats { if_packets: 26267459 if_octets: 2784343232 } egress_stats { if_packets: 26248507 if_octets: 2781961842 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/13:0.5" init_time: 1477642750 snmp_if_index: 2526 ingress_stats { if_packets: 26267459 if_octets: 2784343232 } egress_stats { if_packets: 26248414 if_octets: 2781956634 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/13:0.6" init_time: 1477642750 snmp_if_index: 2527 ingress_stats { if_packets: 26267460 if_octets: 2784343292 } egress_stats { if_packets: 26248401 if_octets: 2781955956 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/13:0.7" init_time: 1477642750 snmp_if_index: 2528 ingress_stats { if_packets: 26267459 if_octets: 2784343232 } egress_stats { if_packets: 26248408 if_octets: 2781956348 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/13:0.8" init_time: 1477642750 snmp_if_index: 2529 ingress_stats { if_packets: 26267459 if_octets: 2784343232 } egress_stats { if_packets: 26248430 if_octets: 2781957580 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/13:0.9" init_time: 1477642750 snmp_if_index: 2530 ingress_stats { if_packets: 26267459 if_octets: 2784343232 } egress_stats { if_packets: 26248414 if_octets: 2781956684 } op_state { operational_status: "up" } } interface_info { if_name: "et-0/0/13:0.32767" init_time: 1477642750 snmp_if_index: 648 ingress_stats { if_packets: 4 if_octets: 240 } egress_stats { if_packets: 0 if_octets: 0 } op_state { operational_status: "up" } } } } }
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.
- Verify streaming data on both management and WAN interfaces. Specify the appropriate address in the streaming server profile.
- Enums and float are streamed as strings for UDP streaming. Enums will be retained as strings as gNMI uses the same format.
- 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.
Some of the issues observed while streaming telemetry data over UDP are as follows:
- 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.
system_id: "r02.dtw01.icn" component_id: 65535 sensor_name: "mpls:/network-instances/network-instance/mpls:/network-instances/network-instance/mpls:rpd" sequence_number: 2421 timestamp: 1715024560793 version_major: 1 version_minor: 0 enterprise: { [juniperNetworks]: { [jnpr_network_instances_rsvp_ext]: { network_instance: { name: "master" mpls: { 153 { 151 { 152{ 151{ 51: "r02.dtw01.icn-r01.bos02.icn-01" 152{ 151{ 51: "AUTO" 52: 0 53: 12873154 } 152{ 151{ 51:1 52:200000 53: 0 54: 300 55: 1 61: 1549061 } 152 {The example of correctly decoded data is as follows:
system_id: "r0-RE0" component_id: 65535 sub_component_id: 0 sensor_name: "test_chassisd:/network-instances/:/network-instances/:rpd" sequence_number: 0 timestamp: 1719126223900 version_major: 1 version_minor: 0 enterprise { [juniperNetworks] { [jnpr_network_instances_ni_226_ext] { network_instance { name: "DEFAULT" protocols { protocol { identifier: "STATIC" name: "DEFAULT" static_routes { static { prefix: "10.0.0.0/8" state { prefix: "10.0.0.0/8" set_tag: "0" } next_hops { next_hop { index: "1" state { index: "1" next_hop: "10.220.127.254" metric: 0 recurse: false } interface_ref { state { interface: "re0:mgmt-0" subinterface: 0 } } } } } - Incomplete data streaming: Streaming of incomplete data must be verified through data validation in the output file.
See Also
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.