Skip to content
View as Markdown
View as Markdown

@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:

  1. Request identityrealm/environment from the tenant id (never parsed from the series string).
  2. String heuristics — category/metric-specific dimensions parsed from the packed id (apiFamily, host, cacheStatus, …), or the raw remainder under series when no rule matches.
  3. 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=shopper the server returns bdpx.shopper.auth.v1, which heuristics would mis-tag as apiFamily: "shopper.auth.v1"; the filter restores apiFamily: "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

MetricsTagContext

metricId

string

seriesId

string

Returns

MetricSeriesTags

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' }

Released under the Apache-2.0 License.