Processor: Generic Service Data Collector

The Generic Service Data Collector processor collects data supplied by a custom service that is not ‘lldp’, ‘bgp’ or ‘interface’. Service name is specified as ‘service_name’, service specific key is specified as ‘key’, ‘data_type’ to specifies if the collected data is numbers or discrete state values, and ‘value_map’ for the specific data could be specified as well.

Input Types - No inputs. This is a source processor.

Output Types - Discrete-State-Set (DSS), Number-Set (NS), TS (based on data_type)


Data Type
Type of data the service collects: numbers (ns) (such as device temperature), discrete states (dss) (such as device status), text or tables
Graph Query (graph_query)

One or more queries on graph specified as strings, or a list of such queries. (String will be deprecated in a future release.) Multiple queries should provide all the named nodes referenced by the expression fields (including additional_properties). Graph query is executed on the “operation” graph. Results of the queries can be accessed using the “query_result” variable with the appropriate index. For example, if querying property set nodes under name “ps”, the result will be available as “query_result[0][“ps”]”.

In collector processors (*_collector, if_counter) it is used to choose a set of nodes for further processing (for example, all leafs, or all interfaces between leaf and spines)

In other processors it is used for general parameterization and it is only supported as a list of queries.

Fabric Interfaces Example
   graph_query: "node("system", role="leaf", name="system").
                 node("interface", name="iface").out("link").
                 node("link", role="spine_leaf")"
Leafs and Spines using two queries Example
   graph_query: ["node("system", role="leaf", name="system")",
                 "node("system", role="spine", name="system")"]
Value Map

A mapping of discrete-state values to human readable strings. A dictionary with all possible Discrete-State-Set states mapped to human-readable representation; applicable for Discrete-State-Set data (that is, when data_type is ‘dss’) only.

Sample value map for interface status
    "0": "unknown",
    "1": "down",
    "2": "up",
    "3": "missing"
Key (key)
Expression mapping from graph query to whatever key is necessary for the service.
Service name (service_name)
Name of the custom collector service.
System ID
Expression mapping from graph query to a system_id, e.g. “system.system_id” if “system” is a name in the graph query.
Execution count
Number of times the data collection is done.
Service input (service_input)
Data to pass to telemetry collectors, if any. Can be an expression.
Service interval (service_interval)
Telemetry collection interval in seconds. Can be an expression.
Additional Keys
Each additional key/value pair is used to extend properties of output stages where value is considered as an expression executed in context of the graph query and its result is used as a property value with respective key. The value of this property is evaluated for each item to associate items with metrics provided by a corresponding collector service. The association is done by keys because each collector reports a set of metrics where each metric is identified by a key in a format that is specific for each collector.
Enable Streaming (enable_streaming)
Makes samples of output stages streamed if enabled. An optional boolean that defaults to False. If set to True, all output stages of this processor are streamed in the generic protobuf schema.