Field system
A field is the basic unit of data in UModel, representing specific properties such as logs, metrics, traces, or entities. Each field includes metadata such as name, type, constraints, and display characteristics. Fields are the building blocks for constructing observable data models.
Case study materials
Download the materials for this use case: umodel-enrich-dev.zip.
Core concepts
Definition and role of a field
A field is a fundamental part of any dataset and provides a structured description of data. In UModel, fields serve the following purposes:
-
Data structure definition: Specifies the type, format, and constraints.
-
Semantic expression: Conveys business meaning through display names and descriptions.
-
Query capability: Indicates whether the field can be filtered, analyzed, or sorted.
-
Display control: Defines how the field is shown in the user interface, including formatting rules.
Position of fields in the data model
TelemetryDataSet/EntitySet
├── fields: Field[] # List of fields
├── time_field: string # Reference to time field
└── metrics: Metric[] # Metric definitions (MetricSet only)
Field property specifications
Basic properties
The following table describes the core properties of a field:
|
Property |
Type |
Required |
Default value |
Description |
Constraints |
|
|
string |
Yes |
- |
The unique identifier of the field in UModel. |
Regular expression: Length: 0 to 127 characters |
|
|
semantic_string |
No |
- |
The multilingual display name. |
Supports Chinese and English. |
|
|
semantic_string |
No |
- |
A detailed description. |
Supports Chinese and English. |
|
|
semantic_string |
No |
- |
A brief description. |
Supports Chinese and English. |
|
|
enum |
Yes |
- |
The data type. |
See the Data types table. |
|
|
enum |
No |
preview |
The launch stage. |
See the Launch stages table. |
Supported data types
UModel supports the following data types:
|
Type |
Description |
Scenarios |
Example |
|
|
String type |
Text data, identifiers, enumeration values |
"nginx-pod-123", "ERROR" |
|
|
Integer type |
Counters, status codes, port numbers |
8080, 200, 1024 |
|
|
Floating-point number type |
Percentages, ratios, decimal values |
85.6, 0.95, 3.14 |
|
|
Boolean type |
Switch statuses, flags |
true, false |
|
|
Time type |
Timestamps, date and time |
"2024-01-15T10:30:00Z" |
|
|
JSON object type |
Complex structured data |
{"status": "active", "count": 5} |
|
|
JSON array type |
List data, multi-value fields |
["error", "warn", "info"] |
Launch stages
The launch_stage property controls the lifecycle of a field:
|
Stage |
Description |
Recommended use |
|
|
Preview stage (default) |
For testing new features. Subject to change. |
|
|
Beta stage |
Feature is mostly stable. For limited use. |
|
|
General Availability (GA) |
Recommended for production environments. |
|
|
Deprecated |
Scheduled for removal. Not recommended for new projects. |
Constraint and validation properties
Numeric constraint properties
These properties control the value range of numeric fields:
|
Property |
Type |
Applicable types |
Description |
Example |
|
|
number |
integer, float |
The minimum value. |
0, -100.5 |
|
|
number |
integer, float |
The maximum value. |
100, 999.99 |
|
|
any |
All types |
The default value. |
0, "INFO", true |
String constraint properties
These properties control the format and length of string fields:
|
Property |
Type |
Applicable types |
Description |
Example |
|
|
string |
string |
A regular expression for validating the field value format. |
|
|
|
integer |
string |
The maximum length of the string. |
128, 255 |
|
|
any |
All types |
An example value. |
"web-server-01" |
Analysis properties
These properties control how a field behaves in queries and analysis:
|
Property |
Type |
Default value |
Description |
Scenarios |
|
|
boolean |
false |
Whether the field can be used as a GROUP BY column for aggregation. |
Dimension fields, such as region or service name. |
|
|
boolean |
false |
Whether the field supports indexed filtering. |
Fields commonly used in query conditions. |
|
|
boolean |
false |
Whether the field can be sorted. |
Numeric or time fields that require sorting. |
|
|
enum |
asc |
The default sort direction: |
Time fields usually use desc. |
Display formatting
Display format properties
These properties control how a field is displayed in the user interface:
|
Property |
Type |
Default value |
Description |
|
|
string |
- |
The display unit. For display only; no format conversion is performed. |
|
|
enum |
KMB |
The formatting method. See the Data formatting options table. |
Best practices for units:
-
Set
data_formatfirst. It covers most observability scenarios. -
If
data_formatdoes not meet your needs, setdata_formattoKMBand setunitto a specific type. -
For example, for a temperature field:
data_format: "KMB",unit: "°C".
Data formatting options
The data_format property supports the following options:
Numeric formats
|
Format |
Description |
Example effect |
|
|
Formats numbers into thousands (K), millions (M), and billions (B). |
1,234 → 1.23K |
Storage formats
|
Format |
Description |
Example effect |
|
|
Formats into bytes. |
1024 → 1 KB |
|
|
Formats into bits. |
8192 → 8 Kb |
Rate formats
|
Format |
Description |
Example effect |
|
|
Formats into bytes per second. |
1048576 → 1 MB/s |
|
|
Formats into bits per second. |
1000000 → 1 Mbps |
|
|
Formats into I/O operations per second. |
1000 → 1K io/s |
|
|
Formats into requests per second. |
5000 → 5K req/s |
Percentage formats
|
Format |
Description |
Value range |
Example effect |
|
|
Formats as a percentage. |
1 to 100 |
85 → 85% |
|
|
Formats a decimal as a percentage. |
0 to 1 |
0.85 → 85% |
Time formats
|
Format |
Description |
Example effect |
|
|
Local time format. |
1705310400 → 2024-01-15 18:00:00 |
|
|
Converts milliseconds to local time. |
1705310400000 → 2024-01-15 18:00:00.000 |
|
|
Converts microseconds to local time. |
1705310400000000 → 2024-01-15 18:00:00.000000 |
|
|
Converts nanoseconds to local time. |
1705310400000000000 → 2024-01-15 18:00:00.000000000 |
|
|
Specific time zone. |
For example, UTC+8 or UTC-5. |
Duration formats
|
Format |
Description |
Example effect |
|
|
Days, hours, minutes, and seconds format. |
90061 → 1d 01:01:01 |
|
|
Hours, minutes, and seconds format. |
3661 → 01:01:01 |
|
|
Formats into days, hours, minutes, or seconds. |
3600 → 1h |
|
|
Formats into milliseconds, microseconds, or nanoseconds. |
1500 → 1.5s |
Value mapping and extension properties
Value mapping property
Maps enumeration values to display content:
|
Property |
Type |
Description |
|
|
map |
The mapping configuration for enumeration values. The key is the original value, and the value is the mapping object. |
A value mapping object contains the following properties:
-
name: The mapped name identifier. -
display_name: The multilingual display name. -
description: The multilingual description. -
short_description: The multilingual short description.
Extension properties
Attaches metadata and custom configurations:
|
Property |
Type |
Description |
Example |
|
|
string |
The URL of the field icon (experimental). |
|
|
|
string |
The unique identifier URI (experimental). |
|
|
|
map |
Tags for classification and retrieval. |
|
|
|
map |
Additional properties. |
|
Typical configuration examples
Metric fields
CPU utilization field
|
Property |
Value |
Description |
|
name |
|
Field identifier |
|
display_name |
|
Multilingual display name |
|
type |
|
Floating-point number type |
|
min_value |
|
Minimum value |
|
max_value |
|
Maximum value |
|
data_format |
|
Percentage format |
|
unit |
`` |
No additional unit configuration is needed. |
|
filterable |
|
Supports filter queries. |
|
analysable |
|
Supports aggregation analysis. |
|
orderable |
|
Supports sorting. |
Memory usage field
|
Property |
Value |
Description |
|
name |
|
Field identifier |
|
display_name |
|
Multilingual display name |
|
type |
|
Integer type |
|
min_value |
|
Minimum value |
|
data_format |
|
Byte format |
|
unit |
`` |
No additional unit configuration is needed. |
|
filterable |
|
Supports filter queries. |
|
analysable |
|
Supports aggregation analysis. |
Log fields
Log level field
|
Property |
Value |
Description |
|
name |
|
Field identifier |
|
display_name |
|
Multilingual display name |
|
type |
|
String type |
|
filterable |
|
Supports filter queries. |
|
analysable |
|
Supports aggregation analysis. |
|
value_mapping |
See the value mapping example. |
Enumeration value mapping. |
Example of log level value mapping:
{
"DEBUG": {
"name": "debug",
"display_name": {"zh_cn": "调试", "en_us": "Debug"}
},
"INFO": {
"name": "info",
"display_name": {"zh_cn": "信息", "en_us": "Info"}
},
"ERROR": {
"name": "error",
"display_name": {"zh_cn": "错误", "en_us": "Error"}
}
}
HTTP status code field
|
Property |
Value |
Description |
|
name |
|
Field identifier |
|
type |
|
Integer type |
|
min_value |
|
Minimum HTTP status code. |
|
max_value |
|
Maximum HTTP status code. |
|
filterable |
|
Supports filter queries. |
|
analysable |
|
Supports aggregation analysis. |
Tracing Analysis fields
Trace ID field
|
Property |
Value |
Description |
|
name |
|
Field identifier |
|
type |
|
String type |
|
pattern |
|
32-character hexadecimal format. |
|
max_length |
|
Fixed length of 32 characters. |
|
filterable |
|
Supports filter queries. |
|
analysable |
|
High cardinality; not recommended for aggregation. |
Operation duration field
|
Property |
Value |
Description |
|
name |
|
Field identifier |
|
type |
|
Floating-point number type |
|
min_value |
|
Minimum value |
|
data_format |
|
Millisecond format |
|
unit |
No additional unit configuration is needed. |
|
|
filterable |
|
Supports filter queries. |
|
analysable |
|
Supports aggregation analysis. |
|
orderable |
|
Supports sorting. |
|
default_order |
|
Default sort order is descending. |
Entity identifier fields
Hostname field
|
Property |
Value |
Description |
|
name |
|
Field identifier |
|
type |
|
String type |
|
max_length |
|
Maximum length |
|
filterable |
|
Supports filter queries. |
|
analysable |
|
Supports aggregation analysis. |
Pod name field
|
Property |
Value |
Description |
|
name |
|
Field identifier |
|
type |
|
String type |
|
pattern |
|
Kubernetes naming convention. |
|
max_length |
|
Kubernetes maximum length limit. |
|
filterable |
|
Supports filter queries. |
|
analysable |
|
Supports aggregation analysis. |