与sentry服务集成,集中汇总故障报告 #3672

This commit is contained in:
庄建国 2022-07-27 11:39:38 +00:00
parent 5d54699f70
commit 8155425d2a
7 changed files with 9 additions and 11 deletions

View File

@ -4,7 +4,7 @@ image:
# List the ports you want to expose and what to do when they are served. See https://www.gitpod.io/docs/config-ports/ # List the ports you want to expose and what to do when they are served. See https://www.gitpod.io/docs/config-ports/
ports: ports:
- port: 5000 - port: 5000
onOpen: open-browser onOpen: ignore
visibility: public visibility: public
- port: 3000 - port: 3000
onOpen: ignore onOpen: ignore

View File

@ -64,6 +64,9 @@ module.exports = {
*/ */
async started(ctx) { async started(ctx) {
// 故障报告服务
this.broker.createService(require("@steedos/service-sentry"));
// 启动 元数据服务 // 启动 元数据服务
this.broker.createService(require("@steedos/service-metadata-server")); this.broker.createService(require("@steedos/service-metadata-server"));
@ -87,9 +90,6 @@ module.exports = {
// 启动 登录页面 // 启动 登录页面
this.broker.createService(require("@steedos/webapp-accounts")); this.broker.createService(require("@steedos/webapp-accounts"));
// 故障报告服务
this.broker.createService(require("@steedos/service-sentry"));
// 产品分析 // 产品分析
this.broker.createService(require("@steedos/service-analytics")); this.broker.createService(require("@steedos/service-analytics"));
}, },

View File

@ -6,8 +6,7 @@
"dependencies": { "dependencies": {
"@sentry/node": "7.7.0", "@sentry/node": "7.7.0",
"@sentry/tracing": "7.7.0", "@sentry/tracing": "7.7.0",
"@sentry/utils": "7.7.0", "@sentry/utils": "7.7.0"
"@steedos/objectql": "2.2.55-beta.13"
}, },
"private": false, "private": false,
"publishConfig": { "publishConfig": {

View File

@ -6,6 +6,7 @@
'use strict' 'use strict'
const _ = require('lodash'); const _ = require('lodash');
const Sentry = require('@sentry/node') const Sentry = require('@sentry/node')
const SentryUtils = require('@sentry/utils') const SentryUtils = require('@sentry/utils')
@ -24,7 +25,6 @@ const DEFAULT_DSN = {
module.exports = { module.exports = {
name: serviceName, name: serviceName,
namespace: "steedos", namespace: "steedos",
mixins: [packageLoader],
/** /**
* Dependencies * Dependencies
@ -218,7 +218,7 @@ module.exports = {
}) })
} }
}, },
started() { started() {
let { enabled, dsn, options } = this.settings.sentry let { enabled, dsn, options } = this.settings.sentry
if (enabled) { if (enabled) {

View File

@ -8,7 +8,7 @@ const packageLoader = require('@steedos/service-meteor-package-loader');
const objectql = require('@steedos/objectql'); const objectql = require('@steedos/objectql');
const standardObjectsPath = path.dirname(require.resolve("@steedos/standard-objects/package.json")); const standardObjectsPath = path.dirname(require.resolve("@steedos/standard-objects/package.json"));
const _ = require('lodash'); const _ = require('lodash');
const Sentry = require('@sentry/node')
/** /**
* @typedef {import('moleculer').Context} Context Moleculer's Context * @typedef {import('moleculer').Context} Context Moleculer's Context
*/ */

View File

@ -1,5 +1,4 @@
console.log(Meteor.settings.public.sentry.dsn) if (Meteor.settings.public.sentry && Meteor.settings.public.sentry.dsn) {
if (Meteor.settings.public.sentry.dsn) {
let sentryScript = document.createElement("script"); let sentryScript = document.createElement("script");
sentryScript.setAttribute("src", Steedos.absoluteUrl('/sentry/sentry.min.js')); sentryScript.setAttribute("src", Steedos.absoluteUrl('/sentry/sentry.min.js'));