Add a Graph Query
Next, we need to add a graph query to the new probe. Before starting, review the graph database overview explained in the following section. Otherwise, to continue with the configuration, proceed to Add Graph Queries to the Probe.
Graph Database Overview
The Apstra graph database is an in-memory, distributed datastore (DDS). It models network intent as interconnected nodes, including switches, interfaces, links, services, policies, and routing zones, with directed relationships that show connections and dependencies.
Role of a Graphy Query in IBA
A graph query in a source processor defines the scope of telemetry collection. This scoping is enforced by mapping graph query results to telemetric keys, such as IP addresses. In our case, the telemetry service key is an IP address, so the query must obtain IP addresses. There are three BGP sessions: Underlay, Overlay, and External BGP Sessions. Let’s examine graph queries for all BGP sessions.
Before exploring graph queries, we must first understand static and dynamic series graphs in IBA.
-
Static series (graph-driven)
The graph scope determines the set of series. Graph query results control the data fed into the probe by the service collector. Mapping query results to telemetry service keys, defined in the service schema, achieves this. These series are called "static" because they stay unchanged unless the graph changes.
-
Dynamic series (collector-driven)
Dynamic series graphs respond to switch conditions, regardless of graph state. The telemetry service on the device defines the series dynamically. The graph specifies which systems execute the service but omits key service aspects.
This approach is useful for monitoring components absent in the graph database, including:
-
Power supplies
-
Optical transceivers
-
Configuration elements without graph properties
These series are called "Dynamic" because they respond to switch activity independently of the graph state.
-
Graph Query Examples
This section includes three graph queries we'll use to determine the Remote IP Address of the BGP Protocol running for Underlay, Overlay, and External BGP sessions.
Underlay BGP Graph Query
A blueprint includes interfaces connecting to generic systems, external routers, and the fabric side. In this setup, the first BGP sessions act as Underlay sessions. Apstra’s Reference Design specifies that Underlay BGP sessions are established on physical interfaces facing the fabric. The graph query retrieves IPv4 addresses for all fabric-facing links and interfaces.
Example: Graph Query for Underlay BGP Sessions
match(
node('system', name='system', deploy_mode='deploy', role=is_in(['leaf', 'spine']))
.out('hosted_interfaces')
.node('interface', name='iface', if_name=not_none())
.out('link')
.node('link', link_type='ethernet', name='link', role='spine_leaf')
.in_('link')
.node('interface', name='remote_iface')
.in_('hosted_interfaces')
.node('system', role=is_in(['spine', 'leaf', 'superspine']), deploy_mode='deploy',
name='remote_system')
)
.ensure_different('system', 'remote_system')
Overlay BGP Graph Query
Overlay BGP connects over loopback interfaces, specifically Loopback0
(lo0) per Apstra's Design Reference. End-to-end overlay
BGP sessions link leaf devices. The graph query must retrieve loopback IPs
for all leaf devices with overlay BGP sessions. The lo0
interface acts as a logical interface within the device.
Example: Graph Query for Overlay BGP Sessions
match(
node('system', name='system', deploy_mode='deploy', role=is_in(['leaf', 'spine']))
.out('hosted_interfaces')
.node('interface')
.out('link')
.node('link', name='link')
.in_('link')
.node('interface')
.in_('hosted_interfaces')
.node('system', role=is_in(['leaf', 'spine']), deploy_mode='deploy', name='remote_system')
.out('hosted_interfaces')
.node('interface', if_type='loopback', loopback_id=0, name='remote_iface'),
node(name='system')
.out('hosted_interfaces')
.node('interface', loopback_id=0, name='iface')
)
.ensure_different('system', 'remote_system')
.distinct(['system', 'remote_system', 'remote_iface'])
External BGP Graph Query
External BGP sessions run on physical interfaces connected to external routers or generic systems, not fabric-facing ports. According to the Apstra Reference Design, these ports connect to external routers or generic systems. External BGP sessions are configured for the default BGP table and routing-instances table in this setup.
The graph query must return the IP address of all system-facing links from the leaf where:
-
BFD is enabled.
-
The link is a protocol endpoint.
-
The interface type is a sub-interface.
Example: Graph Query for External BGP Sessions
match(
node(name='iface', type=is_in(['interface', 'ip_endpoint']), if_type="subinterface")
.in_('layered_over')
.node('protocol_endpoint')
.in_('instantiates')
.node('protocol_session', bfd=True)
.out('instantiates')
.node('protocol_endpoint')
.out('layered_over')
.node('interface', name='remote_iface')
.ensure_different('iface', 'remote_iface'),
node(name='iface', if_type="subinterface")
.in_('composed_of')
.node('interface')
.in_('hosted_interfaces')
.node('system', name='system', role="leaf"),
node(name='remote_iface')
.out('link')
.node('link', name='link')
)Add Graph Queries to the Probe
To add the graph queries:

Next, continue to Add an Analytical Processor.



