This page provides detailed information about the Metrics API, which allows developers to retrieve and analyze data on various aspects of the application.

Overview

The Metrics API provides a comprehensive set of endpoints to access and manipulate metrics data. Metrics are quantitative measures that can be used to monitor the performance and health of an application.

Endpoints

Here are some of the key endpoints available in the Metrics API:

  • /metrics: Retrieve a list of available metrics.
  • /metrics/<metric_name>: Retrieve detailed information about a specific metric.
  • /metrics/<metric_name>/timeseries: Retrieve time-series data for a specific metric.

Usage Example

To retrieve a list of available metrics, you can make a GET request to /metrics.

{
  "metrics": [
    "requests",
    "errors",
    "latency",
    "memory_usage"
  ]
}

Time-Series Data

To retrieve time-series data for a specific metric, you can make a GET request to /metrics/<metric_name>/timeseries. You can specify the time range using the start and end parameters.

{
  "data": {
    "start": "2023-01-01T00:00:00Z",
    "end": "2023-01-02T00:00:00Z",
    "values": [
      {
        "timestamp": "2023-01-01T01:00:00Z",
        "value": 100
      },
      {
        "timestamp": "2023-01-01T02:00:00Z",
        "value": 150
      }
    ]
  }
}

Further Reading

For more information on the Metrics API, please refer to the official documentation.

Metrics API