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
EntitySetwith 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. |
|
|
display_name |
Display name. |
|
|
description |
Method description. |
|
|
params |
Parameter schema (JSON array). |
|
|
returns |
Return value schema (JSON array). |
|
Example method list (excerpt):
|
name |
display_name |
description |
|
|
List Available Methods |
Lists available methods for the current EntitySet. |
|
|
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:
-
Discover capabilities.
.entity_set with(domain='apm', name='apm.service')
| entity-call __list_method__()
-
Filter and select the target method, such as
get_golden_metrics. -
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
-
Specify the entity context:
domainandname, with optionalidsorquery. -
Enumerate available methods:
__list_method__(). -
Read the method signature, which includes
paramsandreturns(JSON description). -
Select a method and prepare parameters. If necessary, use
list_data_setandlist_related_entity_set. -
Execute the
entity-callto 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 |
|
type |
Dataset type, such as |
|
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_setandlist_related_entity_setto 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.