Rocky_Mountain_Vending/.pnpm-store/v10/files/af/555fa0197cbd95c3b0723a1ed60e7734f5f27e17b8c68fc2031fb28c935c997619ce64c0d81809b7de6c55aa63f6ef0088e3e109463ae8f09b53d3af6490ed
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

54 lines
1.6 KiB
Text

import { KnexInstrumentation } from '@opentelemetry/instrumentation-knex';
import { defineIntegration, spanToJSON, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core';
import { generateInstrumentOnce, instrumentWhenWrapped } from '@sentry/node-core';
const INTEGRATION_NAME = 'Knex';
const instrumentKnex = generateInstrumentOnce(
INTEGRATION_NAME,
() => new KnexInstrumentation({ requireParentSpan: true }),
);
const _knexIntegration = (() => {
let instrumentationWrappedCallback;
return {
name: INTEGRATION_NAME,
setupOnce() {
const instrumentation = instrumentKnex();
instrumentationWrappedCallback = instrumentWhenWrapped(instrumentation);
},
setup(client) {
instrumentationWrappedCallback?.(() =>
client.on('spanStart', span => {
const { data } = spanToJSON(span);
// knex.version is always set in the span data
// https://github.com/open-telemetry/opentelemetry-js-contrib/blob/0309caeafc44ac9cb13a3345b790b01b76d0497d/plugins/node/opentelemetry-instrumentation-knex/src/instrumentation.ts#L138
if ('knex.version' in data) {
span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, 'auto.db.otel.knex');
}
}),
);
},
};
}) ;
/**
* Knex integration
*
* Capture tracing data for [Knex](https://knexjs.org/).
*
* @example
* ```javascript
* import * as Sentry from '@sentry/node';
*
* Sentry.init({
* integrations: [Sentry.knexIntegration()],
* });
* ```
*/
const knexIntegration = defineIntegration(_knexIntegration);
export { instrumentKnex, knexIntegration };
//# sourceMappingURL=knex.js.map