{"id":3401,"date":"2021-03-07T23:26:02","date_gmt":"2021-03-07T23:26:02","guid":{"rendered":"https:\/\/wiki.thomasandsofia.com\/?p=3401"},"modified":"2021-03-08T00:56:27","modified_gmt":"2021-03-08T00:56:27","slug":"metric-dictionary","status":"publish","type":"post","link":"https:\/\/wiki.thomasandsofia.com\/?p=3401","title":{"rendered":"Metric Dictionary"},"content":{"rendered":"<p>Admin &gt; Metric Dictionary<\/p>\n<h1>Review:<\/h1>\n<ul>\n<li>Entities are anything that can provide or generate metrics.<\/li>\n<li>Models are how you define\/describe those entities\n<ul>\n<li>Models only need to be sent once, unless something changes.<\/li>\n<li>If you change the dimensions, you have now created a new entity.<\/li>\n<li>Always a good idea to include a <code>name<\/code> field in the metadataFields<\/li>\n<\/ul>\n<\/li>\n<li>Source field groups entities and metrics together in dashboards.\n<ul>\n<li>When a dashboard is created, you select one or more sources.<\/li>\n<li>Entities that match those sources become the scope for that dashboard.<\/li>\n<li>Only metrics belonging to entities within a dashboard&#8217;s scope are displayed by that dashboard&#8217;s tiles.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h1>Metrics Dictionary<\/h1>\n<p>The Zenoss Cloud metric dictionary contains supplemental information about metrics published through the API and by Collection Zones.<\/p>\n<p>Zenoss cloud uses the metric dictionary for the following features:<\/p>\n<ul>\n<li>Must have <strong>Manager<\/strong> role\/permissions to edit the dictionary<\/li>\n<li>Provide a display name or description for a metric\n<ul>\n<li>Example: display the name Uptime for metric name <code>uptime_sysUpTime<\/code><\/li>\n<\/ul>\n<\/li>\n<li>Normalize the display of data points in graphs\n<ul>\n<li>Example: if the data points of a metric are collected and stored as milliseconds, convert their value into seconds before displaying them in graphs.<\/li>\n<\/ul>\n<\/li>\n<li>Provide a label for the Y-axis of a metric&#8217;s graph\n<ul>\n<li>Example: GB, IOPS or Percent.<\/li>\n<\/ul>\n<\/li>\n<li>Create guidelines for the minimum and maximum values of a metric&#8217;s graph\n<ul>\n<li>If a data points fall outside of the minimum or maximum values you define, the metric&#8217;s graph is automatically adjusted; data points are never discarded.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>The Metric Dictionary does NOT modify the actual data.\u00a0 It only configures the way they are displayed.<\/p>\n<h2>Default Metric Dictionary<\/h2>\n<ul>\n<li>Zenoss Cloud includes default definitions for most of the metrics created by Zenoss<\/li>\n<li>You can override Zenoss default definitions and add definitions for metrics you create<\/li>\n<li>Any changes to the metric dictionary made by your organization are only visible in your Zenoss Cloud instance (tenant)<\/li>\n<li>Overriding a Zenoss default definition does NOT delete it or modify it.\u00a0 The Zenoss definition remains but the custom definition takes precedence and will be used in place of the default definition.<\/li>\n<li>Deleting Definitions\n<ul>\n<li>If you delete a custom definition, the default will be restored.<\/li>\n<li>If you delete a custom definition where there is no default, it will be completely removed.<\/li>\n<li>You cannot delete Zenoss metric definitions.\u00a0 You can only override them.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2>Example Definition<\/h2>\n<p><strong>Zenoss Defined<\/strong><\/p>\n<pre>\"name\": \"sysUpTime_sysUpTime\",\r\n\"label\": \"Uptime\",\r\n\"description\": \"The time the system has been running.\",\r\n\"units\": \"centiseconds\",\r\n\"minimum\": \"0\"<\/pre>\n<p><strong>Example override<\/strong><\/p>\n<pre>\"name\": \"sysUpTime_sysUpTime\",\r\n\"label\": \"System Uptime\",\r\n\"description\": \"The time the system has been running.\",\r\n\"units\": \"centiseconds\",\r\n\"minimum\": \"0\"<\/pre>\n<p>&nbsp;<\/p>\n<h2>Field Definitions<\/h2>\n<ul>\n<li>Metric Name: Must exactly match the metric name called used in the JSON <code>\"metric\": \"your-metric-name-here\"<\/code><\/li>\n<li>Layer: TENANT or does not exist.\n<ul>\n<li>Only returned as a field from the API.\u00a0 You cannot send this.<\/li>\n<li>If is included, will be TENANT which signifies the dictionary entry is custom or overridden.<\/li>\n<\/ul>\n<\/li>\n<li>Label: Friendly name<\/li>\n<li>Description: User-defined.<\/li>\n<li>Units: Select from drop down (not working?) &#8211; This will be displayed as the Y-Axis label<\/li>\n<li>Conversion: Select a pre-defined conversion, such as convert bits to megabytes.<\/li>\n<li>Scale Factor: A floating point multiplier, similar to Conversion but user-defined.<\/li>\n<li>Minimum and Maximum value:\u00a0 Defines the default range to display on the graph (vs auto scale).\n<ul>\n<li>If the value of the metric falls outside of these ranges the actual values will be used as limits.<\/li>\n<li>At no time will a metric fall outside of the displayed range, regardless of the range set using these values.<\/li>\n<\/ul>\n<\/li>\n<li>Tags: Add tags as desired.\u00a0 Currently only used in Smart View.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2>Filter Metric Dictionary definitions<\/h2>\n<p><a href=\"https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2021\/03\/dict-filter.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3404\" src=\"https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2021\/03\/dict-filter.png\" alt=\"\" width=\"489\" height=\"254\" srcset=\"https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2021\/03\/dict-filter.png 489w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2021\/03\/dict-filter-300x156.png 300w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2021\/03\/dict-filter-150x78.png 150w\" sizes=\"auto, (max-width: 489px) 100vw, 489px\" \/><\/a><\/p>\n<ul>\n<li>No filter: Display all definitions<\/li>\n<li>Zenoss default dictionary: Display all default definitions only<\/li>\n<li>Overridden: Only display definitions that have been custom defined.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2>Metric Dictionary Shortcut<\/h2>\n<ul>\n<li>You can quickly access a metric&#8217;s definition by clicking the options menu icon on a graph.<\/li>\n<\/ul>\n<p><a href=\"https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2021\/03\/dict-graph-shortcut.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3406\" src=\"https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2021\/03\/dict-graph-shortcut.png\" alt=\"\" width=\"662\" height=\"214\" srcset=\"https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2021\/03\/dict-graph-shortcut.png 662w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2021\/03\/dict-graph-shortcut-300x97.png 300w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2021\/03\/dict-graph-shortcut-150x48.png 150w\" sizes=\"auto, (max-width: 662px) 100vw, 662px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<h1>Metrics Dictionary API Methods<\/h1>\n<p><a href=\"https:\/\/help.zenoss.com\/dev\/zenoss-api\/using-the-dictionary-features-of-the-zenoss-api\" target=\"_blank\" rel=\"noopener\">https:\/\/help.zenoss.com\/dev\/zenoss-api\/using-the-dictionary-features-of-the-zenoss-api<\/a><\/p>\n<ul>\n<li>BatchGetMetrics\n<ul>\n<li>Returns the definitions of the specified metrics<\/li>\n<li><code>POST \/v1\/dictionary\/metrics:batchGet<\/code><\/li>\n<\/ul>\n<\/li>\n<li>CreateMetric\n<ul>\n<li>Create a custom metric definition<\/li>\n<li><code>POST \/v1\/dictionary\/metrics<\/code><\/li>\n<\/ul>\n<\/li>\n<li>DeleteMetric\n<ul>\n<li>Delete a custom metric definition<\/li>\n<li><code>DELETE \/v1\/dictionary\/metrics\/METRIC-NAME<\/code><\/li>\n<\/ul>\n<\/li>\n<li>GetMetric\n<ul>\n<li>Return the definition for the metric named in the URL<\/li>\n<li><code>GET \/v1\/dictionary\/metrics\/METRIC-NAME<\/code><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<pre>$ curl -s -S https:\/\/api.zenoss.io\/v1\/dictionary\/metrics\/troberts.random.percentage -H \"Content-type: application\/json\" -H \"zenoss-api-key: $(cat ~\/.zenoss.key)\" -X GET\r\n{\"name\":\"troberts.random.percentage\",\"layer\":\"TENANT\",\"label\":\"Random Percentage\",\"units\":\"Percent\",\"minimum\":\"-30\",\"maximum\":\"130\"}<\/pre>\n<ul>\n<li>ListMetrics\n<ul>\n<li>Returns all metic dictionary definitions<\/li>\n<li><code>GET \/v1\/dictionary\/metrics<\/code><\/li>\n<\/ul>\n<\/li>\n<li>UpdateMetric\n<ul>\n<li>Update an existing custom metric definition<\/li>\n<li>To override fields in a default dictionary definition, use CreateMetric<\/li>\n<li>UpdateMetric replaces the entire custom metric definition\n<ul>\n<li>Any fields not included in the JSON request will be empty in the new definition<\/li>\n<li>Might be a good idea to get the data before using this<\/li>\n<\/ul>\n<\/li>\n<li><code>PATCH \/v1\/dictionary\/metrics\/METRIC-NAME<\/code><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2>Metric Dictionary API Fields<\/h2>\n<table>\n<tbody>\n<tr>\n<th>Field Name<\/th>\n<th>JSON Type<\/th>\n<th>Description<\/th>\n<\/tr>\n<tr>\n<td>name<\/td>\n<td>String<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>label<\/td>\n<td>String<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>description<\/td>\n<td>String<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>units<\/td>\n<td>String<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>scaleFactorUnits<\/td>\n<td>String<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>scaleFactor<\/td>\n<td>Number<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>minimum<\/td>\n<td>String*<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>maximum<\/td>\n<td>String*<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>tags<\/td>\n<td>Array of Strings<\/td>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>* Must represent a numeric value<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Admin &gt; Metric Dictionary Review: Entities are anything that can provide or generate metrics. Models are how you define\/describe those entities Models only need to be sent once, unless something changes. If you change the dimensions, you have now created a new entity. Always a good idea to include a name field in the metadataFields ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/wiki.thomasandsofia.com\/?p=3401\" title=\"read more...\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[64,59],"tags":[],"class_list":["post-3401","post","type-post","status-publish","format-standard","hentry","category-streaming-data","category-zenoss"],"_links":{"self":[{"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/posts\/3401","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3401"}],"version-history":[{"count":6,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/posts\/3401\/revisions"}],"predecessor-version":[{"id":3409,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/posts\/3401\/revisions\/3409"}],"wp:attachment":[{"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3401"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3401"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3401"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}