Skip to content
View as Markdown
View as Markdown

@salesforce/b2c-tooling-sdk / operations/metrics / getMetricsByCategory

Function: getMetricsByCategory()

getMetricsByCategory(client, tenantId, category, options?): Promise<{ }>

Defined in: packages/b2c-tooling-sdk/src/operations/metrics/index.ts:675

Retrieves metrics for a category by name, dispatching to the category-specific function. Category-specific filters (thirdPartyServiceId, apiFamily, apiName, ocapiCategory, ocapiApi) are applied only for the categories that support them and ignored otherwise.

Parameters

client

MetricsClient

Metrics API client from createMetricsClient

tenantId

string

Tenant ID (with or without the f_ecom_ prefix)

category

One of METRIC_CATEGORIES

"ocapi" | "mrt" | "ecdn" | "overall" | "sales" | "third-party" | "scapi" | "scapi-hooks" | "controller"

options?

MetricsQueryOptions

Optional time window and category-specific filters

Returns

Promise<{ }>

The metrics data response

Throws

Error if the request fails or the category is unknown

Released under the Apache-2.0 License.