Grafana

Query the knowledge graph from Grafana, build topology dashboards, and set up alerts based on graph changes.

Overview

The Grafana integration provides a native datasource plugin that lets you query the Knowledge Tree graph directly from your Grafana instance. Build dashboards that visualize resource topology, track change trends over time, and set up alerting rules triggered by graph events.

Grafana datasource

The Knowledge Tree datasource plugin registers a new datasource type in Grafana. It supports both simple metric queries and graph traversal queries.

Query typeDescription
Resource countNumber of resources by provider, type, or scope
Change volumeResource changes over time with aggregation
Topology queryReturn resource relationship data for graph panels
Health scoreAggregated health score by scope or provider
Custom CypherArbitrary Cypher queries for advanced use cases

Prebuilt dashboards

The integration ships with several prebuilt dashboards that you can import directly:

  • Infrastructure overview -- global resource counts, provider breakdown, recent changes
  • Change tracking -- change volume timeline, top changing resources, drift summary
  • Topology viewer -- interactive resource relationship graph using the Grafana node graph panel
  • Health monitoring -- resource health scores, degraded resources, and scope-level health
  • Discovery coverage -- discovered vs. total resources per provider, last discovery timestamps

Alerting

Grafana alerting rules can query the Knowledge Tree datasource to trigger alerts on conditions such as:

  • New critical resources discovered without owner tags
  • Sudden spike in resource changes (potential drift or misconfiguration)
  • Health score dropping below a threshold
  • Discovery pipeline failing for more than N consecutive runs
  • Unusual resource types appearing in a scope
Combine with Prometheus metrics
The Knowledge Tree datasource works alongside your existing Prometheus and Loki datasources, letting you correlate graph data with metrics and logs in a single dashboard.

Configuration

# Install the datasource plugin
grafana-cli plugins install knowledge-tree-graph-datasource

# Provision the datasource
# /etc/grafana/provisioning/datasources/kt.yml
apiVersion: 1
datasources:
  - name: Knowledge Tree
    type: knowledge-tree-graph-datasource
    url: http://kt-server:8080
    access: proxy
    jsonData:
      api_path: /api/v1
    secureJsonData:
      api_key: ${KT_API_KEY}