Generate and manage Source Models

Updated at:

A Source Model identifies the data structures, field meanings, metrics, and terms in a Simple Log Service (SLS) project. DataAgents reference the adopted content of a Source Model to answer questions about your data. Generate a Source Model for a project, review the modeling results, handle the adoption status, and regenerate the model after the data changes.

Prerequisites

  • You are approved for the SLS DataAgent public preview.

  • The target project resides in a region that Source Model supports.

  • You have the permissions to create and manage Source Models and can view the target project.

  • Indexes are configured for each LogStore that you want to model. A project can contain multiple LogStores, and the model may contain no fields for a LogStore whose indexes are not configured.

Add a project and generate the model

If the project list shows the target project with the Existing Model tag, a Source Model has already been generated for that project. Do not add the project again. Go directly to the project details page to view or regenerate the model.

To add a project and generate its Source Model:

  1. Log on to the SLS console and go to SLS DataAgent.

  2. In the top navigation bar, click Source Model.

  3. Select the target region. If the target project is not in the list, click Add Project.

  4. In the dialog box, search for the project by name, select it, and then click Confirm.

  5. Wait for the generation task to complete. The page shows the task status, such as generating, completed, partially completed, or failed.

    Note

    Generation usually takes tens of seconds to a few minutes. The time depends on the data volume and on the number of LogStores, dashboards, alerts, and Scheduled SQL jobs in the project. If dashboards, alerts, or Scheduled SQL jobs already exist, the system references these assets to extract more semantics.

    After the generation completes, the Source Model page shows the data tables, metrics, and terms of the target project. The adopted content can be synchronized to the associated Context Models and then used by DataAgents. If the task status is partially completed or failed, see The details page lists LogStores but no fields.

View the model content

Click the project name to go to the Source Model details page. The left side of the page lists the data sources, and the main area shows the content on the following tabs:

TabDescriptionWhat to check
SchemaThe field structure and semantics of the LogStoreField types, time fields, dimensions or measures, and the meaning of enumeration values
MetricsThe calculation definitions identified from query assetsExpressions, aggregation methods, filter conditions, and whether the names are ambiguous
TermsBusiness expressions and their explanationsAliases, definitions, and whether the associated data tables are correct

Handle the adoption status

Automatically generated content in a Source Model has the following statuses:

  • Automatically adopted — Sufficient evidence exists, and the content can be synchronized and used directly.

  • Not adopted — The content is ambiguous or the evidence is insufficient, and it requires manual review.

  • Manually adopted — The content is adopted after you confirm or edit it.

    When you handle content that is not adopted, check the following items first:
  • Fields involved in the calculation of core metrics

  • Status codes, business enumeration values, and units such as amount and duration

  • Fields that share the same name but have different meanings across multiple LogStores

  • Time fields and tenant fields that affect filter conditions

    DataAgents reference only the adopted content. Content that is not adopted is not used to answer questions, even if it already appears on the page. To change the adoption status of an element, confirm or edit the element. For details, see Edit the model content.

Edit the model content

When you modify an element that is synchronized to Context Models, keep the physical fields and expressions consistent with the raw data. Adjust only the business description, the role, the meaning of the enumeration values, or the adoption status.

If a field has different interpretations in different business scenarios, do not write an overly specific single definition in the Source Model. Keep a neutral data meaning, and then add the scenario-specific terms or metrics to the Context Model. A Context Model is associated with a project and a LogStore, and it receives the adopted content of that data source from the Source Model.

Content that you edit and confirm is synchronized to the associated Context Models. For details, see Synchronize to Context Models.

Regenerate a Source Model

Regenerate the model when the LogStore indexes, dashboards, alerts, or Scheduled SQL jobs change.

In the current public preview, regeneration performs a union update: existing elements are retained, and the newly selected scope is added. Narrowing the LogStore scope does not automatically delete the extra elements from the previous generation.

Warning

Manually adopted content exists only because you confirmed or edited it, and manually added elements are not overwritten by Source Model synchronization. To narrow the data scope completely, first confirm the impact of deletion and rebuilding on this content, and then proceed based on the capabilities available in the official console.

  1. Go to the details page of the target Source Model.

  2. Click Regenerate or the refresh entry.

  3. Select the LogStores to process. If you do not specify a LogStore, all LogStores in the project are processed by default.

  4. Submit the task and wait for it to complete.

    Note the following items:
  • Only one generation task can run at a time for the same project.

  • Frequent regeneration may be subject to a quota limit on task records and quantity.

Synchronize to Context Models

After Source Model content generation completes, or after the content is manually confirmed, the content is synchronized to the Context Models associated with that data source. In the current public preview, the maximum synchronization delay is 60 seconds. If a Context Model is not updated after you make changes, see Context Model is not updated.

FAQ

A project shows the "Existing Model" tag

The tag indicates that a Source Model has already been generated for the project, so you do not need to add the project again. Go directly to the details page to view or regenerate the model. For details, see Add a project and generate the model.

The details page lists LogStores but no fields

Check whether indexes are configured for the LogStore, whether you have read permissions on it, and whether the generation task partially failed. An empty LogStore or a data source whose samples cannot be read may also fail to produce valid fields.

Old content remains after regeneration

Regeneration performs a union update, so historical elements are not deleted only because the selected scope is smaller this time. To narrow the scope, see Regenerate a Source Model, which describes the impact of deleting and rebuilding the model.

Context Model is not updated

Check the following items in order:

  1. Confirm that the element is adopted.

  2. Confirm that the Context Model is still associated with the corresponding project and LogStore.

  3. Wait for one synchronization cycle, or trigger a manual synchronization on the Context Model page.

    If the element was added manually, Source Model synchronization does not overwrite it.