Skip to main content
Version: Nightly

semantic_entities

semantic_entities is the node set of the semantic graph: the entities that the stored telemetry describes.

The table is computed, not stored. Scanning it derives rows at read time, within the queried time window, from every table that contributes an entity declaration — set through greptime.semantic.entity.* options or resolved from a built-in convention. Built-in conventions let OTLP trace tables, target_info, and kube-state-metrics descriptors contribute convention-defined entities without carrying an explicit greptime.semantic.entity.* option for those entities. It is read-only: INSERT, CREATE, ALTER, TRUNCATE, and DROP are rejected.

SELECT entity_type, entity_id, scope, source_tables
FROM greptime_private.semantic_entities
WHERE observed_at >= now() - INTERVAL '15' MINUTE
ORDER BY entity_type, entity_id;
ColumnTypeDescription
observed_atTimestampMillisecondTime index. The 60-second bucket the entity was observed in.
window_startTimestampMillisecondStart of the observation window.
window_endTimestampMillisecondEnd of the window (window_start + 60 seconds).
fresh_untilTimestampMillisecondTime up to which the entity counts as present. Equals window_end for derived rows.
entity_typeStringThe entity's type, for example service, service.instance, host, k8s.pod, gen_ai.agent.
entity_idStringCanonical identifier: the identifying column values in declared order, escaped and joined with ,.
entity_id_attrsJsonThe identifying attributes as an object, keyed by the columns they came from.
scopeStringNamespace or environment the id is scoped to. Empty when the declaration names no scope column.
descriptiveJsonSnapshot of the declared non-identifying attributes. NULL when none were declared.
source_tablesJsonArray of the telemetry tables that contributed this observation, as schema.table.

A row is one entity observation from one contributing table in one window, so an entity declared by several tables produces several rows per window. Deduplicate with SELECT DISTINCT entity_type, entity_id.

The observed_at predicate bounds the derivation. Without one, the last hour is used; a predicate with no lower bound is an error. See The query window.

Derivation runs with the querying user's permissions. Source tables the caller cannot read are excluded.