Skip to main content
The Graph SDK is a programmable interface to Anyshift’s infrastructure graph. Use it when you need graph answers inside automation, dashboards, CI checks, incident workflows, deployment gates, or developer tools. For the exhaustive source-of-truth matrix, see CAPABILITIES.md in the SDK repository.

Dependency and Impact Analysis

GoalSDK helperUse it for
Find direct neighborsgraph.connections()Show what is directly connected to a service, workload, node, config, or dependency.
Compute blast radiusgraph.blast()Estimate what is affected if a resource changes or fails.
Trace a pathgraph.path()Explain how two resources are connected.
Expand a service footprintgraph.serviceTree()Build a downstream dependency tree for service reviews or incident prep.
Explain shared failure causesgraph.commonCause()Find shared nodes or workloads behind recent failures.
Check deployment falloutgraph.deployImpact()Rank risky recent deploys or inspect one workload’s rollout impact.

Timelines and Change Feeds

GoalSDK helperUse it for
Read recent graph eventsgraph.events()Pull recent changes for a namespace, resource, event type, or time window.
Find noisy resourcesgraph.hotspots()Rank noisy resources, namespaces, alert rules, or alerting workloads.
Read failure eventsgraph.failures()Feed failure timelines into automation or reports.
Read deployment eventsgraph.deployments()Track rollouts and deployment activity.
Read audit activitygraph.audit()Inspect config, identity, or infrastructure changes.
Trace incident cascadesgraph.cascade()Follow a correlated incident from trigger to impacted resources.

Topology and Diagrams

GoalSDK helperUse it for
Build service topologygraph.topology()Get typed graph nodes and edges for a service neighborhood.
Render MermaidtoMermaid()Embed topology diagrams in PRs, incident reports, runbooks, or dashboards.
Topology supports context, container, component, and dynamic levels. Dynamic topology renders as a sequence diagram; the other levels render as flowcharts.

Kubernetes Safety and Hygiene

GoalSDK helperUse it for
Find single points of failuregraph.spof()Rank highly shared ConfigMaps, service accounts, or nodes.
Find orphaned resourcesgraph.orphans()Detect unused ConfigMaps, service accounts, roles, or ReplicaSets.
Check PDB coveragegraph.pdb()Find workloads that are unsafe during voluntary disruptions.
Check autoscaler coveragegraph.scaling()Find workloads without HPAs or inspect what an HPA scales.
Check scheduling prioritygraph.priority()Find workloads without priority classes or inspect the preemption ladder.
Inspect persistent storagegraph.storage()Trace PVC/PV/StorageClass usage and find orphaned or unclaimed storage.
Inspect image usagegraph.image()Find who runs an image, inspect a workload’s images, or run container hygiene scans.

Security and Exposure

GoalSDK helperUse it for
Inspect RBAC reachgraph.access()Understand what a subject can do or who can reach a role.
Find over-privileged identitiesgraph.access({ mode: "privileged" })Rank service accounts with broad or risky grants.
Inspect NetworkPolicy coveragegraph.netpol()Detect default-allow namespaces, inspect policies, or model east-west reach.
Inspect public exposuregraph.exposure()Map ingresses to services/workloads or find which ingress exposes a resource.

Observability and Alerting

GoalSDK helperUse it for
Find monitoring gapsgraph.coverage()Find workloads missing Datadog presence, monitors, or metrics shipping.
Map alert impactgraph.alertImpact()Find which monitors and SLOs would fire if a resource is impacted.
Map monitors to infrastructuregraph.monitor()Resolve a monitor to the service, workload, and node it watches.
Read active alertsgraph.alerts()Pull currently firing Datadog monitors, optionally scoped to a service.
Find noisy alertsgraph.alertNoise()Rank flapping or stuck monitors.
Explain alert causegraph.alertCause()Link a firing service to recent Kubernetes changes.
Inspect SLO healthgraph.slo()Rank breaching or at-risk SLOs, or inspect one named SLO.
Inspect Grafana/Victoria rulesgraph.alertRules()Find alert-rule coverage gaps, inventory rules, or inspect one target’s rules.

Service Dependencies and Ownership

GoalSDK helperUse it for
Inspect datastore dependenciesgraph.datastore()Find services using a datastore, or rank heavily used datastores.
Inspect stream dependenciesgraph.flow()Find producers and consumers for topics or streams.
Inspect external dependenciesgraph.externalDep()Find services depending on an external host.
Inspect service callsgraph.calls()Find callers and callees for a service, or rank high-traffic services.
Inspect GitOps driftgraph.gitops()Find drifted ArgoCD apps, unmanaged workloads, or a workload’s owning app and repository.

Choosing the Right Entry Point

Use typed helpers when you need deterministic automation. Use graph.query() when you need a graph SQL escape hatch. Use graph.ask() when the caller has a natural-language question and can accept server-side routing.
For full parameter details and the underlying query intent names, use the SDK repository’s CAPABILITIES.md.