Skip to main content

Manual Declarations

The Knowledge Graph is built from what NudgeBee's collectors discover. Some things they cannot see: a service that calls another without distributed tracing, an on-prem database, a third-party API, or a resource in an account no collector reads. Manual declarations let you add those yourself, so NudgeBee can correlate alerts across them and its AI agents can reason about them like any other part of your environment.

You can declare two things:

  • Dependencies — one service calls, publishes to, or subscribes to another.
  • Nodes — a resource the graph does not have yet, so a dependency has something to point at.

Add them one at a time, or import many at once from a single JSON document that declares nodes and the dependencies between them together.

Where to find it​

  1. Open Troubleshoot → Knowledge Graph.
  2. Click Settings at the top of the page. Only tenant admins see this button.
  3. Select the Manual Declarations tab.

The tab has a Nodes section and a Dependencies section, each with its own table and actions. The buttons above them add new declarations: Import JSON, Declare node and Declare dependency.

The Manual Declarations tab of Knowledge Graph Settings, with Import JSON, Declare node and Declare dependency buttons above a Nodes table listing three declared nodes Knowledge Graph Settings → Manual Declarations

Nodes​

A declared node goes into the graph as soon as you save it, so dependencies can point at it straight away. Where you declare it decides what happens later.

In a connected cloud account or Kubernetes cluster. NudgeBee gives the node exactly the identity its collector will give the same resource. When the collector later discovers it, the two become one node, and every dependency on it keeps working. This is why some fields are required: they are the fields that identity is built from.

WhereRequired fields
AWS, GCP or Azure accountResource type, name and region. For an AWS EC2 instance or load balancer, also the VPC it is in. For an RDS instance or cluster, or a Redshift cluster, give the VPC if it is in one.
Kubernetes clusterResource type (Deployment, StatefulSet, DaemonSet, CronJob or Service), name and namespace

Outside any connected account. Use this for an on-prem database, a SaaS API, or anything else no collector will ever read. Pick a node type (for example Database, Cache, MessageQueue or ExternalService) and a name. A namespace is optional and works as a grouping, such as a team or environment. These nodes never merge with a collected one.

A node outside any account can also use a kind of your own, such as NetworkSwitch. A tenant admin introduces a new kind the first time it is used.

Optional details depend on the resource type, for example a database's engine. Fields only the collector can know, such as timestamps, runtime state, allocated IPs and internal ids, cannot be declared.

Node statuses​

StatusWhat it meansWhat to do
ActiveDeclared by hand. It stays in the graph until you delete it or a collector discovers it.Nothing.
AdoptedA collector now provides this node. It is the same node, so dependencies on it are unchanged. The details you typed were replaced by the collected data.Nothing. You can delete the declaration; the node stays.
Possible duplicateA collected node with the same type and name exists under a different identity, for example because the VPC you gave was not the one the resource is in.Choose Merge into collected node from the row's menu. Dependencies move to the collected node and the declaration is removed.

A node's identity fields cannot be edited after it is declared, because changing them would make it a different node. To change one, delete the node and declare it again. An Adopted node cannot be edited at all; the collector owns its details.

Dependencies​

A dependency names a source, a destination and how they relate:

RelationshipUse it when
CALLSThe source sends requests to the destination (HTTP, gRPC, a database query). The default.
PUBLISHES_TOThe source writes messages to a queue or topic.
SUBSCRIBES_TOThe source reads messages from a queue or topic.

These three link any two nodes. When one end is a node declared outside any account, six more are available:

RelationshipUse it when
RUNS_ON, HOSTED_ON, DEPENDS_ON, ROUTES_TOThe source depends on the destination, for example a VM that runs on a host or traffic that routes through a load balancer.
CONNECTED_TOThe two are linked with no direction, such as a cable between a server and a network switch.
BELONGS_TOThe source is grouped under the destination.

NudgeBee finds each side in the graph by its type and name, narrowed by any namespace, cluster, ARN or account you give. The Status column shows how that went:

StatusMeaning
ResolvedBoth sides matched exactly one node. The edge appears in the graph after the next rebuild, which runs hourly.
Source unmatched / Dest unmatchedNo node matched that side yet. Choose Declare source node or Declare destination node from the row's menu to add it, prefilled from the dependency.
Source ambiguous / Dest ambiguousSeveral nodes matched. Choose Resolve from the row's menu and pick the right one.
Source: too many / Dest: too manyMore than ten nodes matched. Edit the dependency and add a namespace, cluster, ARN or account to narrow it.
PendingNot resolved yet.
Node inactiveA node it pointed at is no longer in the graph.
Invalid payloadThe declaration can't be read. Edit it.

Re-resolve on a row, or Re-resolve all, matches again. That is useful once a missing resource has been collected.

Declaring one at a time​

  • Declare node opens a form. Choose where the resource lives, then its type. The form shows the required fields for that type and lists its optional details.
  • Declare dependency opens a form with a Source and a Destination column. Each side takes a node type and name, plus optional qualifiers.

Importing a JSON document​

Use an import to declare many things at once, or to keep your declarations in a file under version control.

  1. Click Import JSON.
  2. Paste the document into the editor, or click Upload file to load a .json file.
  3. Click Import.

To start from something that already fits your environment, click the download icon next to Sample for your accounts. The sample uses your connected accounts and their types. View format shows the structure and the type values your accounts accept.

The View format panel: a JSON skeleton of a document, a short field guide, and the type values grouped by account type, here the node types for nodes outside any account View format lists the type values your connected accounts accept

