Skip to main content

Metric resources

Use the metric resources of the dictionary service to override default dictionary entries with your own definitions, create new entries for metrics not included in the default dictionary, and manage custom entries.

Resource list

Authentication

All Virtana Service Observability API endpoints require HTTPS, expect JSON in the request body when a body is required, and return a JSON response. You must have an authentication key to send requests to a Virtana Service Observability API endpoint. The key is sent in the zenoss-api-key header of each request.

All of the following API examples use curl to send a JSON request from a Bash shell to an endpoint. All examples use YOUR-API-ENDPOINT and YOUR-API-KEY as placeholders for endpoints and authentication keys.

POST/v1/dictionary/metrics

If the default dictionary includes an entry for the metric name specified in a create request, the custom entry becomes the effective entry. Subsequently, if the custom entry is deleted, the default entry becomes the effective entry.

Request template

 {
  "name": "<name>",
  "label": "<label>",
  "description": "<description>",
  "tags": [ "<tag>" ],
  "units": "<units>",
  "minimum": "<minimum>",
  "maximum": "<maximum>",
  "scaleFactor": "<factor>",
  "scaleFactorUnits": "<units>"
  "isRate": <boolean>
}

Request fields

Field

Type

Required

Description

name

String

Yes

The metric name.

label

String

No

A short name for a metric.

description

String

No

A longer, free-form statement about a metric.

tags

Array

No

A list of arbitrary terms to associate with a metric. The tags namespace is shared among all dictionary types. By convention, this field is used to record the source of an entry.

units

String

No

A label describing the data point units, used in the vertical axis label in graphs of the metric. For example, GB, IOIPs, Percent.

If scaleFactor is used, the units value should be the units that result from the conversion.

minimum

String

No

A guideline for the lowest possible value of data points in a graph: 0 for counters, 0 for percentages, and so on.

maximum

String

No

A guideline for the highest possible value of data points in a graph: 100 for percentages, and so on.

scaleFactor

String

No

The multiplier in data point conversions, which are only performed for displays like dashboards and Smart View. For example, 0.01.

scaleFactorUnits

String

No

The units received for a metric and the units to which data points are converted, separated by the hyphen and greater than characters (->). For example, centiseconds -> seconds.

isRate

Boolean

No

Define this metric as a rate metric, so it appears as a rate (value/time-since-last-value) throughout the system. Settings are enabled (true) or disabled (false). Default = false.

Status codes

Code

Description

200

Success. The request was processed. Check the response body for per-item results when processing multiple objects.

400

Bad request. The request body is missing, malformed, or contains invalid values.

409

Conflict. The request conflicts with the current state of the resource.

Example

Request example

 curl https://YOUR-API-ENDPOINT/v1/dictionary/metrics \
  -H "zenoss-api-key: YOUR-API-KEY" \
  -X POST -s \
  -d '{
  "name": "sysUpTime_sysUpTime",
  "label": "Custom Uptime"
}'

Response example

 {
  "name": "sysUpTime_sysUpTime",
  "layer": "YOUR-ORGANIZATION-NAME",
  "label": "Custom Uptime"
}
GET /v1/dictionary/metrics/{name} 

Get one metric entry.

Response fields

Field

Description

layer

DEFAULT for Virtana-defined entries or TENANT for entries defined by a user in your organization.

default

null for Virtana-defined entries or an object containing the default value of a Virtana-defined entry that has been overridden by a user in your organization.

Status codes

Code

Description

200

Success. The request was processed. Check the response body for per-item results when processing multiple objects.

400

Not found. The specified resource does not exist. No metric names requested.

Example

Request example

 curl https://YOUR-API-ENDPOINT/v1/dictionary/metrics/sysUpTime_sysUpTime \
  -H "zenoss-api-key: YOUR-API-KEY" \
  -X GET -s

Response example (default)

 {
  "name": "sysUpTime_sysUpTime",
  "label": "Uptime",
  "description": "The time (in hundredths of a second) ...",
  "units": "centiseconds",
  "minimum": "0",
  "isRate": false
}

Response example (custom)

 {
  "name": "sysUpTime_sysUpTime",
  "layer": "YOUR-ORGANIZATION-NAME",
  "description": "This has been overridden.",
  "isRate": false
}
POST /v1/dictionary/metrics:batchGet 

Get multiple metric entries. Specify the list of entries to get with the name field.

Response fields

Field

Description

layer

DEFAULT for Virtana-defined entries or TENANT for entries defined by a user in your organization.

default

null for Virtana-defined entries or an object containing the default value of a Virtana-defined entry that has been overridden by a user in your organization.

Status codes

Code

Description

200

Success. The request was processed. Check the response body for per-item results when processing multiple objects.

400

Bad request. The request body is missing, malformed, or contains invalid values.

Example

Request example

 curl https://YOUR-API-ENDPOINT/v1/dictionary/metrics:batchGet \
  -H "zenoss-api-key: YOUR-API-KEY" \
  -X POST -s \
  -d '{
  "name": ["sysUpTime_sysUpTime", "ifInOctets_ifInOctets"]
}'

Response example

 {
  "metrics": [
    {
      "name": "sysUpTime_sysUpTime",
      "label": "Uptime",
      "description": "The time (in hundredths of a second) since the network management portion of the system was last re-initialized.",
      "units": "centiseconds",
      "minimum": "0",
      "isRate": false
    },
    {
      "name": "ifInOctets_ifInOctets",
      "label": "Interface Bytes In",
      "description": "The total number of octets received on the interface, including framing characters.",
      "units": "count",
      "minimum": "0",
      "isRate": false
    }
  ]
}
GET /v1/dictionary/metrics 

Get all effective metric entries. This includes all default entries (except those you have overridden) and all entries you have created or overridden.

Response fields

Field

Description

layer

DEFAULT for Virtana-defined entries or TENANT for entries defined by a user in your organization.

default

null for Virtana-defined entries or an object containing the default value of a Virtana-defined entry that has been overridden by a user in your organization.

Status codes

Code

Description

200

Success. The request was processed. Check the response body for per-item results when processing multiple objects.

Example

Request example

 curl https://YOUR-API-ENDPOINT/v1/dictionary/metrics \
  -H "zenoss-api-key: YOUR-API-KEY" \
  -X GET -s

Response example (truncated)

 {
  "metrics": [
    {
      "name": "ActiveConnectionCount_ActiveConnectionCount",
      "label": "Active Connection Count",
      "description": "The total number of concurrent TCP connections active from clients to the load balancer and from the load balancer to targets.\n\nSource: AWS CloudWatch\nNamespace: AWS/ApplicationELB\nMetric: ActiveConnectionCount",
      "units": "connections",
      "minimum": "0",
      "isRate": false
    },
    {
      "name": "ActiveFlowCount_ActiveFlowCount",
      "label": "Active Flow Count",
      "description": "The total number of concurrent flows (or connections) from clients to targets. This metric includes connections in the SYN_SENT and ESTABLISHED states. TCP connections are not terminated at the load balancer, so a client opening a TCP connection to a target counts as a single flow.\n\nSource: AWS CloudWatch\nNamespace: AWS/NetworkELB\nMetric: ActiveFlowCount",
      "units": "flows",
      "minimum": "0",
      "isRate": false
    },
    {
      "name": "ActiveTransactions_ActiveTransactions",
      "label": "Active Transactions",
      "description": "Active Transactions",
      "units": "transactions",
      "minimum": "0",
      "isRate": false
    },
    .
    .
    .
  ],
  "totalCount": "1604"
}
PATCH /v1/dictionary/metrics/{name} 

Update an existing custom metric entry.

To override a default entry, create a new custom entry.

Request fields

Update requests use the same fields as create requests. The name field is required but cannot be changed.

Status codes

Code

Description

200

Success. The request was processed. Check the response body for per-item results when processing multiple objects.

404

Not found. The specified resource does not exist.

Example

Request example

 curl https://YOUR-API-ENDPOINT/v1/dictionary/metrics/sysUpTime_sysUpTime \
  -H "zenoss-api-key: YOUR-API-KEY" \
  -X PATCH -s \
  -d '{
  "name": "sysUpTime_sysUpTime",
  "label": "Updated Uptime"
}'

Response example

 {
  "name": "sysUpTime_sysUpTime",
  "layer": "YOUR-ORGANIZATION-NAME",
  "label": "Updated Uptime"
}
DELETE /v1/dictionary/metrics/{name} 

Delete a custom metric entry.

If a default entry exists for the specified name, the default entry becomes the effective entry.

Status codes

Code

Description

200

Success. The request was processed. Check the response body for per-item results when processing multiple objects.

404

Not found. The specified resource does not exist.

Example

Request example

 curl https://YOUR-API-ENDPOINT/v1/dictionary/metrics/sysUpTime_sysUpTime \
  -H "zenoss-api-key: YOUR-API-KEY" \
  -X DELETE -s

Response example

 {}