Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Set a code_origin tag to all sentry usages to filter origin

Oliver Günther5cc73e2a80d9
diff --git a/frontend/src/app/sentry/sentry-reporter.ts b/frontend/src/app/sentry/sentry-reporter.ts
index b9f43555858..b8a4167d503 100644
--- a/frontend/src/app/sentry/sentry-reporter.ts
+++ b/frontend/src/app/sentry/sentry-reporter.ts
@@ -181,6 +181,7 @@ export class SentryReporter implements ErrorReporter {
* @param scope
*/
private setupContext(scope:Scope) {
+ scope.setTag('code_origin', 'frontend');
scope.setTag('locale', window.I18n.locale);
scope.setTag('domain', window.location.hostname);
scope.setTag('url_path', window.location.pathname);
diff --git a/lib/open_project/logging/sentry_logger.rb b/lib/open_project/logging/sentry_logger.rb
index ea5d8b67cc1..e3e930f2d0f 100644
--- a/lib/open_project/logging/sentry_logger.rb
+++ b/lib/open_project/logging/sentry_logger.rb
@@ -56,6 +56,8 @@ module OpenProject
sentry_scope.set_fingerprint [ref]
end
+ sentry_scope.set_tags code_origin: 'backend'
+
# Collect extra information from payload extender
# e.g., with saas tenant information
extra = ::OpenProject::Logging.extend_payload! log_context[:extra] || {}, { sentry_scope: sentry_scope }