GET /v1/metrics/:name

API VERSION 1.0

Description

Returns information for a specific metric. If time interval search parameters are specified will also include a set of metric measurements for the given time span.

URL

https://metrics-api.librato.com/v1/metrics/:name

Method

GET

Measurement Search Parameters

If optional time interval search parameters are specified, the response includes the set of metric measurements covered by the time interval. Measurements are listed by their originating source name if one was specified when the measurement was created. All measurements that were created without an explicit source name are listed with the source name unassigned.

source

Deprecated: Use sources with a single source name, e.g [mysource].

sources

If sources is specified, the response is limited to measurements from those sources. The sources parameter should be specified as an array of source names. The response is limited to the set of sources specified in the array.

source_tag

If source is specified, the response is limited to measurements from sources tagged with source_tag.

summarize_time

If summarize_time is specified, then the individual measurements over the covered time period will be aggregated into a single summarized record for each source. In this case, the measurements array for each source will contain a single summarized record.

The measure_time in each of the summarized measurements will be set to the first measure_time in the period covered by the time interval search parameters. An additional field rollups will be set to the number of individual measurement records summarized in the single response measurement.

If the metric is a counter, then the summarized record will be a gauge that represents the summarization of the deltas of the counter values for each source.

summarize_sources

If summarize_sources is specified, a source name all is included in the list of measurements. This special source name will include all measurements summarized across all the sources for each point in time. For each unique point in time within the covered time interval search, there will be a single record in the all measurements list.

If multiple sources published a measurement at the same time, the record in the all list will be a summarized record of all the individual source measurements at that point in time. If combined with the summarize_time parameter, then the all list will be summarized across sources and across time, implying it will be a list with a single record.

If the metric is a counter, then the summarized record will be a gauge that represents the summarization of the deltas of the counter values for each source.

Examples

Return the metric named cpu_temp with up to four measurements at resolution 60.

curl \
  -u <user>:<token> \
  -X GET \
  https://metrics-api.librato.com/v1/metrics/cpu_temp?count=4&resolution=60

Response Code

200 OK

Response Headers

** NOT APPLICABLE **

Response Body

{
  "resolution": 60,
  "measurements": {
    "server1.acme.com": [
      {
        "measure_time": 1234567890,
        "value": 84.5,
        "count": 1
      },
      {
        "measure_time": 1234567950,
        "value": 86.7,
        "count": 1
      },
      {
        "measure_time": 1234568010,
        "value": 84.6,
        "count": 1
      },
      {
        "measure_time": 1234568070,
        "value": 89.7,
        "count": 1
      }
    ]
  },
  "name": "cpu_temp",
  "display_name": "cpu_temp",
  "description": "Current CPU temperature in Fahrenheit",
  "period": 60,
  "type": "gauge",
  "attributes": {
    "created_by_ua": "librato-metrics/0.7.4 (ruby; 1.9.3p194; x86_64-linux) direct-faraday/0.8.4",
    "display_max": null,
    "display_min": 0,
    "display_stacked": true,
    "display_transform": null,
    "display_units_long": "Fahrenheit",
    "display_units_short": "&#176;F"
  }
}