From ac7beb3f533efa0ad74d3741044fd7acec9cbecb Mon Sep 17 00:00:00 2001 From: pvannierop Date: Fri, 4 Oct 2024 15:26:03 +0200 Subject: [PATCH] Add support for Sentry monitoring Includes addition to documentation. --- README.md | 22 ++++++++++- data-dashboard-backend/build.gradle.kts | 3 ++ .../src/main/resources/log4j2.xml | 39 +++++++++++++++++++ 3 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 data-dashboard-backend/src/main/resources/log4j2.xml diff --git a/README.md b/README.md index ff0ce91..47cda15 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,19 @@ Application that provides a REST API to provide Variables (measured modalities) and related Observations (measurements) for Subjects (participants). The data layer connects to the TimescaleDB database that is provisioned with (a subset of) -the data from the RADAR-base kafka service.[]\ +the data from the RADAR-base kafka service.[] + + + +* [RADAR-base Data Dashboard backend](#radar-base-data-dashboard-backend) + * [Features supported](#features-supported) + * [APIs to be used by REST Source-Connectors](#apis-to-be-used-by-rest-source-connectors) + * [Installation](#installation) + * [Authorization](#authorization) + * [Registering OAuth Clients with ManagementPortal](#registering-oauth-clients-with-managementportal) + * [Sentry monitoring](#sentry-monitoring) + + ## Features supported @@ -47,3 +59,11 @@ grant-type:authorization_code,refresh_token resources:res_DataDashboardAPI scope:MEASUREMENT.READ ``` + +## Sentry monitoring + +To enable Sentry monitoring: + +1. Set a `SENTRY_DSN` environment variable that points to the desired Sentry DSN. +2. (Optional) Set the `SENTRY_LOG_LEVEL` environment variable to control the minimum log level of events sent to Sentry. + The default log level for Sentry is `WARN`. Possible values are `TRACE`, `DEBUG`, `INFO`, `WARN`, and `ERROR`. diff --git a/data-dashboard-backend/build.gradle.kts b/data-dashboard-backend/build.gradle.kts index d37cced..4e4552b 100644 --- a/data-dashboard-backend/build.gradle.kts +++ b/data-dashboard-backend/build.gradle.kts @@ -4,6 +4,9 @@ plugins { kotlin("plugin.noarg") kotlin("plugin.jpa") kotlin("plugin.allopen") + // TODO Remove this when new release of radar-commons is available and used in this project. + // This version has Sentry support built in for radar-kotlin plugin. + id("io.sentry.jvm.gradle") version "4.11.0" } application { diff --git a/data-dashboard-backend/src/main/resources/log4j2.xml b/data-dashboard-backend/src/main/resources/log4j2.xml new file mode 100644 index 0000000..66bc4fc --- /dev/null +++ b/data-dashboard-backend/src/main/resources/log4j2.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + +