Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove sentry references #12082

Merged
merged 7 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/release-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ env:
# Posthog token used by ui at build time
POSTHOG_TOKEN: phc_bIjZL7oh2GEUd2vqvTBH8WvrX0fWTFQMs6H5KQxiUxU
INTERCOM_TOKEN: ${{ secrets.INTERCOM_TOKEN }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}

jobs:
Expand Down Expand Up @@ -110,7 +109,6 @@ jobs:
git commit -m "Helm Release: ${{ env.RELEASE_VERSION }}"
git push


trigger-deploy-to-qa-env:
needs: [release-helm-chart]
runs-on: ubuntu-latest
Expand Down
2 changes: 0 additions & 2 deletions charts/budibase/templates/app-service-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,6 @@ spec:
{{ end }}
- name: SELF_HOSTED
value: {{ .Values.globals.selfHosted | quote }}
- name: SENTRY_DSN
value: {{ .Values.globals.sentryDSN | quote }}
- name: POSTHOG_TOKEN
value: {{ .Values.globals.posthogToken | quote }}
- name: WORKER_URL
Expand Down
2 changes: 0 additions & 2 deletions charts/budibase/templates/worker-service-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,6 @@ spec:
{{ end }}
- name: SELF_HOSTED
value: {{ .Values.globals.selfHosted | quote }}
- name: SENTRY_DSN
value: {{ .Values.globals.sentryDSN }}
- name: ENABLE_ANALYTICS
value: {{ .Values.globals.enableAnalytics | quote }}
- name: POSTHOG_TOKEN
Expand Down
1 change: 0 additions & 1 deletion charts/budibase/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ globals:
budibaseEnv: PRODUCTION
tenantFeatureFlags: "*:LICENSING,*:USER_GROUPS,*:ONBOARDING_TOUR"
enableAnalytics: "1"
sentryDSN: ""
posthogToken: "phc_bIjZL7oh2GEUd2vqvTBH8WvrX0fWTFQMs6H5KQxiUxU"
selfHosted: "1" # set to 0 for budibase cloud environment, set to 1 for self-hosted setup
multiTenancy: "0" # set to 0 to disable multiple orgs, set to 1 to enable multiple orgs
Expand Down
2 changes: 0 additions & 2 deletions hosting/docker-compose.build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ services:
API_ENCRYPTION_KEY: ${API_ENCRYPTION_KEY}
JWT_SECRET: ${JWT_SECRET}
LOG_LEVEL: info
SENTRY_DSN: https://[email protected]/5338131
ENABLE_ANALYTICS: "true"
REDIS_URL: redis-service:6379
REDIS_PASSWORD: ${REDIS_PASSWORD}
Expand Down Expand Up @@ -48,7 +47,6 @@ services:
COUCH_DB_USERNAME: ${COUCH_DB_USER}
COUCH_DB_PASSWORD: ${COUCH_DB_PASSWORD}
COUCH_DB_URL: http://${COUCH_DB_USER}:${COUCH_DB_PASSWORD}@couchdb-service:5984
SENTRY_DSN: https://[email protected]/5338131
INTERNAL_API_KEY: ${INTERNAL_API_KEY}
REDIS_URL: redis-service:6379
REDIS_PASSWORD: ${REDIS_PASSWORD}
Expand Down
13 changes: 8 additions & 5 deletions hosting/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ services:
API_ENCRYPTION_KEY: ${API_ENCRYPTION_KEY}
JWT_SECRET: ${JWT_SECRET}
LOG_LEVEL: info
SENTRY_DSN: https://[email protected]/5338131
ENABLE_ANALYTICS: "true"
REDIS_URL: redis-service:6379
REDIS_PASSWORD: ${REDIS_PASSWORD}
Expand All @@ -31,8 +30,8 @@ services:
depends_on:
- worker-service
- redis-service
# volumes:
# - /some/path/to/plugins:/plugins
# volumes:
# - /some/path/to/plugins:/plugins

