{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":48023,"path":"servicenow-platform/metricbase/set-up-data-monitoring.md","title":"Create a time-series definition in MetricBase","bundle":null,"doc_type":null,"release":"australia","body":"\n# Create a time-series definition in MetricBase\n\nSpecify the metric that you want to store, how often to collect it, and how long to store it in MetricBase.\n\n## Before you begin\n\n-   [Install MetricBase](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/metricbase/request-metricbase.md)\n-   Role required: clotho\\_admin\n\n## Procedure\n\n1.  Navigate to **MetricBase** &gt; **Time Series Metrics**.\n\n2.  Select **New**.\n\n3.  On the form, fill in the fields.\n\n<table id=\"table_ayv_rrh_bhb\"><thead><tr><th>\n\nField\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nLabel\n\n</td><td>\n\nIntuitive name for the **Metric field name**. For example, altitude could be the label for the metric field name, mb-altitude.\n\n</td></tr><tr><td>\n\nTable name\n\n</td><td>\n\nName of the table to add the metric to in the MetricBase database. For example, in the MetricBase Demo, the mb\\_drone table stores the drone data. Each column in the table is a different metric, for example, altitude, length, and speed.\n\n</td></tr><tr><td>\n\nMetric field name\n\n</td><td>\n\nName of the time-series metric that records. For example, mb-altitude. You can think of it as the name of a column in the MetricBase database table.\n\n</td></tr><tr><td>\n\nRetention policy\n\n</td><td>\n\nSampling frequency and how long MetricBase keeps the values in the database. You cannot customize the value. For a definition of the values, click the magnifying glass and then a policy. The coarser the sampling rate, the less data that stores. Use the coarsest sampling rate that works for your dataset. For example, do not collect data every minute if collecting it once an hour suffices. See [MetricBase retention policies](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/metricbase/metricbase-retention-policies.md) for a description of the policies you can select.\n\n</td></tr><tr><td>\n\nRetention policy aggregator\n\n</td><td>\n\nOperator that aggregates the data in a sampling period. For example, last, minimum, maximum, and average.\n\n</td></tr><tr><td>\n\nDisplay value aggregator\n\n</td><td>\n\nThe aggregation method in use when using `<table-name>.list` where &lt;table-name&gt; is a table in the MetricBase database. This value is unrelated to the retention policy. For a definition of the options, see [MetricBase transforms](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/now-intelligence/metricbase-transforms.md).\n\n</td></tr><tr><td>\n\nDisplay value aggregate duration\n\n</td><td>\n\nDuration that is used to calculate the aggregation only when using the list view. For example, `<table-name>.list` where &lt;table-name&gt; is a table in the MetricBase database. This value is unrelated to the retention policy.\n\n</td></tr><tr><td>\n\nSubject field\n\n</td><td>\n\nYou can select a unique table column as your subject for the metric. The unique column must be designated on the table before you select it. For example, if your metric tracks temperatures in different houses, you can make the house address column the subject of your metric. The house address column on your table must be unique before you set the subject field.**Note:** The sys\\_id column is the default unique column.\n\n</td></tr><tr><td>\n\nData Type\n\n</td><td>\n\nYou can specify the data type of the subject field.\n\n</td></tr></tbody>\n</table>4.  Select **Submit**.\n\n\n## Result\n\nYou've created a time-series specification for a metric that you want to track.\n\n## What to do next\n\nSample the data according to the time-series specification and send it from an instance to the MetricBase database server.\n\nUse the REST or JavaScript APIs to send the data to the MetricBase database at the rate that is prescribed by the time-series definition. See [Developer resources](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/servicenow-platform/metricbase/developer-resources.md).\n\n**Important:** Send the data at the rate that the time-series definition prescribes. If you send the data at a different rate or for a different duration, you receive an error. Make sure to aggregate the data according to the time-series metric definition. Also, the MetricBase database only stores values of data type float.\n\n"}}