File tree Expand file tree Collapse file tree 3 files changed +594
-10
lines changed
Expand file tree Collapse file tree 3 files changed +594
-10
lines changed Original file line number Diff line number Diff line change 1717 "validate" : " svelte-check"
1818 },
1919 "dependencies" : {
20+ "@honeycombio/opentelemetry-web" : " ^0.15.0" ,
21+ "@opentelemetry/auto-instrumentations-web" : " ^0.46.0" ,
2022 "@pi-base/core" : " workspace:*" ,
2123 "@sentry/browser" : " ^7.93.0" ,
2224 "bootstrap" : " ^4.6.2" ,
Original file line number Diff line number Diff line change @@ -3,10 +3,32 @@ import { defaultHost } from '@/constants'
33import * as errors from '@/errors'
44import { sync } from '@/gateway'
55import type { LayoutLoad } from './$types'
6+ import { browser } from '$app/environment'
7+
8+ import { HoneycombWebSDK } from '@honeycombio/opentelemetry-web' ;
9+ import { getWebAutoInstrumentations } from '@opentelemetry/auto-instrumentations-web' ;
610
711export const load : LayoutLoad = async ( { fetch, url : { host } } ) => {
812 const dev = host . match ( / ( d e v ( e l o p m e n t ) ? [ . - ] | l o c a l h o s t ) / ) !== null
913
14+ if ( browser ) {
15+ const configDefaults = {
16+ ignoreNetworkEvents : true ,
17+ }
18+
19+ const sdk = new HoneycombWebSDK ( {
20+ debug : dev ,
21+ apiKey : 'Sx608N12wwH9ZJ6qmHMVnA' ,
22+ serviceName : 'π-base web' ,
23+ instrumentations : [ getWebAutoInstrumentations ( {
24+ '@opentelemetry/instrumentation-xml-http-request' : configDefaults ,
25+ '@opentelemetry/instrumentation-fetch' : configDefaults ,
26+ '@opentelemetry/instrumentation-document-load' : configDefaults ,
27+ } ) ] ,
28+ } ) ;
29+ sdk . start ( ) ;
30+ }
31+
1032 const errorHandler = dev
1133 ? errors . log ( )
1234 : errors . sentry ( { environment : errorEnv ( host ) } )
You can’t perform that action at this time.
0 commit comments