Перейти к содержанию

Nodes and links#

This layer renders:

  • nodes with colors from Node Styles, node groups, and Grafana thresholds
  • optional donut-chart sections for multiple node metrics
  • auto-layout routed links in graph mode
  • direct Arc links with optional side A and side B metrics

Data model#

Mapgl builds nodes and links from the same input records. It does not require one table for nodes and a separate table for edges.

Mapgl works with any Grafana data source that returns the fields selected in the layer editor.

In practice, this usually means:

  • query any data source supported by Grafana
  • use Grafana transformations when needed
  • produce a dataframe with node IDs, optional link targets, and optional coordinate fields
  • include any additional fields you want to use as node or link properties, metrics, labels, tooltip fields, search fields, or node group match conditions

The processing flow is:

  1. Mapgl reads the dataframe and collects nodes from Vertex A.
  2. After nodes are known, Mapgl makes links from Vertex B.
  3. Styling, labels, and tooltips are then applied from the properties carried by each record.

This is why a single row can both define a node and create a link from that node to another node.

When several Markers and links layers are configured, Mapgl composes them in data-layer order into one graph. Each layer keeps its own Data matcher, field mappings, styles, and LayerSwitcher entry. A link in one layer can target a node supplied by another layer because link validation runs after nodes from all configured graph layers are collected.

Location and identity#

These fields define how Mapgl builds the topology:

  • Vertex A: unique node ID.
  • Vertex B: target node ID or path array. If set, Mapgl draws links.
  • Edge ID: optional link identity. Use a unique value for every parallel link that should stay separate. Reuse a value only for consecutive rows that form one continuous route; fields from each row remain available on its displayed route portion.
  • Vertex A namespace: optional namespace for source nodes in graph mode.
  • Vertex B namespace: optional namespace for target nodes in graph mode. It can be configured independently; an unset source namespace uses external.
  • Namespace layers separator: one or two symbols used to split nested namespace values. Choose ., ,, or -, or enter a custom separator. It appears when either namespace field is configured and defaults to ..
  • Geo mode uses one shared external namespace; namespace field selections are ignored there.
  • Search by: extra fields included in the panel search text.

Coordinates are not required for graph mode. They are only needed when you want Geo placement instead of auto-layout.

For a direct link, set Vertex B to the target node ID.

For routed paths, Vertex B can contain a path array. Use this when the link should pass through intermediate nodes or coordinate waypoints. Refer to Vertex B path rules for the accepted values.

Examples:

# Direct link
Vertex A=A, Vertex B=B

# One routed graph link
Vertex A=A, Vertex B=["A", "B", "C"], Edge ID=route-1

# One routed Geo link through a longitude/latitude waypoint
Vertex A=A, Vertex B=["A", [15, 55], "B"], Edge ID=geo-route-1

If an intermediate node ID does not exist, Mapgl skips that waypoint and keeps the route between the remaining valid nodes. Missing source or final target nodes still prevent the link from being created.

Use Edge ID when the same Vertex A -> Vertex B pair can appear more than once and should stay as separate links.

Each parallel link needs its own Edge ID value. If repeated rows use the same edge key, Mapgl treats them as the same logical link.

In the open source panel, parallel edge offset rendering is available in abstract node graph mode.

Trace and service graph edges#

For service dependency graphs and trace-like data, use Vertex B as the service path and Edge ID as the trace or branch key. Rows that share an Edge ID must be consecutive, remain in data source order, and connect end-to-start. Mapgl displays them as one routed link, while styling and tooltip fields from each row remain associated with the corresponding route portion.

For example, a trace layer can use:

  • Vertex A: source service
  • Vertex B: service path, such as ["api-gateway", "order-service", "payment-service"]
  • Edge ID: trace branch ID shared by the consecutive span rows for that branch
  • extra fields: duration, status, span IDs, method, cost, or other per-span properties

For example:

Vertex A        Vertex B            Edge ID   duration_ms
api-gateway     payment-service     trace-42  18
payment-service postgres-primary    trace-42  41

The two rows are adjacent and the second begins where the first ends, so trace-42 is displayed as one ordered route. Fields such as duration or cost remain available for the matching route portion in the edge tooltip.