worker-service:
restart: unless-stopped
Expand All @@ -51,7 +50,6 @@ services:
COUCH_DB_USERNAME: ${COUCH_DB_USER}
COUCH_DB_PASSWORD: ${COUCH_DB_PASSWORD}
COUCH_DB_URL: http://${COUCH_DB_USER}:${COUCH_DB_PASSWORD}@couchdb-service:5984
SENTRY_DSN: https://[email protected]/5338131
INTERNAL_API_KEY: ${INTERNAL_API_KEY}
REDIS_URL: redis-service:6379
REDIS_PASSWORD: ${REDIS_PASSWORD}
Expand Down Expand Up @@ -113,7 +111,12 @@ services:
PUT_CALL: "curl -u ${COUCH_DB_USER}:${COUCH_DB_PASSWORD} -X PUT couchdb-service:5984"
depends_on:
- couchdb-service
command: ["sh","-c","sleep 10 && $${PUT_CALL}/_users && $${PUT_CALL}/_replicator; fg;"]
command:
[
"sh",
"-c",
"sleep 10 && $${PUT_CALL}/_users && $${PUT_CALL}/_replicator; fg;",
]

redis-service:
restart: unless-stopped
Expand Down
1 change: 0 additions & 1 deletion packages/builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
"@fortawesome/fontawesome-svg-core": "^6.2.1",
"@fortawesome/free-brands-svg-icons": "^6.2.1",
"@fortawesome/free-solid-svg-icons": "^6.2.1",
"@sentry/browser": "5.19.1",
"@spectrum-css/page": "^3.0.1",
"@spectrum-css/vars": "^3.0.1",
"codemirror": "^5.59.0",
Expand Down
37 changes: 0 additions & 37 deletions packages/builder/src/analytics/SentryClient.js

This file was deleted.

9 changes: 2 additions & 7 deletions packages/builder/src/analytics/index.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import { API } from "api"
import PosthogClient from "./PosthogClient"
import IntercomClient from "./IntercomClient"
import SentryClient from "./SentryClient"
import { Events, EventSource } from "./constants"

const posthog = new PosthogClient(process.env.POSTHOG_TOKEN)
const sentry = new SentryClient(process.env.SENTRY_DSN)
const intercom = new IntercomClient(process.env.INTERCOM_TOKEN)

