@hyperdx/instrumentation-sentry-node
Version:
[![NPM Published Version][npm-img]][npm-url] [![Apache License][license-image]][license-image]
25 lines (24 loc) • 931 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.hyperdxIntegration = exports._hyperdxIntegration = void 0;
const eventProcessor_1 = require("./eventProcessor");
const defineIntegration = (fn) => fn;
const INTEGRATION_NAME = 'HyperDX';
exports._hyperdxIntegration = ((options = {}) => {
return {
name: INTEGRATION_NAME,
setupOnce() { },
setup(client) {
var _a;
if (!client.on) {
return;
}
const sdkMetadata = client.getSdkMetadata();
const processor = (0, eventProcessor_1.getEventProcessor)(undefined, (_a = sdkMetadata.sdk) === null || _a === void 0 ? void 0 : _a.version);
client.on('beforeSendEvent', (event, hint) => {
processor(event, hint);
});
},
};
});
exports.hyperdxIntegration = defineIntegration(exports._hyperdxIntegration);