--- title: "Simple Metrics" slug: "simple-metrics" updated: 2026-02-03T14:14:15Z published: 2026-02-03T14:14:15Z canonical: "learn.servitly.com/simple-metrics" --- > ## Documentation Index > Fetch the complete documentation index at: https://learn.servitly.com/llms.txt > Use this file to discover all available pages before exploring further. # Simple Metrics Simple metrics are used to receive and store RAW data published by products, machines, or sensors remotely connected to your application. Simple metrics are used to store simple data, like measures and logical variables. # Creating a Simple metric To add a new *Simple Metric* to a *Thing Definition*, you should: 1. Enter the *RAW Data* page. 2. Select the *Thing Definitions* tab. 3. Select the *Thing Definition* to edit. 4. Press the *Add Metric* button. 5. Select the *Simple Metric* type and provide the required information. 6. Press the Save button and edit the additional information, if needed. ![](https://cdn.document360.io/6759e9c9-3ce3-49df-965a-7231d2d9a10a/Images/Documentation/image(75).png) # Editing a Simple metric Once a *Simple Metric* has been saved, you can configure more information on it. ![](https://cdn.document360.io/6759e9c9-3ce3-49df-965a-7231d2d9a10a/Images/Documentation/image(76).png) A *Simple Metric* is described by: ## General - **Label**: The metric label shown within the widget. - **Name**: The name of the metric, also used to reference it within the dashboards' templates. - **Description**: The text describing the metric. The description is displayed as a tooltip within the dashboard widgets. - **Unit**: The unit of measurement (e.g., kg, °C, pieces, liters, etc.) - **Value Type**: The type of the value, one of *Boolean, Double, Float, Integer, Long, or String.* > Pay attention to select the right type, if not, metric values may not be stored correctly. - **Group**: The group the metric belongs to (e.g., Temperatures, System). - **Metric Sets**: The list of [Metric Sets](/v1/docs/metric-sets) in which this metric is included. Note that, to comply with the [EU Data Act](/v1/docs/data-act-template), all Simple metrics, when created, are automatically included in the predefined [Raw Data](/v1/docs/metric-sets#raw-data-metric-set) metric set. - **Privatizable by customer**: Allow the customer to define whether the metric is private or not. For more details, refer to this [Privatizable date](/docs/privatizable-data) article. ## Mapping The mapping section of a metric you can configure: - **Path**: the path used to dispatch the incoming messages according to the underlying connection protocol, for instance, in the case of MQTT, this is the last part of the message topic. - **Name**: the name of the property to be extracted from the incoming message payload. - **Value Encoding**: the way the value is encoded within the payload (Literal, Binary HEX/INT). For more details, see the article [Encoding Values](/docs/encoding-values). - **Value Transformer**: the transformer to be applied to the decoded value before being saved in the data storage. For more details, see the article [Transforming Values](/docs/transforming-values). ## Initial value In a Simple metric, you can configure the value to be assigned to the metric when the thing is created or activated for the first time. The value is registered by using the creation/activation timestamp. ## Data In case of numeric metrics, the Data Type allows you to define whether the metric values are *DISCRETE* or *CONTINUOUS*, and then you can also define the [Dictionary and Thresholds](/docs/dictionary-and-thresholds-1). ## Range In case the metric is of type numeric, in this section, you can specify the minimum and maximum values the metric can assume. Minimum and maximum values can also be dynamically redefined by specifying a property or a metric for them. ## Discarding invalid values Suppose a thing produces data points with a frequency higher than the real need (e.g. ambient temperature sensor), unnecessary data points will be generated with the effect to consume DPH for [Data Points Processing](/docs/dph-computation). You can define whether to discard consecutive equal values received by the IoT Connector. ![](https://help.servitly.com/hc/article_attachments/15656501888540) With this approach, the granularity of the data will be lowered, and therefore, the current data (if missing) is to be considered equal to the previous data. In a time-series-chart widget, a STEP visualization is recommended in order to highlight changes in the series of data. Out-of-range data points can be discarded, avoiding unexpected behaviors, like alerts and rules triggering or wrong widget visualization (e.g., spikes on Time Series widget). ![](https://help.servitly.com/hc/article_attachments/11346938972828) Note that only constant values are used to validate the incoming metric values. In case you are using a dynamic range, remember to specify a static range that at least contains the dynamic one. ## Import/Export Metric Definitions If you have many metrics to define, you can click on the *Import* button and select a CSV file containing all the information about the metrics you want to create. In case a metric is already present (matching by name), it is updated with the new definition. It is also possible to export all defined metrics; clicking the *Export* button will generate a CSV file. ![](https://cdn.document360.io/6759e9c9-3ce3-49df-965a-7231d2d9a10a/Images/Documentation/image(777).png) The CSV file must have the following header: ```excel Name,Label,Description,Group,Value Type,Unit,Initial Value,Mapping Path,Mapping Name,Encoding,Binary Position,Binary Length,Binary Byte Order,Value Transformer,Min,Max,Privatizable,Consecutive Equal Values Discarded,Countable Type,Dictionary,Ranges ``` Here are described the various columns to provide in the CSV: - *Name*: the name of the metric. It should contain only A-Z characters, numbers, and ‘_’. - *Label*: the metric displayed label. - *Description*: the metric description - *Group*: the metric group. - *Value Type:* the type of the stored value. - *Unit*: the unit of measurement (e.g., kg). - *Initial Value*: the initial value to store under the metric when the thing is created (`STRING`, `BOOLEAN`, `INTEGER`, `LONG`, `FLOAT`, `DOUBLE`). - *Mapping Path*: the mapping path (default `data`). - *Mapping Name*: the mapping name (default is the name). - *Encoding*: how values are encoded in the incoming messages (`LITERAL`, `BINARY_INT`, `BINARY_HEX`). - *Binary Position*: the position of the first bit to read (BINARY encoding only). - *Binary Length*: the number of bits to read (BINARY encoding only). - *Binary Byte Order*: the byte orders (`BIG_ENDIAN`, `LITTLE_ENDIAN`) (BINARY encoding only). - *Value Transformer*: the name of the [data transformer](/docs/transforming-values). - *Min*: the minimum value (numeric metrics only). - *Max*: the maximum value (numeric metrics only). - *Privatizable:* `true` if the metric can be privatized, else `false`. - *Consecutive Equal Values Discarded*: `true` to avoid duplicated value, else `false`. - *Countable Type*: how to handle numeric values (`CONTINUOUS`, `DISCRETE`). - *Dictionary*: the dictionary definition (DISCRETE countable type). `<THESHOLD_VALUE>:<LABEL>:<SEVERITY>:<ICON>|<THESHOLD_VALUE>…` The severity could be one of: `NORMAL`, `WARNING`, `CRITICAL`, `NEUTRAL`. - *Ranges:* the definition of the numeric thresholds (CONTINUOUS countable type). `<THESHOLD_VALUE>:<LABEL>:<SEVERITY>:<ICON>|<THESHOLD_VALUE>…` The severity could be one of: `NORMAL`, `WARNING`, `CRITICAL`, `NEUTRAL`.