class AnalyticsHub {
constructor() {
this.clients = [posthog, sentry, intercom]
this.clients = [posthog, intercom]
}

async activate() {
Expand All @@ -23,12 +21,9 @@ class AnalyticsHub {

identify(id) {
posthog.identify(id)
sentry.identify(id)
}

captureException(err) {
sentry.captureException(err)
}
captureException(_err) {}
adrinr marked this conversation as resolved.
Show resolved Hide resolved

captureEvent(eventName, props = {}) {
posthog.captureEvent(eventName, props)
Expand Down
1 change: 0 additions & 1 deletion packages/builder/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ export default defineConfig(({ mode }) => {
"process.env.INTERCOM_TOKEN": JSON.stringify(
process.env.INTERCOM_TOKEN
),
"process.env.SENTRY_DSN": JSON.stringify(process.env.SENTRY_DSN),
}),
copyFonts("fonts"),
...(isProduction ? [] : devOnlyPlugins),
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/api/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const API = createAPIClient({
},

// Show an error notification for all API failures.
// We could also log these to sentry.
// We could also log these to Posthog.
// Or we could check error.status and redirect to login on a 403 etc.
onError: error => {
const { status, method, url, message, handled, suppressErrors } =
Expand Down
1 change: 0 additions & 1 deletion packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
"@elastic/elasticsearch": "7.10.0",
"@google-cloud/firestore": "6.8.0",
"@koa/router": "8.0.8",
"@sentry/node": "6.17.7",
"@socket.io/redis-adapter": "^8.2.1",
"airtable": "0.10.1",
"arangojs": "7.2.0",
Expand Down
8 changes: 0 additions & 8 deletions packages/server/src/app.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import * as Sentry from "@sentry/node"

if (process.env.DD_APM_ENABLED) {
require("./ddApm")
}

// need to load environment first
import env from "./environment"
import * as db from "./db"
db.init()
import { ServiceType } from "@budibase/types"
Expand All @@ -28,10 +24,6 @@ async function start() {
}
// startup includes automation runner - if enabled
await startup(app, server)
if (env.isProd()) {
env._set("NODE_ENV", "production")
Sentry.init()
}
}

start().catch(err => {
Expand Down
8 changes: 3 additions & 5 deletions packages/server/src/db/linkedRows/LinkController.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { IncludeDocs, getLinkDocuments } from "./linkUtils"
import { InternalTables, getUserMetadataParams } from "../utils"
import Sentry from "@sentry/node"
import { FieldTypes } from "../../constants"
import { context } from "@budibase/backend-core"
import { context, logging } from "@budibase/backend-core"
import LinkDocument from "./LinkDocument"
import {
Database,
Expand Down Expand Up @@ -433,9 +432,8 @@ class LinkController {
delete linkedTable.schema[field.fieldName]
await this._db.put(linkedTable)
}
} catch (err) {
/* istanbul ignore next */
Sentry.captureException(err)
} catch (err: any) {
logging.logWarn(err?.message, err)
}
}
// need to get the full link docs to delete them
Expand Down
16 changes: 2 additions & 14 deletions packages/server/src/koa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ import * as automations from "./automations"
import { Thread } from "./threads"
import * as redis from "./utilities/redis"
import { events, logging, middleware, timers } from "@budibase/backend-core"
const Sentry = require("@sentry/node")
const destroyable = require("server-destroy")
const { userAgent } = require("koa-useragent")
import destroyable from "server-destroy"
import { userAgent } from "koa-useragent"

export default function createKoaApp() {
const app = new Koa()
Expand All @@ -36,17 +35,6 @@ export default function createKoaApp() {
app.use(middleware.pino)
app.use(userAgent)

if (env.isProd()) {
app.on("error", (err: any, ctx: ExtendableContext) => {
Sentry.withScope(function (scope: any) {
scope.addEventProcessor(function (event: any) {
return Sentry.Handlers.parseRequest(event, ctx.request)
})
Sentry.captureException(err)
})
})
}

const server = http.createServer(app.callback())
destroyable(server)

Expand Down
1 change: 0 additions & 1 deletion packages/worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
"@budibase/string-templates": "0.0.0",
"@budibase/types": "0.0.0",
"@koa/router": "8.0.8",
"@sentry/node": "6.17.7",
"@techpass/passport-openidconnect": "0.3.2",
"@types/global-agent": "2.1.1",
"aws-sdk": "2.1030.0",
Expand Down
20 changes: 2 additions & 18 deletions packages/worker/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ if (process.env.DD_APM_ENABLED) {

// need to load environment first
import env from "./environment"
import { Scope } from "@sentry/node"
import { Event } from "@sentry/types/dist/event"
import Application from "koa"
import { bootstrap } from "global-agent"
import * as db from "./db"
Expand All @@ -25,9 +23,9 @@ import koaBody from "koa-body"
import http from "http"
import api from "./api"
import * as redis from "./utilities/redis"
const Sentry = require("@sentry/node")

const koaSession = require("koa-session")
const { userAgent } = require("koa-useragent")
import { userAgent } from "koa-useragent"

import destroyable from "server-destroy"
import { initPro } from "./initPro"
Expand Down Expand Up @@ -66,20 +64,6 @@ app.use(auth.passport.session())
// api routes
app.use(api.routes())

// sentry
if (env.isProd()) {
Sentry.init()

app.on("error", (err, ctx) => {
Sentry.withScope(function (scope: Scope) {
scope.addEventProcessor(function (event: Event) {
return Sentry.Handlers.parseRequest(event, ctx.request)
})
Sentry.captureException(err)
})
})
}

const server = http.createServer(app.callback())
destroyable(server)

Expand Down
Loading