Entity lifecycle

Updated at:

Cloud product entities go through generation, update, expiration, and delivery stages. CloudResource collects entity metadata, and EntityStore stores entities within each workspace.

Entity generation

CloudResource is a core component in CloudMonitor 2.0 that stores cloud resource metadata. After you activate CloudMonitor 2.0, the system initializes the resources required for cloud product entities in your first workspace and continuously discovers instance data for all cloud products under your account.

For more information about CloudResource, see Basic concepts.

Data storage location:

<region_id> indicates the region where the CloudResource is located.
<account_id> indicates your account ID.
  • Project: cloud-resource-<region_id>-<account_id>.

  • LogStore (entity): cloud-resource____<account_id>__entity.

  • LogStore (topology): cloud-resource____<account_id>__topo.

Entity state management

Core fields

Parameter

Description

__method__

The operation type. Valid values are Update and Expire.

__last_observed_time__

The last observed time (Unix timestamp, in seconds).

__keep_alive_seconds__

The keep-alive duration in seconds.

__delete_at__

The deletion time (Unix timestamp, in seconds).

Keep-alive duration

  • By default, an entity has a keep-alive duration of 6 days and expires if not updated within this period. After a full or incremental synchronization, this duration is recalculated from the trigger time.

    Note

    A cloud product instance has a keep-alive duration of 6 days unless it is actively deleted. If it is deleted, it expires immediately.

Synchronization methods

RMC

CloudMonitor 2.0 subscribes to resource data from Resource Management Center (RMC), processes it to meet observability requirements, and saves it to CloudResource.

Synchronization method

Trigger time

Description

Full synchronization

After 05:00 daily

The system performs a full reconciliation using the daily resource snapshot from RMC.

Incremental synchronization

Real-time

The system subscribes to resource change events to update instance information in real time.

Incremental synchronization event storage location:

  • Project: aliyun-metadata-<account_id>-<region_id>.

  • LogStore: event.

OpenAPI

For some cloud products that are not integrated with RMC, the system calls the product's OpenAPI to fetch instance lists.

Synchronization method

Trigger frequency

Description

Scheduled polling

Every 5 minutes by default

The system periodically calls the cloud product API to retrieve the latest list of instances.

Entity update

Trigger conditions

