Metrics resource (Data API 21.10)

Summary

Http Method Resource Description
GET /metrics/{apitype} The metrics resource provides insights into runtimes of individual OCAPI requests against the shop or the data-API. Responses of the metrics resource are JSON wrapped metrics in Prometheus Exposition format. For each OCAPI resource, following metrics are available for the given dimension and the current time-frame (1-minute averages).
  • average time of a request (p50 and p95 timings are available under the quantile dimension) in milliseconds
  • minimum time of all requests in milliseconds
  • maximum time of all requests in milliseconds
  • m1-rate, or the one-minute-rate of requests in operations / second
Refer to the documentation of the response document for a detailed description of the metrics and dimensions exposed by this API.

API metrics

The metrics resource provides insights into runtimes of individual OCAPI requests against the shop or the data-API. Responses of the metrics resource are JSON wrapped metrics in Prometheus Exposition format. For each OCAPI resource, following metrics are available for the given dimension and the current time-frame (1-minute averages). Refer to the documentation of the response document for a detailed description of the metrics and dimensions exposed by this API.

Url

GET https://hostname:port/dw/data/v21_10/metrics/{apitype}?offset={Integer}&limit={Integer}

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Response Document

MetricResponse

Path Parameters

Parameter Type Description Constraints
apitype String Type of the api. Values are data or shop. mandatory=true, minLength=1, nullable=false, strings=["data", "shop"]

Query Parameters

Parameter Type Description Constraints
limit Integer Optional limit of the result set not counting commentaries or empty lines. maxIntegerValue=4500, minIntegerValue=1
offset Integer Optional offset of the result set not counting commentaries or empty lines. minIntegerValue=0

In case of a failure Fault Document is returned.

Faults

Status Type Arguments Description
400 TooManyRequestsException   Too many requests.
403 FeatureNotEnabledException

featureName (String)

Feature not enabled.

Sample

REQUEST:

GET /s/-/dw/data/v21_10/metrics/data HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367

# in case of success:
RESPONSE:
HTTP/1.1 200 OK
Expires: Thu, 01-Jan-1970 00:00:00 GMT
{
  "_v": "21.10",
  "_type": "metric_response",
  "limit": 4500,
  "metrics": [
    "# Type products_Id_prices summary",
    "products_Id_prices{method=\"GET\",version=\"v16.9\",path1=\"products\",path2=\"prices\",breakdown=\"custom\",status=\"2xx\"} 4.036 1620735785000",
    "products_Id_prices{method=\"GET\",version=\"v16.9\",path1=\"products\",path2=\"prices\",breakdown=\"custom\",status=\"2xx\",quantile=\"p50\"} 4.036 1620735785000",
    "products_Id_prices{method=\"GET\",version=\"v16.9\",path1=\"products\",path2=\"prices\",breakdown=\"custom\",status=\"2xx\",quantile=\"p95\"} 4.036 1620735785000",
    "products_Id_prices_m1rate{method=\"GET\",version=\"v16.9\",path1=\"products\",path2=\"prices\",breakdown=\"custom\",status=\"2xx\"} 0.04850421492712977 1620735785000",
    "products_Id_prices_min{method=\"GET\",version=\"v16.9\",path1=\"products\",path2=\"prices\",breakdown=\"custom\",status=\"2xx\"} 4.036 1620735785000",
    "products_Id_prices_max{method=\"GET\",version=\"v16.9\",path1=\"products\",path2=\"prices\",breakdown=\"custom\",status=\"2xx\"} 4.036 1620735785000",
    "",
    "products_Id_prices{method=\"GET\",version=\"v16.9\",path1=\"products\",path2=\"prices\",breakdown=\"platform\",status=\"2xx\"} 108.682755 1620735785000",
    "products_Id_prices{method=\"GET\",version=\"v16.9\",path1=\"products\",path2=\"prices\",breakdown=\"platform\",status=\"2xx\",quantile=\"p50\"} 108.682755 1620735785000",
    "products_Id_prices{method=\"GET\",version=\"v16.9\",path1=\"products\",path2=\"prices\",breakdown=\"platform\",status=\"2xx\",quantile=\"p95\"} 108.682755 1620735785000",
    "products_Id_prices_m1rate{method=\"GET\",version=\"v16.9\",path1=\"products\",path2=\"prices\",breakdown=\"platform\",status=\"2xx\"} 0.04850421492712977 1620735785000",
    "products_Id_prices_min{method=\"GET\",version=\"v16.9\",path1=\"products\",path2=\"prices\",breakdown=\"platform\",status=\"2xx\"} 108.682755 1620735785000",
    "products_Id_prices_max{method=\"GET\",version=\"v16.9\",path1=\"products\",path2=\"prices\",breakdown=\"platform\",status=\"2xx\"} 108.682755 1620735785000",
    "",
    "products_Id_prices{method=\"GET\",version=\"v16.9\",path1=\"products\",path2=\"prices\",status=\"2xx\"} 112.718755 1620735785000",
    "products_Id_prices{method=\"GET\",version=\"v16.9\",path1=\"products\",path2=\"prices\",status=\"2xx\",quantile=\"p50\"} 112.718755 1620735785000",
    "products_Id_prices{method=\"GET\",version=\"v16.9\",path1=\"products\",path2=\"prices\",status=\"2xx\",quantile=\"p95\"} 112.718755 1620735785000",
    "products_Id_prices_m1rate{method=\"GET\",version=\"v16.9\",path1=\"products\",path2=\"prices\",status=\"2xx\"} 0.04850421492712977 1620735785000",
    "products_Id_prices_min{method=\"GET\",version=\"v16.9\",path1=\"products\",path2=\"prices\",status=\"2xx\"} 112.718755 1620735785000",
    "products_Id_prices_max{method=\"GET\",version=\"v16.9\",path1=\"products\",path2=\"prices\",status=\"2xx\"} 112.718755 1620735785000",
    "",
  ],
  "offset": 0,
  "total": 18
}
X OCAPI versions 15.x and 16.x will be retired on March 31, 2021. For dates and more information, see the OCAPI versioning and deprecation policy and this Knowledge Article.
X Privacy Update: We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used. By continuing to use this site you are giving us your consent to do this. Privacy Policy.