Rocky_Mountain_Vending/.pnpm-store/v10/files/83/23ae99df1c1932ce18bcea84dcd847f46e50a17db8ee96c5d2a55c49a20b7b73badfb163fd2456676adce75a62643560bad39b8d7863c64b9051f523a68fd3
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

58 lines
1.7 KiB
Text

import { defineIntegration } from '@sentry/core';
import { generateInstrumentOnce } from '../../otel/instrument.js';
import { SentryHttpInstrumentation } from './SentryHttpInstrumentation.js';
const INTEGRATION_NAME = 'Http';
const instrumentSentryHttp = generateInstrumentOnce(
`${INTEGRATION_NAME}.sentry`,
options => {
return new SentryHttpInstrumentation(options);
},
);
/**
* The http integration instruments Node's internal http and https modules.
* It creates breadcrumbs for outgoing HTTP requests which will be attached to the currently active span.
*/
const httpIntegration = defineIntegration((options = {}) => {
const dropSpansForIncomingRequestStatusCodes = options.dropSpansForIncomingRequestStatusCodes ?? [
[401, 404],
[300, 399],
];
return {
name: INTEGRATION_NAME,
setupOnce() {
instrumentSentryHttp({
...options,
extractIncomingTraceFromHeader: true,
propagateTraceInOutgoingRequests: true,
});
},
processEvent(event) {
// Drop transaction if it has a status code that should be ignored
if (event.type === 'transaction') {
const statusCode = event.contexts?.trace?.data?.['http.response.status_code'];
if (
typeof statusCode === 'number' &&
dropSpansForIncomingRequestStatusCodes.some(code => {
if (typeof code === 'number') {
return code === statusCode;
}
const [min, max] = code;
return statusCode >= min && statusCode <= max;
})
) {
return null;
}
}
return event;
},
};
});
export { httpIntegration };
//# sourceMappingURL=index.js.map