---
schema_version: "1"
id: de26429aecad4476835d6f7a166d8c6a2f833f9c5117ed8bd97c7713e12eb859
title: Data Metrics (deprecated)
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/commerce-cloud/b2c-commerce/references/generated-api-specs/ocapi-data-metrics.md
canonical_url: https://developer.salesforce.com/docs/commerce/b2c-commerce/references/ocapi-data-metrics
source_site: developer.salesforce.com
content_type: documentation
content_hash: 298b12385dcde3460530153633c88fce9f85014e96bb68577b1950628b5f1f25
products:
  - B2C Commerce
  - Salesforce APIs
---
Data Metrics (deprecated)

# Data Metrics (deprecated)

Data API endpoints enable developers to build applications for merchants: Create, update, delete business objects, like products, customers, pricing and promotions or assignments. They typically provide read and write access and are designed for moderate usage.

**Version:** 25.6

## Servers

*   `https://{host}/s/-/dw/data/v25_6`

Protocols: https.

## Security

*   `oauth2_application` (oauth2) Authentication flow with client ID and password with account manager.
    *   OAuth flow application (tokenUrl: https://account.demandware.com:443/dwsso/oauth2/access\_token)
    *   Scope x-info: Scopes are NOT supported. This is just a dummy, because the 'scopes' field is required.
*   `client_id` (apiKey) Add client ID for application identification. Alternative as 'client\_id' query parameter.
    *   API key in header: x-dw-client-id

## Operations

### GET API metrics

`GET /metrics/{apitype}`

Operation ID: `API metrics`. Tags: metrics. Security: oauth2\_application.

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.

This endpoint may return the following faults:

*   400 - TooManyRequestsException - Too many requests.
*   403 - FeatureNotEnabledException - Feature not enabled.

#### Parameters

*   `apitype` (path, string, required) Type of the api. Values are `data` or `shop` .  
    Minimum length: 1.
*   `offset` (query, integer (int32)) Optional offset of the result set not counting commentaries or empty lines.  
    Minimum: 0.
*   `limit` (query, integer (int32)) Optional limit of the result set not counting commentaries or empty lines.  
    Minimum: 1. Maximum: 4500.

#### Responses

*   **400** `TooManyRequestsException` - Too many requests.
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    
*   **403** `FeatureNotEnabledException` - Feature not enabled.
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    
*   **default**
    
    Media type: `application/json, text/xml`. Schema: `metric_response`.
    

## Schemas

### fault

Document representing a fault message that is returned whenever the HTTP status code is greater than or equal to 400 (which indicates an error).

*   `arguments` (_object_)
    
    A map that provides fault arguments.
    
    Data can be used to provide error messages on the client side.
    
    Additional properties: `object`.
    
*   `cause` (_cause_)
*   `display_message_pattern` (_string_) The localized display message pattern, if the request parameter display\_locale was given
*   `message` (_string_) The message text of the java exception.
*   `stack_trace` (_string_)
*   `type` (_string_) The name of the java exception.

### metric\_response

Metrics in Prometheus Exposition Format wrapped as Json array of strings.

*   `limit` (_integer (int32)_) Page size of result page
*   `metrics` (_array of string_)
    
    Metrics in Prometheus Exposition Format.
    
    A single metric is represented by a single line. They have a name, labels (dimensions), a value and a time-stamp.
    
    Example:
    
    OCAPI request: `GET /v21.10/products/{Id}/prices`
    
    total time metric: `products_Id_prices{method="GET",version="v21.10",path1="products",path2="prices",status="2xx"} 112.718755 1620735785000`
    
    The individual elements of a metric line are the metric name, metric dimensions (denoted by label / value pairs in curly braces), the actual metric value (in milliseconds or in operations / second for metrics ending in `_m1rate`) and a time-stamp in milliseconds since 01/01/1970 UTC.
    
    **name**
    
    The metric name will have both path segments and parameters separated by '\`\_\`'. Path segments in the metric name are in lower-case whereas path parameters are formatted in camel-case.
    
    **method**
    
    the HTTP method of the OCAPI request, one of `GET, PUT, POST, DELETE`
    
    **version**
    
    the version of the OCAPI request, e.g. v20.8
    
    **path1** .. **pathN**
    
    The path segments (not including the path-parameters) of the OCAPI request, from the example above, the path segments will be mapped to labels as: `path1="products", path2="prices"`
    
    **breakdown**
    
    Sub-timings of the request, in particular:
    
    *   **total** (implicit): total timings of the request (sum of the three breakdowns below). This dimension is denoted with no label.
        
    *   **platform**: amount of time spent in platform code (including database-tier)
        
    *   **custom**: amount of time spent in custom code (including database-tier)
        
    *   **thirdParty**: amount of time spent invoking third party services through the service framework
        
    
    **status**
    
    *   **2xx**: metrics for all requests with a status code between 200 and 299
        
    *   **3xx**: metrics for all requests with a status code between 300 and 399
        
    *   **4xx**: metrics for all requests with a status code between 400 and 499
        
    *   **5xx**: metrics for all requests with a status code between 500 and 599
        
    
    **quantile**
    
    *   **p50**: median timings
        
    *   **p95**: timings for the 95th percentile of all requests
        
    
    **serviceId** (only for metrics where breakdown = thirdParty)
    
    the `id` of the third party service that was invoked during the request. If multiple services were invoked, timings for each individual service are available
    
*   `offset` (_integer (int32)_) Offset of result page
*   `total` (_integer (int32)_) Total number of metrics

_Example_

```
{
  "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
}
```

### cause

*   `cause` (_cause_)
*   `message` (_string_)
*   `type` (_string_)