From 82b2c7e3f03af14cd1f1771131032a53d89cb67e Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sun, 13 Jun 2021 14:08:39 +0200 Subject: [PATCH] web: add capabilities to sentry event Signed-off-by: Jens Langhammer --- web/src/api/Sentry.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web/src/api/Sentry.ts b/web/src/api/Sentry.ts index 22790c746..008069359 100644 --- a/web/src/api/Sentry.ts +++ b/web/src/api/Sentry.ts @@ -7,8 +7,9 @@ import { config } from "./Config"; import { Config } from "authentik-api"; export const TAG_SENTRY_COMPONENT = "authentik.component"; +export const TAG_SENTRY_CAPABILITIES = "authentik.capabilities"; -export function configureSentry(canDoPpi: boolean = false, tags: { [key: string]: string; } = {}): Promise { +export function configureSentry(canDoPpi: boolean = false): Promise { return config().then((config) => { if (config.errorReportingEnabled) { Sentry.init({ @@ -53,7 +54,7 @@ export function configureSentry(canDoPpi: boolean = false, tags: { [key: string] return event; }, }); - Sentry.setTags(tags); + Sentry.setTag(TAG_SENTRY_CAPABILITIES, config.capabilities.join(",")); if (window.location.pathname.includes("if/")) { // Get the interface name from URL const intf = window.location.pathname.replace(/.+if\/(.+)\//, "$1");