UNPKG

@sentry/google-cloud-serverless

Version:
43 lines (36 loc) • 1.3 kB
Object.defineProperty(exports, '__esModule', { value: true }); const node = require('@sentry/node'); const googleCloudGrpc = require('./integrations/google-cloud-grpc.js'); const googleCloudHttp = require('./integrations/google-cloud-http.js'); /** Get the default integrations for the GCP SDK. */ function getDefaultIntegrations(_options) { return [ ...node.getDefaultIntegrationsWithoutPerformance(), googleCloudHttp.googleCloudHttpIntegration({ optional: true }), // We mark this integration optional since '@google-cloud/common' module could be missing. googleCloudGrpc.googleCloudGrpcIntegration({ optional: true }), // We mark this integration optional since 'google-gax' module could be missing. ]; } /** * @see {@link Sentry.init} */ function init(options = {}) { const opts = { _metadata: {} , defaultIntegrations: getDefaultIntegrations(), ...options, }; opts._metadata.sdk = opts._metadata.sdk || { name: 'sentry.javascript.google-cloud-serverless', packages: [ { name: 'npm:@sentry/google-cloud-serverless', version: node.SDK_VERSION, }, ], version: node.SDK_VERSION, }; node.init(opts); } exports.getDefaultIntegrations = getDefaultIntegrations; exports.init = init; //# sourceMappingURL=sdk.js.map