Object Mapping¶
Object mapping is an optimization feature for view variables, applicable only to object-class data such as basic objects and resource catalogs. It maps original fields to more readable display names. The mapping does not alter the original data or query logic; it only optimizes the front-end visualization display.
Core Functions¶
- Improve readability: Maps meaningless original fields (e.g.,
container_id,host_id) to business-recognizable names. - Unify display: View variables and charts can synchronously use the mapped names, ensuring consistency in dashboard presentation.
- No impact on queries: Only changes the front-end display; original field values are still passed during queries, eliminating the need to modify existing query statements.
Prerequisites¶
- Only supports object-class data (basic objects, resource catalogs); does not support other data types like Metrics, LOG, or events.
- A view variable based on object-class fields must be created before use.
- Query fields within the same object class cannot be mapped repeatedly; already mapped fields are hidden from the dropdown list.
Configuration¶
- Select the data source (Basic Objects / Resource Catalog).
- Select the object class.
- Configure the original query field and the target mapping field.
- Save.
For example: Mapping container_id to display as container_name.
In the dashboard, the view variable value will be displayed in the format container_name (container_id), but during queries, the value of container_id is still passed. Furthermore, if the field mapping feature is enabled in the chart settings, the chart's legend will display the mapped field value.
Manage Configuration¶
- Edit: Modify the correspondence between the original field and the mapped field. Changes take effect immediately upon saving.
- Delete: Remove the mapping relationship, and the front-end reverts to displaying the original field.
Use Cases¶
Object mapping can be applied in two scenarios:
Dropdown display in view variables
Applied to View Variables¶
Variable dropdown options are displayed in the format "Mapped Field (Original Field)". When selected, queries still use the original field value.
Example:
- Added a
container_idvariable in View Variables. - Set
container_idto map tocontainer_namein Object Mapping. - The variable in the view is now displayed as:
container_name(container_id).
Applied to Charts¶
Enable the Field Mapping feature in the chart's advanced settings. The chart legend and data will then display the mapped name.
Example:
- Set
hostto map tonamein Object Mapping. - Enable Field Mapping in Chart > Advanced Settings.
- The final display format in the chart is
name(host).
Note
- The mapping field must be an existing field within the object-class data; custom unrelated names are not allowed.
- Deleting a view variable that has been mapped does not automatically delete its mapping relationship; manual cleanup is required.
- When multiple dashboards share the same variable, the object mapping takes effect globally.