REST API

QRebel is equipped with a public API, allowing users to receive raw data for analysis and storage.


REST API authentication

Every QRebel project has a unique API token for authentication. This token is required for all API calls.

To acquire the project’s API token, an administrator needs to enable API functionality for the project from the Settings section. Once an API token has been generated for a project, you can choose to regenerate the token or disable API for the project.

Token is passed using the standard Authorization HTTP header.

GET https://hub.qrebel.com/api/applications/{appName}/issues/?targetBuild=dfha89df
Authorization: {API token}

Queries

Note

API queries support only user-defined or custom build names.

Here is an example of a complete API query: GET https://hub.qrebel.com/api/applications/{appName}/issues/?targetBuild=dfha89df&baselineVersion=1.0-SNAPSHOT&issues=DURATION,IO,EXCEPTIONS

The elements used in this query include:

  • https://hub.qrebel.com/api/applications/{appName}/issues/ – QRebel URL with the application title.
  • targetBuild={build} – target build for the query.
  • targetVersion={version} – target version for the query (NB! targetBuild and targetVersion cannot be used in the same query).
  • baselineBuild={build} – baseline build for the comparison. When none is specified, the comparison is performed against the static threshold.
  • baselineVersion={version} – baseline version for the comparison. (NB! baselineBuild and baselineVersion cannot be used in the same query).
  • issues=DURATION,IO,EXCEPTIONS – types of issues for the query. When none specified, all issue types are returned by default.
  • DURATION – returns slow request issues.
  • IO – returns excessive IO issues.
  • EXCEPTIONS – returns exception type issues.

Default baseline

You can define the default baseline build or version to be used for comparison. To set a default baseline version, use the following API call:

PUT https://hub.qrebel.com/api/applications/{appName}/baselines/default/
JSON Payload:
{ "version": "1.0-SNAPSHOT" }
or
{ "build": "jfhaisd76" }

A good candidate for the default baseline is the last build or version deployed to production.

To compare to the default baseline, use the defaultBaseline query parameter:

GET https://hub.qrebel.com/api/applications/{appName}/issues/?targetBuild=dfha89df&defaultBaseline

Query examples

Complete query example:

GET https://hub.qrebel.com/api/applications/{appName}/issues/?targetBuild=dfha89df&baselineVersion=1.0-SNAPSHOT&issues=IO,DURATION,EXCEPTIONS

Version versus static threshold with all issue types (two equivalents):

GET https://hub.qrebel.com/api/applications/{appName}/issues/?targetBuild=dfha89df
GET https://hub.qrebel.com/api/applications/{appName}/issues/?targetBuild=dfha89df&baselineBuild=dfha89df

Exceptions only:

GET https://hub.qrebel.com/api/applications/{appName}/issues/?targetBuild=dfha89df&baselineBuild=jfhaisd76&issues=EXCEPTIONS

Default builds or versions:

GET https://hub.qrebel.com/api/applications/{appName}/issues/?targetBuild=dfha89df&defaultBaseline

Query response example

This is an example of the REST API query JSON response (quotes omitted for brevity).

{
    appName: string,
    target: string
    baseline: string
    issuesCount: {
        duration: number,
        io: number,
        exceptions: number
    },
    entryPoints: [
        {
            hits: number,
            name: string,
            duration: {
                slowestPercentile: number,
                averageIncrease: decimal,
                scopePercentage: number
            },
            io: {
                highestPercentile: number,
                averageIncrease: decimal,
                scopePercentage: number
            },
            exceptions: [
                exception: {
                    name: string,
                    count: number
                }
            ]
        }
    ],
    appViewUrl: string
}