The Performance Metrics API

The Performance Metrics API allows you to access current response times and failure rates for projects, services, and individual transactions.

Fetching Project Performance Metrics

Requirements: You need an API access token with the metrics scope for this endpoint.

You can access data for your project through the URL scheme.

https://app.tideways.io/apps/api/{organization}/{app}/performance

Example:

curl -H 'Authorization: Bearer <token>' \
     -X GET \
     https://app.tideways.io/apps/api/foo/bar/performance

Response:

{
  "application": {
    "by_time": [
      "2017-07-31 12:41": {
        "requests": 144,
        "errors": 0,
        "percentile_95p": 211,
        "median": 20,
        "average": 20,
        "downstream": {
          "al": {
            "average": 8
          },
          "cache": {
            "average": 0
          },
          "io": {
            "average": 0
          },
          "sql": {
            "average": 9
          }
        }
      },
      "2017-07-31 12:42": {
        "requests": 46,
        "errors": 0,
        "percentile_95p": 253,
        "median": 20,
        "average": 20,
        "downstream": {
          "al": {
            "average": 5
          },
          "cache": {
            "average": 0
          },
          "io": {
            "average": 0
          },
          "sql": {
            "average": 0
          }
        }
      }
    ],
    "by_transactions": [
      {
        "name": "bar",
        "requests": 2676,
        "response_time_average": 39,
        "response_time_worst": 2165,
        "response_time_slowest": 2265,
        "response_time": 2165,
        "memory": 11238,
        "href": "https://app.tideways.io/apps/api/foo/bar/transaction/123?env=production&s=web"
      },
      {
        "name": "foo",
        "requests": 2,
        "response_time_average": 28,
        "response_time_worst": 40,
        "response_time_slowest": 80,
        "response_time": 40,
        "memory": 4028,
        "href": "https://app.tideways.io/apps/api/foo/bar/transaction/422?env=production&s=web"
      }
    ],
    "criteria": {
      "start": "2017-07-31 12:41",
      "end": "2017-07-31 13:41",
      "service": "web",
      "environment": "production"
    },
    "total": {
      "error_rate": 0,
      "requests": 3786,
      "response_time": 258,
      "average": 82,
      "median": 20,
      "downstream": {
        "al": {
          "average": 8
        },
        "cache": {
          "average": 0
        },
        "io": {
          "average": 0
        },
        "sql": {
          "average": 9
        },
        "ct": {
          "average": 2
        },
        "http": {
          "average": 19
        },
        "redis": {
          "average": 0
        }
      }
    }
  }
}

Parameters

You can pass a number of query parameters to this API endpoint:

  • ts the end time of the last minute to include in the query as format Y-m-d H:i

  • env represents the name of an environment, for example the default production

  • m is the number of minutes to access performance data for backwards from the ts

  • s represents the name of a service, for example the default web.

Fetching Project Summary/Overview Metrics

Requirements: You need an API access token with the  metrics scope for this endpoint.

The source for the summary/overview and time-selector chart can be accessed through this summary API:

https://app.tideways.io/apps/api/{organization}/{app}/summary

Example Response

{
  "summary": {
    "by_time": [
      "2017-07-31 12:00": {
        "errors": 0,
        "percentile_95p": 245,
        "requests": 997
      },
      "2017-07-31 12:15": {
        "errors": 0,
        "percentile_95p": 233,
        "requests": 986
      },
      "2017-07-31 12:30": {
        "errors": 0,
        "percentile_95p": 230,
        "requests": 983
      },
      "2017-07-31 12:45": {
        "errors": 0,
        "percentile_95p": 233,
        "requests": 992
      },
      "2017-07-31 13:00": {
        "errors": 0,
        "percentile_95p": 335,
        "requests": 864
      },
      "2017-07-31 13:15": {
        "errors": 0,
        "percentile_95p": 325,
        "requests": 987
      }
    ]
    "criteria": {
      "service": "web"
    }
  }
}

The summary data is returned in 15 minute steps, where a key of `2017-07-31 12:00 ` means the performance in the time from 12:00:00 until 12:14:59. At the moment we don’t give a guarantee on how long it takes between the interval being over and the calculated value being available, it might take several minutes.

Parameters:

You can pass a number of query parameters to this API endpoint:

  • s represents the name of a service, for example the default web.

Still need help? Email [email protected]