Telemetry Policy File
A telemetry policy file is defined by the user to specify the kind of telemetry data that is generated and pushed to the receiver. The policy must be stored in a text file with a .policy extension. Multiple policy files can be defined and installed in the /telemetry/policies/ folder in the router file system.
-
Contains one or more collection groups; a collection group includes different types of data to be streamed at different intervals
-
Includes a period in seconds for each group
-
Contains one or more paths for each group
-
Includes metadata that contains version, description, and other details about the policy
Policy file syntax
{
"Name": "NameOfPolicy",
"Metadata": {
"Version": 25,
"Description": "This is a sample policy to demonstrate the syntax",
"Comment": "This is the first draft",
"Identifier": "<data that may be sent by the encoder to the mgmt stn"
},
"CollectionGroups": {
"FirstGroup": {
"Period": 10,
"Paths": [
"RootOper.MemorySummary.Node",
"RootOper.RIB.VRF",
"..."
]
},
"SecondGroup": {
"Period": 300,
"Paths": [
"RootOper.Interfaces.Interface"
]
}
}
}
-
Name the name of the policy. In the previous example, the policy is stored in a file named
NameOfPolicy.policy
. The name of the policy must match the filename (without the .policy extension). It can contain uppercase alphabets, lower-case alphabets, and numbers. The policy name is case sensitive. -
Metadata information about the policy. The metadata can include the version number, date, description, author, copyright information, and other details that identify the policy. The following fields have significance in identifying the policy: -
Description is displayed in the show policies command.
-
Version and Identifier are sent to the receiver as part of the message header of the telemetry messages.
-
-
CollectionGroups an encoder object that maps the group names to information about them. The name of the collection group can contain uppercase alphabets, lowercase alphabets, and numbers. The group name is case sensitive.
-
Period the cadence for each collection group. The period specifies the frequency in seconds at which data is queried and sent to the receiver. The value must be within the range of 5 and 86400 seconds.
-
Paths one or more schema paths, allowed list entries or native YANG paths (for a container) for the data to be streamed and sent to the receiver. For example,
Schema path: RootOper.InfraStatistics.Interface(*).Latest.GenericCounters
YANG path: /Cisco-IOS-XR-infra-statsd-oper:infra-statistics/interfaces/interface=*/latest/generic-counters
Allowed list entry: "RootOper.Interfaces.Interface(*)": { "IncludeFields": ["State"] }
Schema Paths
A schema path is used to specify where the telemetry data is collected. A few paths are listed in the following table for your reference:
Operation |
Path |
---|---|
Interface Operational data |
RootOper.Interfaces.Interface(*) |
Packet/byte counters |
RootOper.InfraStatistics.Interface(*).Latest.GenericCounters |
Packet/byte rates |
RootOper.InfraStatistics.Interface(*).Latest.DataRate |
IPv4 packet/byte counters |
RootOper.InfraStatistics.Interface(*).Latest.Protocol(['IPV4_UNICAST']) |
MPLS stats |
|
QOS Stats |
|
BGP Data |
RootOper.BGP.Instance({'InstanceName': 'default'}).InstanceActive.DefaultVRF.Neighbor([*]) |
Inventory data |
RootOper.PlatformInventory.Rack(*).Attributes.BasicInfo RootOper.PlatformInventory.Rack(*).Slot(*).Card(*).Sensor(*).Attributes.BasicInfo |