entity Table
The Entity table contains information about which entities appear in the topologies and when. Table gets updated with each market cycle.
Data Object | Type | Nullable | Primary | Description | Reference |
---|---|---|---|---|---|
oid |
bigint |
False |
True |
The entity ID. |
|
type |
enum |
False |
False |
The entity type. |
|
name |
text |
False |
False |
The current display name for the entity. While display names may change over time, this is always the most recent display name. |
|
environment |
enum |
True |
False |
Whether the entity is in an on-prem, cloud, or hybrid environment. |
|
attrs |
jsonb |
True |
False |
Additional data for the entity. |
|
first_seen |
timestamp with time zone |
False |
False |
When the entity was first discovered in the topology. |
|
last_seen |
timestamp with time zone |
False |
False |
When the entity last existed in the topology. For an entity that still exists, the value is 9999-12-31T23:59:59. |
Sample Use Cases
Count entities that meet specific criteria:
For a given time interval, count the number of PHYSICAL_MACHINE
entities that have 4 CPUS.
select count(*)
from entity e
where e.type = 'PHYSICAL_MACHINE'
and attrs->'num_cpus'= '4'
and ('2021-02-01T05:00:00Z','2021-02-18T04:59:59Z') OVERLAPS (e.first_seen, e.last_seen)
Find clusters that were configured for a given time range:
Queries like this are common to generate values for grafana variables that you can run reports against.
SELECT name, oid
FROM entity
WHERE
entity.type = 'COMPUTE_CLUSTER'
AND ('2021-02-01T05:00:00Z','2021-02-18T04:59:59Z') OVERLAPS (first_seen, last_seen)
ORDER BY 1
For example, here’s a list of variables that a user is choosing: