APM entity and relationship modeling

Updated at:

APM entity and relationship modeling is based on the reporting characteristics of observability data. The CMS 2.0 platform automatically discovers entities such as applications, operations, instances, and external dependencies, and establishes topology relationships between them. Automatic association depends on standardized, complete, and stable reported data, so you do not need to maintain the topology in advance or manually. When the reported data cannot reliably identify a relationship, or the target object is not integrated with entity discovery, use StarOps to supplement the association manually. Understanding the entity types, relationship semantics, and the conditions for association helps you determine why a topology association is missing and select the correct fix.

Supported entities

The APM domain supports 15 entity types, grouped into core entities, external dependency entities, and AI entities. These categories reflect how each entity is used, so although apm.external.model (large language model) and apm.external.tool (tool) are called by AI applications or agents and their entity_type uses the apm.external. prefix, they are still classified as AI entities. This list covers the entity types in the APM domain. Kubernetes, infrastructure, and Alibaba Cloud service entities that appear in cross-domain associations, such as k8s.pod, infra.server, and acs.rds.instance, do not belong to the APM domain.

Core entities

Entity

entity_type

Definition

Application

apm.service

A monitored application or service. It is the core node of an APM topology.

Operation

apm.operation

An entry point that an application provides externally or internally, such as an HTTP request, an RPC call, a message consumption operation, or a scheduled task.

Instance

apm.instance

An actual runtime unit of an application, such as a host process or an application instance in a Kubernetes Pod.

External dependency entities

Entity

entity_type

Definition

Database

apm.external.database

A relational database accessed by an application.

NoSQL database or cache

apm.external.nosql

A NoSQL database, cache, or search service accessed by an application.

External HTTP service

apm.external.http_client

An external destination called by an application over HTTP.

Message queue

apm.external.message

A message instance or topic accessed by an application when the application produces messages.

RPC client

apm.external.rpc_client

An external destination called by an application over an RPC protocol.

Other external dependency

apm.external.others

Another outbound call destination that cannot be classified into the preceding categories.

AI entities

Entity

entity_type

Definition

AI application

apm.genai.service

An AI application that provides inference capabilities.

Model service

apm.genai.model_service

An inference service that provides model inference capabilities.

AI agent

apm.genai.agent

An agent that performs complex inference processes, such as a main agent or a subagent.

Large language model

apm.external.model

A large language model called by an AI application or an agent.

Tool

apm.external.tool

An external tool called by an AI application or an agent.

Skill

apm.genai.skill

A skill that an agent loads or calls on demand.

Entity relationship types

An APM topology supports five entity relationship types: contains, calls, related_to, same_as, and hosts. The following table describes the semantics and the typical entity pairs of each relationship type.

Relationship

Semantics

Typical entity pairs

contains

A containment relationship.

An application contains operations. An application contains instances.

calls

A call relationship that points from the caller to the callee.

An application calls another application. An application or an operation calls an external dependency. A GenAI application or an agent calls a model or a tool.

related_to

An association relationship.

An AI application is associated with an agent.

same_as

An equivalence relationship in which two entities are the same object.

An APM external dependency is equivalent to the corresponding cloud resource. A GenAI application is equivalent to a regular APM application.

hosts

A hosting relationship that points from a resource to the application or instance that it hosts.

A Kubernetes Workload hosts an APM application. A Pod hosts an APM instance. An ECS instance hosts an APM instance.

Automatic discovery and association

Automatic identification mechanism

Based on the data characteristics in application metrics, traces, agent instance information, and resource attributes, the CMS 2.0 platform automatically identifies applications, operations, instances, and external dependencies, and establishes entity relationships. Automatic identification relies only on standardized, complete, and stable reported data, so you do not need to maintain the topology in advance or manually. The automatically generated relationships include contains, calls, related_to, same_as, and hosts. For the semantics and typical entity pairs of each relationship type, see Entity relationship types. For the minimum reporting characteristics required by each entity type, see Data reporting requirements.

Prerequisites for cross-domain association

Cross-domain association refers to the relationship between an APM entity and a Kubernetes, Alibaba Cloud service, or infrastructure entity. Automatic association requires all of the following conditions:

  1. Entities on both sides are discovered. APM data is reported as expected, and the corresponding Kubernetes, cloud service, or infrastructure entity is integrated with entity discovery.

  2. Association identifiers are complete. The reported data contains the identifiers used for matching, such as the cluster, namespace, Pod, Workload, instance ID, IP address, endpoint, or application name.

  3. Identifier values are consistent. The value reported on the APM side is semantically and syntactically consistent with the value registered on the resource side.

  4. Entities are in the same visibility scope. Data on both sides enters a workspace or resource management scope in which the data can be queried and used to build a topology together.

  5. Data remains valid. The collection pipeline does not delete or overwrite association identifiers or rewrite them into values that cannot be matched.

Important

Even after these conditions are met, if the number of k8s.pod entities is too large and exceeds the entity limit, the display of cross-domain associations with the APM domain is still affected. Submit a ticket or contact technical support to increase the capacity.

The following table lists common automatic cross-domain relationships. In the table, → indicates that the relationship points from the first entity to the second entity, and ↔ indicates that the entities on both sides correspond to each other:

Association scenario

Entity relationship

Key identification condition

A Pod hosts an instance

k8s.pod → apm.instance, hosts

The cluster identifier, the namespace, and the Pod name are consistent, and the APM instance identity is complete.

A Deployment hosts an application

k8s.deployment → apm.service, hosts

The Pod association is established, and the Deployment name can be identified.

A StatefulSet hosts an application

k8s.statefulset → apm.service, hosts

The Pod association is established, and the StatefulSet name can be identified.

A database is associated with RDS or PolarDB

apm.external.database ↔ cloud database entity, same_as

The database call type is correct, and the endpoint is consistent with the endpoint and port of the cloud service.

A NoSQL database is associated with Redis or Elasticsearch

apm.external.nosql ↔ cloud service entity, same_as

The NoSQL call type is correct, and the endpoints are consistent.

A message is associated with Kafka

apm.external.message ↔ Kafka instance or topic, same_as

The message call type, the instance endpoint, or the topic name is consistent.

An instance is associated with ECS

infra.server → apm.instance, hosts

The ECS instance ID or IP address is consistent.

An application is associated with API Gateway or PAI-EAS

apm.service ↔ cloud service entity

The application name is consistent with the corresponding cloud service instance name.

Recommended integration methods for Kubernetes

This section describes the Kubernetes association scenarios in the preceding table in more detail. For the resource attributes to report in a Kubernetes environment, see Data reporting requirements.

  • (Recommended) If you use an ARMS agent, integrate it by using ACK OnePilot. During application deployment, OnePilot can supplement Kubernetes environment context, which allows the CMS 2.0 platform to complete the association automatically based on the reported characteristics.

  • If you integrate through OpenTelemetry, continuously report standard Kubernetes resource attributes in the Span Resource so that entity mapping associations between the application layer and the infrastructure layer can be established automatically based on the data.

Data reporting requirements

Whether automatic association succeeds depends on whether the reported data is standardized, complete, and stable. Instrumentation must meet the following requirements.

General instrumentation specifications

  1. Keep application identifiers stable. Use a fixed service.name for the same logical application. Do not append variable information such as Pod names, IP addresses, or version numbers.

  2. Place resource information in the Resource. Report Kubernetes cluster, namespace, Pod, Workload, and host attributes as resource attributes with all Spans.

  3. Use actual resource identifiers. Use the UID for a cluster and the actual Kubernetes names for Pods and Workloads. Do not use the aliases displayed in the console.

  4. Preserve complete call semantics. For database, message, RPC, and HTTP outbound calls, preserve the protocol type, the call direction, and the destination address.

  5. Standardize destination address formats. For database and middleware addresses, use the domain names or connection strings and ports that are consistent with those in the cloud console, and standardize the casing and the format of additional characters.

  6. Avoid high-cardinality entity identifiers. Do not use URL query parameters, request IDs, or container temporary IDs as stable identifiers of applications, operations, or external dependencies.

Kubernetes resource attributes

In a Kubernetes environment, provide at least the following information:

Purpose

Recommended attributes

Identify an application

service.name, and the workspace identifier. If an application ID is assigned, keep the application ID consistent.

Identify an instance

host.name or host.ip.

Associate a Pod

k8s.cluster.uid, k8s.namespace.name, and k8s.pod.name.

Associate a Deployment

The attributes required for Pod association, and k8s.deployment.name.

Associate a StatefulSet

The attributes required for Pod association, and k8s.statefulset.name.

Minimum identification characteristics for external calls

The CMS 2.0 platform identifies external dependencies based on the data characteristics of outbound calls. The minimum identification characteristics are as follows:

External entity

Minimum identification characteristics

apm.external.database

Database call type + endpoint.

apm.external.nosql

NoSQL or cache call type + endpoint.

apm.external.http_client

HTTP client call type + destId.

apm.external.message

Message production call type + endpoint.

apm.external.rpc_client

RPC client call type + endpoint.

apm.external.others

General client call type + endpoint.

Troubleshoot association failures

Troubleshooting sequence and solutions

If a topology is missing, perform the following checks in sequence:

  1. Check whether both the source entity and the destination entity are generated.

  2. Check whether the data that corresponds to the call or hosting relationship is generated and reported.

  3. Check whether the key identifiers are complete and stable and consistent with the registration information of the destination resource.

  4. In Kubernetes scenarios, focus on the Pod triplet, the instance identity, and the Workload name.

  5. In external dependency scenarios, focus on the call type and endpoint or destId.

  6. If the conditions for automatic association cannot be met, use StarOps to write a manual topology relationship.

    After you identify the cause category, select a solution from the following table:

Finding

Solution

Entities are not generated: Kubernetes entities are not integrated, or the destination system is not integrated with entity discovery and the destination entity does not exist.

Complete entity discovery or integration first, and confirm that the relevant entities are visible to the current workspace.

Association identifiers are missing or inconsistent: k8s.* resource attributes are missing, the endpoint is inconsistent with the value registered on the resource side, or the destination address is rewritten by a proxy, a gateway, load balancing, a Service address, or a NAT address.

Standardize instrumentation and unify identifiers as described in Data reporting requirements to restore automatic association.

The entity scale exceeds the limit: k8s.pod entities are too numerous.

Submit a ticket or contact technical support to increase the capacity.

Matching characteristics objectively cannot be provided: the destination is a third-party system or a self-managed resource, and historical data or special instrumentation cannot supply the required fields.

Use StarOps to supplement the association manually.

Common causes in Kubernetes scenarios

  1. Kubernetes entities are not integrated or are missing

    • Symptom: Entities such as clusters or workloads cannot be found in the entity list. The APM application and instances work as expected, but the topology does not contain a Pod or Workload that can be associated.

    • Cause: Entity discovery is not complete on the Kubernetes side, or the relevant cluster resources and entities are not visible to the current workspace.

    • Solution: Complete Kubernetes entity discovery first, and confirm that the relevant cluster resources and entities are visible to the current workspace. Log on to the CMS 2.0 console and choose Integration Center > Container Insights to explicitly enable integration for a container cluster, and make sure that the entities can be viewed in the entity list.

  2. Container entities cannot be located for applications integrated through OpenTelemetry

    • Symptom: APM cannot directly locate container-related entities in the topology.

    • Cause: The Span data reported in the OpenTelemetry scenario is incomplete, which causes Pod-related labels to be missing from the metrics.

    • Solution: Add standard k8s.* Resource attributes, such as k8s.pod.name, to the Span data reported in the OpenTelemetry scenario. In a Kubernetes environment, at least make sure that host.name is set to the Pod name. Otherwise, the association fails.

  3. Container entities cannot be located for applications integrated through an ARMS agent

    • Symptom: APM cannot directly locate container-related entities in the topology.

    • Cause: In an ARMS agent integration scenario, you must integrate through ACK OnePilot so that Kubernetes environment context can be automatically identified and injected into the data reported by the agent.

    • Solution: Complete the integration through ACK OnePilot, and then check whether the heartbeat logs reported by the agent contain Kubernetes runtime environment information to confirm that the integration takes effect.

  4. Association fails because the entity limit is exceeded

    • Symptom: Container Insights is integrated, and the APM instance contains Kubernetes Pod Name information, but the instance still cannot be associated with a Kubernetes entity.

    • Cause: The number of k8s.pod entities may be too large and exceed the entity limit, which affects the display of cross-domain associations with the APM domain.

    • Solution: Submit a ticket or contact technical support to increase the capacity.

Common causes for external dependencies

When an external dependency entity is generated but cannot be further associated with a specific cloud resource, monitored application, or third-party system, common causes include:

  • The reported destination address is a proxy, a gateway, load balancing, a Service address, or a NAT address, and differs from the actual destination entity identifier.

  • The endpoint does not contain a port, contains extra characters, or differs from the public or private endpoint registered on the resource side.

  • The HTTP destination contains only a generic URL and lacks a stable identifier that uniquely locates the destination entity.

  • Entity discovery is not enabled for the destination system, or the destination entity does not exist.

  • A custom framework or instrumentation does not correctly represent the call type and the destination address.

    Prioritize restoring automatic association by standardizing instrumentation and unifying identifiers. Use manual association as a supplement only when matching characteristics objectively cannot be provided.

Manually supplement associations by using StarOps

Scenarios

You can use StarOps to supplement UModel topology relationships in the following scenarios:

  • http_client and database calls pass through a proxy or undergo address translation and cannot be automatically matched with the actual destination.

  • The destination is a third-party system, a self-managed resource, or another object that cannot be integrated through standard entity discovery.

  • Historical data or special instrumentation cannot supply the fields required for automatic association.

  • The relationship between two entities is known from a business perspective, but the reported data is not enough to reliably infer it.

Manual association elements

When you manually create an association, explicitly specify the following information:

Information

Description

Source entity

The entity_type and unique identifier of the source entity, such as the calling application, operation, or APM external dependency.

Destination entity

The entity_type and unique identifier of the destination entity. If the destination does not exist, add or integrate the entity first.

Relationship type

Select a relationship such as calls, same_as, or hosts based on the actual semantics.

Scope

Specify the workspace or resource scope to which the relationship belongs to avoid incorrect cross-environment associations.

Lifecycle

Specify how the relationship takes effect and how it is updated and deleted to prevent an invalid topology from remaining after an entity goes offline.

Relationship types must strictly follow entity semantics. For the semantics and direction of each relationship type, see Entity relationship types. The following table lists typical examples:

Scenario

Source entity

Destination entity

Relationship

Supplement a call from an application to an external HTTP destination

apm.service or apm.operation

apm.external.http_client

calls

Map a database call destination to an actual RDS instance

apm.external.database

acs.rds.instance

same_as

Supplement the hosting relationship between a Pod and an application instance

k8s.pod

apm.instance

hosts

Note

Manual association only supplements the topology relationships between entities. It does not replace application instrumentation, trace collection, or metric reporting, and it does not automatically supply monitoring data for the destination entity. If automatic identification can be restored through standard reporting, prioritize automatic association to reduce manual maintenance costs and prevent relationships from expiring.

Recommended procedure

  1. Confirm that automatic association does not fail because of data latency, an entity that is not integrated, or missing key fields.

  2. Confirm that both the source entity and the destination entity can be uniquely located.

  3. In StarOps, explicitly enter the source entity, the destination entity, and the relationship type to write the topology association data.

  4. In the UModel topology, verify the relationship direction, the relationship semantics, and the display result.

  5. When an entity identity or the deployment environment changes, update or delete the existing manual relationship accordingly.

Manual association example

Example scenario: The CMS 2.0 platform identifies that an AI application calls the Qwen3-8B model service, which is deployed on PAI-EAS. From the client perspective of the AI application, only the HTTP service endpoint is visible, so the underlying PAI inference service entity cannot be directly associated. In this case, you can use UModel to supplement the entity relationship. Invoke StarOps from the CMS 2.0 console and enter the write instruction in a natural-language conversation. The instruction must clearly describe the source entity, the destination entity, the entity relationship, and the retention period, which can be set to five years. The following is an example instruction:

apm.external.model: Qwen3-8B corresponds to acs.pai.eas:qwen38b. Write the association between these two entities to topoStore, set relation_type to same_as, and retain the association for five years.

After StarOps completes the operation, the topology displays the relationship between the client entity and the server entity as expected.