Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
51 lines
1.4 KiB
Plaintext
51 lines
1.4 KiB
Plaintext
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
|
const core = require('@sentry/core');
|
|
const nodeCore = require('@sentry/node-core');
|
|
const firebaseInstrumentation = require('./otel/firebaseInstrumentation.js');
|
|
|
|
const INTEGRATION_NAME = 'Firebase';
|
|
|
|
const config = {
|
|
firestoreSpanCreationHook: span => {
|
|
nodeCore.addOriginToSpan(span, 'auto.firebase.otel.firestore');
|
|
|
|
span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_OP, 'db.query');
|
|
},
|
|
functions: {
|
|
requestHook: span => {
|
|
nodeCore.addOriginToSpan(span, 'auto.firebase.otel.functions');
|
|
|
|
span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_OP, 'http.request');
|
|
},
|
|
errorHook: async (_, error) => {
|
|
if (error) {
|
|
core.captureException(error, {
|
|
mechanism: {
|
|
type: 'auto.firebase.otel.functions',
|
|
handled: false,
|
|
},
|
|
});
|
|
await core.flush(2000);
|
|
}
|
|
},
|
|
},
|
|
};
|
|
|
|
const instrumentFirebase = nodeCore.generateInstrumentOnce(INTEGRATION_NAME, () => new firebaseInstrumentation.FirebaseInstrumentation(config));
|
|
|
|
const _firebaseIntegration = (() => {
|
|
return {
|
|
name: INTEGRATION_NAME,
|
|
setupOnce() {
|
|
instrumentFirebase();
|
|
},
|
|
};
|
|
}) ;
|
|
|
|
const firebaseIntegration = core.defineIntegration(_firebaseIntegration);
|
|
|
|
exports.firebaseIntegration = firebaseIntegration;
|
|
exports.instrumentFirebase = instrumentFirebase;
|
|
//# sourceMappingURL=firebase.js.map
|