diff --git a/sdk/highlight-run/src/sdk/observe.ts b/sdk/highlight-run/src/sdk/observe.ts index 11ba9d29e..db601ed64 100644 --- a/sdk/highlight-run/src/sdk/observe.ts +++ b/sdk/highlight-run/src/sdk/observe.ts @@ -80,6 +80,7 @@ import { ObserveOptions } from '../client/types/observe' import { WebTracerProvider } from '@opentelemetry/sdk-trace-web' import { MeterProvider } from '@opentelemetry/sdk-metrics' import { isMetricSafeNumber } from '../client/utils/utils' +import * as SemanticAttributes from '@opentelemetry/semantic-conventions' export class ObserveSDK implements Observe { /** Verbose project ID that is exposed to users. Legacy users may still be using ints. */ @@ -576,12 +577,16 @@ export class ObserveSDK implements Observe { ) WebVitalsListener((data) => { const { name, value } = data + const { hostname, pathname, href } = window.location this.recordGauge({ name, value, attributes: { - group: window.location.href, + group: window.location.pathname, category: MetricCategory.WebVital, + [SemanticAttributes.ATTR_URL_FULL]: href, + [SemanticAttributes.ATTR_URL_PATH]: pathname, + [SemanticAttributes.ATTR_SERVER_ADDRESS]: hostname, }, }) })