Rocky_Mountain_Vending/.pnpm-store/v10/files/e4/62926545187538ae7e95dea8b47d8bfdf3df8fd0673eb98e2b6dfc0a272f93d7245b4c1bd08b0a415bd8fd3085f6db90d0696ffb1f4eed74e1649a77c755d5
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

56 lines
1.6 KiB
Text

import { SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME, SEMANTIC_ATTRIBUTE_PROFILE_ID } from '../semanticAttributes.js';
/**
* Converts a transaction event to a span JSON object.
*/
function convertTransactionEventToSpanJson(event) {
const { trace_id, parent_span_id, span_id, status, origin, data, op } = event.contexts?.trace ?? {};
return {
data: data ?? {},
description: event.transaction,
op,
parent_span_id,
span_id: span_id ?? '',
start_timestamp: event.start_timestamp ?? 0,
status,
timestamp: event.timestamp,
trace_id: trace_id ?? '',
origin,
profile_id: data?.[SEMANTIC_ATTRIBUTE_PROFILE_ID] ,
exclusive_time: data?.[SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME] ,
measurements: event.measurements,
is_segment: true,
};
}
/**
* Converts a span JSON object to a transaction event.
*/
function convertSpanJsonToTransactionEvent(span) {
return {
type: 'transaction',
timestamp: span.timestamp,
start_timestamp: span.start_timestamp,
transaction: span.description,
contexts: {
trace: {
trace_id: span.trace_id,
span_id: span.span_id,
parent_span_id: span.parent_span_id,
op: span.op,
status: span.status,
origin: span.origin,
data: {
...span.data,
...(span.profile_id && { [SEMANTIC_ATTRIBUTE_PROFILE_ID]: span.profile_id }),
...(span.exclusive_time && { [SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME]: span.exclusive_time }),
},
},
},
measurements: span.measurements,
};
}
export { convertSpanJsonToTransactionEvent, convertTransactionEventToSpanJson };
//# sourceMappingURL=transactionEvent.js.map