@salesforce/b2c-tooling-sdk / operations/metrics / parseSeriesTags
Function: parseSeriesTags()
parseSeriesTags(
params):MetricSeriesTags
Defined in: packages/b2c-tooling-sdk/src/operations/metrics/tags.ts:247
Extracts the dimension tags for a single series id.
Combines three tiers, most-authoritative last:
- Request identity —
realm/environmentfrom the tenant id (never parsed from the series string). - String heuristics — category/metric-specific dimensions parsed from the packed id (
apiFamily,host,cacheStatus, …), or the raw remainder underserieswhen no rule matches. - Applied filters — any filter that was sent with the request (MetricsTagContext) is stamped last, overriding a heuristic guess. This corrects drill-down ids: with
apiFamily=shopperthe server returnsbdpx.shopper.auth.v1, which heuristics would mis-tag asapiFamily: "shopper.auth.v1"; the filter restoresapiFamily: "shopper".
The result is always a superset of the request context and never throws.
Parameters
params
The series' category, metric id, series id, and request context
category
"ocapi" | "mrt" | "ecdn" | "overall" | "sales" | "third-party" | "scapi" | "scapi-hooks" | "controller"
context
metricId
string
seriesId
string
Returns
The extracted MetricSeriesTags
Example
typescript
parseSeriesTags({
category: 'scapi', metricId: 'cacheHitRate',
seriesId: 'bdpx.product HIT', context: {tenantId: 'f_ecom_bdpx_prd'},
});
// → { realm: 'bdpx', environment: 'prd', apiFamily: 'product', cacheStatus: 'HIT' }