The Import Manual Declarations (JSON) dialog with a document in the editor, the View format button, the sample download and Upload file Paste or upload a document, then click Import

Document format​

A document has two lists, nodes and dependencies. Either may be left out, but not both.

{
"nodes": [
{
"ref": "billing-db",
"node_type": "Database",
"name": "billing-db",
"namespace": "finance",
"labels": { "team": "finance" },
"properties": { "engine": "postgres" }
},
{
"ref": "orders-queue",
"cloud_account": "123456789012",
"specific_type": "SQSQueue",
"name": "orders-queue",
"region": "us-east-1"
},
{
"ref": "ledger-worker",
"cloud_account": "<kubernetes account id>",
"specific_type": "KubernetesDeployment",
"name": "ledger-worker",
"namespace": "payments",
"properties": { "replicas": 3, "annotations": { "owner": "ledger-team" } }
}
],
"dependencies": [
{ "source": "ledger-worker", "dest": "billing-db", "relationship_type": "CALLS" },
{ "source": "ledger-worker", "dest": "orders-queue", "relationship_type": "PUBLISHES_TO" },
{
"source": { "node_type": "Workload", "name": "checkout", "namespace": "shop", "cluster": "prod-cluster" },
"dest": "billing-db"
}
]
}

Node fields​

FieldTypeRequiredDescription
refstringNoHow dependencies in this document refer to the node. Defaults to name. Must be unique in the document.
namestringYesThe resource name, as the cloud console or cluster shows it.
cloud_accountstringIn an accountThe connected account, by its provider account number (AWS account, GCP project, Azure subscription) or its NudgeBee account id. Kubernetes clusters have no account number, so use the id. Leave it out for a node outside any account.
specific_typestringIn an accountThe resource type, for example SQSQueue, RDSInstance or KubernetesDeployment. View format lists the values for your accounts.
node_typestringOutside an accountThe node type, for example Database, Cache, MessageQueue or ExternalService.
regionstringFor a cloud resourceFor example us-east-1.
namespacestringFor a Kubernetes resourceOptional grouping for a node outside any account.
networkstringSome AWS typesThe VPC the resource is in, by its vpc-… id or its name as the graph shows it.
descriptionstringNoWhat it is and who owns it.
labelsobjectNoText keys and text values, at most 50.
propertiesobjectNoOptional details of the type. Values keep their JSON types: numbers, booleans, objects for key/value details such as annotations, and arrays for lists such as subnet_ids.

Dependency fields​

FieldTypeRequiredDescription
sourcestring or objectYesA string is the ref of a node in this document. An object names a node already in the graph (fields below).
deststring or objectYesSame as source.
relationship_typestringNoCALLS (default), PUBLISHES_TO or SUBSCRIBES_TO. With a node declared outside any account at one end, also CONNECTED_TO, DEPENDS_ON, RUNS_ON, HOSTED_ON, ROUTES_TO or BELONGS_TO.
notesstringNoFree text shown with the declaration.

A side written as an object takes these fields:

FieldRequiredDescription
node_typeYesFor example Workload, K8sService, Database, MessageQueue.
nameYesThe node's name.
namespaceNoKubernetes namespace.
clusterNoKubernetes cluster name.
arnNoResource ARN. When given, it is matched instead of the name.
account_idNoThe account the node is in, by provider account number or NudgeBee account id.

A side that refers to a node of the document is linked to that exact node, even when another node with the same type and name exists.

What the result shows​

Nodes are declared first, in order, then dependencies. Each item comes back with its outcome:

OutcomeApplies toMeaning
CreatedNodes and dependenciesDeclared. A dependency also shows its resolution status.
ExistingNodes and dependenciesAlready declared, or for a node already collected. A node shows the node it matched, and dependencies in the document that refer to it still link to it. Nothing is written again.
RejectedNodes and dependenciesNot declared, with the reason, such as region is required. A dependency on a rejected node is rejected too.

The import result: three nodes created and one rejected because its region is missing, two dependencies created and resolved, and one rejected because its destination node was not declared Every item is reported, with the reason for anything that was not declared

Click Done and both sections show what was added.

Importing the same file again is safe

Nodes and dependencies that already exist come back as Existing. Nothing is duplicated, so you can keep a declarations file in version control and import it again after editing it.

When a whole document is refused​

These problems refuse the document before anything is written:

  • It is not valid JSON, it is larger than 1 MB, or it declares more than 500 nodes and dependencies together. Split a larger set across several documents.
  • It has a field the format does not define, such as a misspelled nmae.
  • It declares nothing.
  • Two nodes use the same ref.
  • A dependency refers to a ref that no node in the document has.

The message names the item at fault, for example nodes[1]: ref "billing-db" is already used by nodes[0].

Permissions​

RoleCan do
Tenant adminEverything, including nodes outside any connected account and Delete all.
Account adminDeclare, edit and delete nodes and dependencies in the accounts they administer. A dependency that touches another account, or a node outside any account, is refused.

The Settings button is shown to tenant admins only, so an account admin works through the API. An account admin's import declares what they may write and rejects the rest, item by item.

Removing declarations​

  • Delete on a node removes it from the graph together with its edges, and dependencies that pointed at it become unmatched. For an adopted node, only the declaration is removed; the node belongs to the collector.
  • Delete on a dependency removes the declaration and its edge.
  • Delete all in either section removes every declaration of that kind for the tenant. Tenant admins only.