The Smartscape events model defines the public ingest format for creating and updating Smartscape topology entities in Grail. It provides a unified, documented protocol for configuring smartscape.event pipelines so that all events share a consistent structure.
Query all custom Smartscape entities created via smartscape.events ingest.
smartscapeNodes "CUSTOM_*"| fields id, name, type, lifetime
Count all custom Smartscape entities by their entity type.
smartscapeNodes "CUSTOM_*"| summarize count(), by: type
Query all edges originating from custom service entities ingested via smartscape.events.
smartscapeEdges "*"| filter source_type == "CUSTOM_SERVICE"| fields source_id, type, target_id, target_type
The Smartscape events model is the public ingest format for creating and updating Smartscape topology entities in Grail. Each event uses exactly one of two identity modes and may carry field updates, tag updates, and relationship declarations. For a full overview, see Smartscape on Grail.
Identity Modes (mutually exclusive per event):
id field.type and id_components; the pipeline derives the entity ID from them.Mixing both modes in a single event is a contract violation.
Query all custom Smartscape entities created via smartscape.events ingest.
smartscapeNodes "CUSTOM_*"| fields id, name, type, lifetime
Count all custom Smartscape entities by their entity type.
smartscapeNodes "CUSTOM_*"| summarize count(), by: type
Query all edges originating from custom service entities ingested via smartscape.events.
smartscapeEdges "*"| filter source_type == "CUSTOM_SERVICE"| fields source_id, type, target_id, target_type
Exactly one identity mode must be used per event. id (Mode 1) and the pair type + id_components (Mode 2) are mutually exclusive.
| Attribute | Type | Description | Examples |
|---|---|---|---|
| smartscapeId | experimentalMode 1 (Assembled ID): the pre-assembled Dynatrace entity ID of the entity to create or update. JSON key: |
|
| record[] | experimentalMode 2 (Key-based ID): an ordered array of single-key objects whose values are combined to derive the entity ID hash. JSON key: |
|
| string | experimentalMode 2 (Key-based ID): the entity type used together with |
|
Fixed top-level fields that control event routing, security, and lifetime behavior.
| Attribute | Type | Description | Examples |
|---|---|---|---|
| string[] | resource stableSecurity context(s) associated with the entity. Controls access visibility for the resulting entity. Accepts a single string, an array of strings (max 10 elements), or |
|
| long | experimentalProtocol version of the smartscape.events format. JSON key: |
|
| boolean | experimentalControls whether this event advances the entity's last-seen timestamp (end of |
|
Any top-level key that is not a reserved protocol field and does not have the tags: prefix is treated as an entity field update. Field values may be a scalar (string, number, or boolean), null to clear the field, or a flat string:string object (all keys and values must be strings; numbers, booleans, arrays, and nested objects inside an embedded object are rejected).
| Attribute | Type | Description | Examples |
|---|---|---|---|
| record | experimentalPrimary tag dimensions exposed at the top level of the entity. JSON key: |
|
| Attribute | Type | Description | Examples |
|---|---|---|---|
| record | experimentalFlattened tag updates. JSON key: |
|
| Attribute | Type | Description | Examples |
|---|---|---|---|
| record | experimentalMap of edge type to array of target entity references for dynamic (short-lived) relationships. JSON key: |
|
| record | experimentalMap of edge type to array of target entity references for static (long-lived) relationships. JSON key: |
|
The payload is a JSON array of event objects. Each event must use exactly one identity mode.
[{"event.version": 1,"type": "HOST","id_components": [{ "hostname": "myhost.example.com" }],"dt.security_context": "my-security-context","update_lifetime": true,"name": "my-host","ext.custom.region": "eu-west-1","ext.entity.annotations": {"backstage.io/owner": "team-foo","backstage.io/managed-by-location": "url:https://bitbucket.lab.dynatrace.org/..."},"primary_tags.env": "production","tags:custom.infra": { "tier": "core" },"tags:ext.source": { "env": "production" },"static_edges": {"belongs_to": [{ "type": "HOST_GROUP", "id_components": [{ "group": "grp-1" }] }]},"dynamic_edges": {"runs_on": [{ "id": "PROCESS_GROUP_INSTANCE-0000000000000001" }]}}]
Use when the Dynatrace entity ID is already known. Only id is required; type and id_components must be absent.
[{"id": "HOST-00AB12CD","name": "prod-host-01","tags:custom": { "team": "platform-engineering" }}]
Use when declaring a new entity or syncing from an external system. type and id_components are required; id must be absent.
[{"type": "CUSTOM_SERVICE","id_components": [{ "name": "checkout-service" }, { "service.namespace": "payments" }],"dt.security_context": ["pci-scope", "prod-infra"],"service.version": "3.1.2","static_edges": {"calls": [{ "type": "CUSTOM_DATABASE", "id_components": [{ "name": "orders-db-primary" }] }]}}]
| Restriction | Detail |
|---|---|
Identity mode is exclusive | Each event must use exactly one identity mode. |
| Each object in the |
|
|
| Must match |
Forward declarations |
|
| Setting any entity field to |
Entity field value types | Field values may be a scalar (string, number, or boolean), |
| Absent is equivalent to |
| Maximum 20 |
Reserved top-level keys |
|
Field-name rules | Entity field names (including |
| Tag updates must use the |
Tag context name | Max 32 bytes (UTF-8). |
Tag key length | 1 – 256 bytes (UTF-8). |
Tag value length | String: max 1 024 bytes (UTF-8). String array: each element max 1 024 bytes. |
Edge type name format | Must match |
Max static edge types | Max 32 static edge types per event. |
Edge target identity | Edge targets inside |
Empty | An empty array for a given edge type deletes all edges of that type from the entity. |
Empty | An empty array for a given edge type is ignored (no deletion). |
| Accepts a string, a string array (max 10 elements), or |
All limits are enforced before any upsert call — a violation produces a FLAWED result and prevents partial writes.
| Property | Limit |
|---|---|
Max total payload size | 200 KB |
Max nesting depth (object / array) | 5 |
Max node type name length | 250 characters |
Max field name size | 256 bytes (UTF-8) |
Max field size (key + value) | 128 KB |
Max total field count per event | 128 (includes tags and |
Max static edge types per event | 32 |
Max edge type name size | 32 bytes (ASCII) |
Max edge targets section size (per type) | 32 KB |
Max tag context name | 32 bytes (UTF-8) |
Max tag key length | 256 bytes (UTF-8) |
Max tag value length | 1 024 bytes (UTF-8) |
Max | 10 |
These rules apply only to arbitrary node fields and tag contexts (all top-level keys not listed in the reserved key set). They do not restrict structural keys (id, type, id_components, name, dt.security_context, edges).
Writability depends on the source trust level and node type:
EXT_* or CUSTOM_*) may also write any field or tag context.process.metadata[COMMAND_LINE_ARGS], ext.*, custom.*tags:ext.*, tags:custom.*