Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion sdk/highlight-run/src/sdk/observe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down Expand Up @@ -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,
},
})
})
Expand Down
Loading