An entity update triggers when any of the following conditions are met:

  1. RMC full synchronization: The system discovers resources during the daily full reconciliation after 05:00.

  2. RMC incremental event: RMC sends a resource change event, and the value of the resourceChangeType field contains ResourceUpdate or ResourceCreate.

    accountId:11111222222333333
    changeId:sc-774c3f1cc699dbebe2e0de2350f2f43d
    messageType:ResourceChange
    regionId:cn-hangzhou
    resourceChangeType:ResourceUpdate
    resourceDiff:{"changedProperties":{"EipAddress.AllocationId":{"previousValue":"","updatedValue":"eip-xxxxxxxxxxxxx"}}}
    resourceId:i-bp16ksdjg750yljlwefsdf
    resourceSnapshot:{"accountId":"111112222222223333333","configuration":{"ResourceGroupId":"","Memory":16384...............}
    Collapse
    resourceType:ACS::ECS::Instance
    version:1768285361729000
  3. OpenAPI polling: The system obtains the complete instance data for a cloud product through scheduled API calls, which run every 5 minutes by default.

System processing

When an entity update triggers, the system performs the following operations:

__method__              = "Update"
__keep_alive_seconds__  = <keep-alive duration calculated from the data source>
__last_observed_time__  = <last observed time>
<business_fields>       = <instance attributes extracted from the data source>

Entity deletion

Trigger conditions

A resource change event from the RMC LogStore triggers a deletion if the resourceChangeType field contains delete or del (case-insensitive).

The following is an example of an incremental deletion event:

accountId:111111111111111
changeId:sc-92350e9a3bfc723d74d3afac933d71ce
messageType:ResourceChange
regionId:cn-shenzhen
resourceChangeType:ResourceDelete
resourceId:i-wz91pr7mqljslfjwf
resourceType:ACS::ECS::Instance
version:1768293680116000

System processing

When the system detects a resource deletion event, it performs the following operations:

__method__              = "Expire"
__keep_alive_seconds__  = 0
__last_observed_time__  = <current time>
__delete_at__           = <current time>

Entity expiration

Expiration condition

An entity expires when the following condition is met: current time > __last_observed_time__ + __keep_alive_seconds__.

Data flow

┌───────────────────────────────────────────────────────────────────────────────┐
│                              Data Collection Layer                              │
├─────────────────────────────────────────────────┬─────────────────────────────┤
│                 RMC Data Source                 │      OpenAPI Data Source      │
│                                                 │                             │
│  ┌───────────────┐    ┌───────────────────────┐ │    ┌───────────────────┐    │
│  │ OSS Full Sync  │    │ SLS Incremental Events│ │    │ Scheduled API Call│    │
│  │ (Daily 05:00)  │    │      (Real-time)      │ │    │    (Every 5 min)  │    │
│  └───────┬───────┘    │                       │ │    └─────────┬─────────┘    │
│          │            │  Project:             │ │              │              │
│          │            │  aliyun-metadata-     │ │              │              │
│          │            │  <account_id>-        │ │              │              │
│          │            │  <region_id>          │ │              │              │
│          │            │  LogStore: event      │ │              │              │
│          │            └───────────┬───────────┘ │              │              │
│          │                        │             │              │              │
└──────────┼────────────────────────┼─────────────┴──────────────┼──────────────┘
           │                        │                            │
           ▼                        ▼                            ▼
┌───────────────────────────────────────────────────────────────────────────────┐
│                          Metadata Processing Engine                           │
│                                                                               │
│   ┌───────────────────────────────────────────────────────────────────────┐   │
│   │                        Entity State Determination                       │   │
│   │  ┌──────────────────────────┐     ┌──────────────────────────┐       │   │
│   │  │   resourceChangeType     │     │   resourceChangeType     │       │   │
│   │  │   = Create/Update        │     │   contains Delete/Del    │       │   │
│   │  └────────────┬─────────────┘     └────────────┬─────────────┘       │   │
│   │               │                                │                     │   │
│   │               ▼                                ▼                     │   │
│   │  ┌──────────────────────────┐     ┌──────────────────────────┐       │   │
│   │  │  __method__ = Update     │     │  __method__ = Expire     │       │   │
│   │  │  Set keep-alive duration │     │  __keep_alive_seconds__=0│       │   │
│   │  └──────────────────────────┘     └──────────────────────────┘       │   │
│   └───────────────────────────────────────────────────────────────────────┘   │
│                                                                               │
└───────────────────────────────────────────────────────────────────────────────┘
                                        │
                                        ▼
┌───────────────────────────────────────────────────────────────────────────────┐
│                             CloudResource Storage                             │
│                                                                               │
│   Project: cloud-resource-<region_id>-<account_id>                            │
│   ├── LogStore: cloud-resource____<account_id>__entity (entity data)           │
│   └── LogStore: cloud-resource____<account_id>__topo   (topology data)         │
│                                                                               │
└───────────────────────────────────────────────────────────────────────────────┘

Entity delivery

EntityStore is the core component in CloudMonitor 2.0 that stores cloud resource entities. CloudMonitor 2.0 automatically creates an EntityStore when you create a workspace. During observability data integration, the integration center delivers relevant entities from CloudResource to the workspace's EntityStore based on the entity scope you select.

Data storage location:

<workspace> indicates the workspace.
  • Project: Obtained by calling cms:GetWorkspace.

  • LogStore (entity): <workspace>__entity.

  • LogStore (topology): <workspace>__topo.

State management

Core fields

Parameter

Description

__method__

The operation type. Valid values are Update and Expire.

__last_observed_time__

The last observed time (Unix timestamp, in seconds).

__keep_alive_seconds__

The keep-alive duration in seconds.

__delete_at__

The deletion time (Unix timestamp, in seconds).

Delivery methods

CloudMonitor 2.0 synchronizes entities from CloudResource to EntityStore in two ways:

Synchronization method

Trigger time

Description

Full synchronization

Every 15 minutes

The system synchronizes all eligible entities to the EntityStore based on the user-selected entity scope.

Incremental synchronization

Real-time

The system subscribes to entity events from CloudResource to update instance information in the EntityStore in real time.

Entity update

Trigger conditions

An entity update in EntityStore triggers when either of the following conditions is met:

  1. CloudResource incremental update: CloudResource sends an update event for an entity.

  2. CloudResource full synchronization: Every 15 minutes, the system synchronizes all non-expired entities that match the user-selected entity scope to the EntityStore.

System processing

When an entity update triggers, the system performs the following operations:

__method__              = "Update"
__keep_alive_seconds__  = 1800
__last_observed_time__  = <entity delivery time>
<business_fields>       = <instance attributes extracted from CloudResource>

Entity expiration

Trigger conditions

CloudResource incremental update: CloudResource sends an expiration event for an entity.

System processing

When an entity expiration triggers, the system performs the following operations:

__method__              = "Expire"
__last_observed_time__  = <entity delivery time>
<business_fields>       = <instance attributes extracted from CloudResource>

Entity deletion

Trigger conditions

CloudResource incremental update: CloudResource sends a deletion event for an entity.

System processing

When an entity deletion triggers, the system performs the following operations:

__method__              = "Expire"
__keep_alive_seconds__  = 0
__last_observed_time__  = <original last observed time from CloudResource>
<business_fields>       = <instance attributes extracted from CloudResource>

FAQ

Why can't I find a new instance in CloudResource?

Entity generation is not instantaneous and has a slight delay:

  • RMC incremental synchronization: Usually takes a few seconds to a few minutes.

  • OpenAPI: Depends on the polling cycle, typically around 5 minutes, with a maximum of 10 minutes.

Why are deleted instances still found?

Entities expire rather than being deleted immediately. When the system receives a deletion event, it sets the __keep_alive_seconds__ field to 0. The entity then expires shortly after and no longer appears in query results.

How does the keep-alive duration affect queries?

The keep-alive duration determines how long an entity remains valid without receiving an update:

  • If an entity receives an update within its keep-alive duration, the duration is reset.

  • If an entity does not receive an update before its keep-alive duration ends, it expires and is no longer returned in query results.

Why are some instance updates delayed?

The delay may be due to the data source type:

  • RMC data source: Supports real-time incremental synchronization, so updates are timely.

  • OpenAPI data source: Relies on a scheduled polling mechanism, so the update frequency is limited by the polling cycle.

For more information, see Synchronization methods.