diff --git a/app/web/src/main.ts b/app/web/src/main.ts index edddef8577..d8311eb394 100644 --- a/app/web/src/main.ts +++ b/app/web/src/main.ts @@ -44,10 +44,13 @@ const sdk = new HoneycombWebSDK({ // load custom configuration for xml-http-request instrumentation "@opentelemetry/instrumentation-xml-http-request": { propagateTraceHeaderCorsUrls: backendHosts, + ignoreNetworkEvents: true, + ignoreUrls: [/^https:\/\/e\.systeminit\.com/], }, "@opentelemetry/instrumentation-fetch": { propagateTraceHeaderCorsUrls: backendHosts, ignoreNetworkEvents: true, + ignoreUrls: [/^https:\/\/e\.systeminit\.com/], }, }), // add automatic instrumentation new DocumentLoadInstrumentation(), diff --git a/lib/vue-lib/package.json b/lib/vue-lib/package.json index cbfe3a405d..9914cf6174 100644 --- a/lib/vue-lib/package.json +++ b/lib/vue-lib/package.json @@ -42,6 +42,7 @@ "dependencies": { "@headlessui/tailwindcss": "^0.1.2", "@headlessui/vue": "^1.7.10", + "@opentelemetry/api": "^1.8.0", "@si/ts-lib": "workspace:*", "@tailwindcss/forms": "^0.5.3", "@tailwindcss/line-clamp": "^0.4.2", diff --git a/lib/vue-lib/src/pinia/pinia_api_tools.ts b/lib/vue-lib/src/pinia/pinia_api_tools.ts index 8aa4a7a65c..90dfac99f1 100644 --- a/lib/vue-lib/src/pinia/pinia_api_tools.ts +++ b/lib/vue-lib/src/pinia/pinia_api_tools.ts @@ -25,6 +25,9 @@ import { DeferredPromise, } from "@si/ts-lib"; import { ulid } from "ulid"; +import opentelemetry, { Span } from "@opentelemetry/api"; + +const tracer = opentelemetry.trace.getTracer("si-vue"); export type RequestUlid = string; @@ -421,6 +424,14 @@ export const initPiniaApiToolkitPlugin = (config: { api: AxiosInstance }) => { } if (triggerResult.error) { + tracer.startActiveSpan("pinia-http-error", (span: Span) => { + span.setAttributes({ + "http.body": JSON.stringify(actionResult.requestSpec.params), + "http.url": actionResult.requestSpec.url, + "http.status_code": triggerResult.error.response?.status, + }); + span.end(); + }); request.setFailedResult(triggerResult.error); if ( actionName !== "SET_COMPONENT_GEOMETRY" && diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 18a87555a4..4dc3c015b2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -753,6 +753,9 @@ importers: '@headlessui/vue': specifier: ^1.7.10 version: 1.7.12(vue@3.4.15) + '@opentelemetry/api': + specifier: ^1.8.0 + version: 1.8.0 '@si/ts-lib': specifier: workspace:* version: link:../ts-lib