All Products
Search
Document Center

Cloud Monitor:Phase 2 Object mode - Service discovery

Last Updated:Jun 04, 2026

1. Overview of Object mode

Object mode accesses entities (EntitySet) through a unified SPL interface, calling entity methods to retrieve observability data and metadata. Compared to Table mode (Phase 1), Object mode offers:

  • Object-oriented: Organizes capabilities around EntitySet with business-aligned semantics.

  • Dynamic capabilities: Discovers and calls entity methods at runtime (similar to reflection).

  • Automatic mapping: Applies DataLink and StorageLink field mappings and filters automatically.

  • Relational semantics: Natively accesses relational data between entities.

Basic syntax:

.entity_set with(domain='domain_name', name='entity_name', [ids|query|other_parameters])
| entity-call method_name(parameters...)

General parameters:

Parameter

Type

Required

Description

Example

domain

string

Yes

Domain of the EntitySet.

‘apm’

name

string

Yes

Name of the EntitySet.

‘apm.service’

ids

array

No

A list of entity IDs.

[‘id1’,‘id2’]

query

string

No

Filter condition. Syntax: SPL syntax.

‘service_id = “xxx”’

Scenarios:

  • Analyze data by business entity (services, interfaces, hosts).

  • Automate field mappings and filters to simplify calls.

  • Reuse unified method semantics across different entities and relationships.

Comparison with Table Mode:

  • Table mode: Direct access to MetricSet/LogSet/... with finer control, but requires knowledge of underlying details.

  • Object mode: Entity-centered with method-based capabilities. Higher abstraction and composability.

2. Dynamic capability discovery (runtime method reflection)

Object mode's core is dynamic capability discovery. The built-in __list_method__ enumerates all methods the current EntitySet supports at runtime, including parameter and return value schemas. Call these methods adaptively as needed.

2.1 List available methods

.entity_set with(domain='apm', name='apm.service')
| entity-call __list_method__()

Returned fields:

Field

Description

Example

name

Internal method name for calls.

get_entity_set

display_name

Display name.

Get Current EntitySet

description

Method description.

Return the current EntitySet definition

params

Parameter schema (JSON array).

[{"key":"dest_entity_set_domain","type":"varchar","display_name":"Destination Entity Domain (empty for all domains)","description":"","required":false}, {...}]

returns

Return value schema (JSON array).

[{"key":"entity_set_id","type":"varchar","display_name":"EntitySet id, the format is domain@entity_set@name","description":""},{...}]

Example method list (excerpt):

name

display_name

description

__list_method__

List Available Methods

Lists available methods for the current EntitySet.

__inspect__

Configuration Inspector

Checks UModel configuration integrity and validity.

list_data_set

List DataSets

Lists datasets associated with the entity.

list_related_entity_set

List Related EntitySets

Lists entities related to the current entity.

get_golden_metrics

Get Golden Metrics

Gets golden metrics for the entity.

get_metric

Get Metric

Gets metric data from the associated MetricSet.

get_label_values

Get Label Values

Gets tag values from the associated MetricSet.

get_log

Get Log

Gets log data from the associated LogSet.

get_profile

Get Profile

Gets profiling data from the associated ProfileSet.

The return value of __list_method__ varies based on the entity's associated datasets and relationships, enabling adaptive discovery.

2.2 Read method metadata and call adaptively

Typical flow:

  1. Discover capabilities.

.entity_set with(domain='apm', name='apm.service')
| entity-call __list_method__()
  1. Filter and select the target method, such as get_golden_metrics.

  2. Assemble parameters and call the method.

.entity_set with(domain='apm', name='apm.service', query='service_id = "order-service"')
| entity-call get_golden_metrics('range', '1m')

You can also list associated datasets to select a method:

.entity_set with(domain='apm', name='apm.service')
| entity-call list_data_set(['metric_set'], true)

The returned data_set_id and fields_mapping enable automatic parameter and filter assembly for get_metric.

3. Standard flow for capability discovery and calls

  1. Specify the entity context: domain and name, with optional ids or query.

  2. Enumerate available methods: __list_method__().

  3. Read the method signature, which includes params and returns (JSON description).

  4. Select a method and prepare parameters. If necessary, use list_data_set and list_related_entity_set.

  5. Execute the entity-call to retrieve data or an SPL statement. In DryRun mode, the call returns an SPL statement.

Note:

  • If no datasets or relationships are associated, only basic methods (__list_method__ and __inspect__) are returned.

  • Method availability and parameters depend on the entity's associated DataSets and Links.

4. Typical usage examples

4.1 Discover available methods for an entity

.entity_set with(domain='apm', name='apm.service')
| entity-call __list_method__()

4.2 Get golden metrics (based on discovery results)

.entity_set with(domain='apm', name='apm.service', query='service_id = "order-service"')
| entity-call get_golden_metrics('range', '1m')

4.3 Query associated datasets and continue calls

.entity_set with(domain='apm', name='apm.service')
| entity-call list_data_set(['metric_set'], true)

Based on the return value:

Field

Description

data_set_id

Unique identifier of the associated dataset, such as apm@metric_set@apm.metric.apm.service.

type

Dataset type, such as metric_set.

fields_mapping

Field mapping that guides automatic parameter and filter assembly.

Proceed with a call like:

.entity_set with(domain='apm', name='apm.service', query='service_id = "order-service"')
| entity-call get_metric('apm', 'apm.metric.apm.service', 'request_count', 'range', '1m')

5. Best practices

  • Discover first, then call: Use __list_method__() to determine available capabilities before calling methods.

  • Combine list_data_set and list_related_entity_set to automate the construction of parameters and filter conditions.

  • Use DryRun for debugging:

.set "umodel_paas_mode"='dry_run';

.entity_set with(domain='apm', name='apm.service')
| entity-call get_metric('apm', 'apm.metric.apm.service', 'request_count')

DryRun returns an executable SPL statement for reviewing field mappings and query generation.

  • Cache the method list: The list is relatively stable. Cache it application-side to improve performance.