MCPcopy Create free account
hub / github.com/getsentry/sentry-javascript / getAttributesForRoute

Function getAttributesForRoute

packages/vue/test/router.test.ts:438–455  ·  view source on GitHub ↗
(route: Route)

Source from the content-addressed store, hash-verified

436
437// Small helper function to get flattened attributes for test comparison
438function getAttributesForRoute(route: Route): SpanAttributes {
439 const { params, query } = route;
440
441 const attributes: SpanAttributes = {};
442
443 for (const key of Object.keys(params)) {
444 attributes[`url.path.parameter.${key}`] = params[key];
445 attributes[`params.${key}`] = params[key];
446 }
447 for (const key of Object.keys(query)) {
448 const value = query[key];
449 if (value) {
450 attributes[`query.${key}`] = value;
451 }
452 }
453
454 return attributes;
455}

Callers 1

router.test.tsFile · 0.85

Calls 1

keysMethod · 0.65

Tested by

no test coverage detected