Skip to content

Commit dcc8b8c

Browse files
committed
Add support for Sentry monitoring
Includes addition to documentation.
1 parent dd456c7 commit dcc8b8c

File tree

4 files changed

+67
-0
lines changed

4 files changed

+67
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22

33
An application to get authorization from users to access their data through 3rd party APIs. Mainly supports OAuth2 Authorization code follow to request authorization and processes the returned authorization code to add new entries of users. It creates new users and adds properties compatible and required by the [RADAR REST and Fitbit connectors](https://github.com/RADAR-base/RADAR-REST-Connector).
44

5+
<!-- TOC -->
6+
* [RADAR-REST-Source-Auth](#radar-rest-source-auth)
7+
* [Features supported](#features-supported)
8+
* [APIs to be used by REST Source-Connectors](#apis-to-be-used-by-rest-source-connectors)
9+
* [Installation](#installation)
10+
* [Authorization](#authorization)
11+
* [Registering OAuth Clients with ManagementPortal](#registering-oauth-clients-with-managementportal)
12+
* [Sentry monitoring](#sentry-monitoring)
13+
* [Migrating from 1.\*.\* version to 2.\*](#migrating-from-1-version-to-2)
14+
<!-- TOC -->
15+
516
## Features supported
617

718
1. It has one active entity where we store user properties.
@@ -60,6 +71,10 @@ callback-url: <advertised-url-of-rest-sources-authorizer-app>/login
6071
# the callback-url should be resolvable and match with the environment variable of radar-rest-sources-authorizer -> AUTH_CALLBACK_URL in the docker-compose.yml file.
6172
```
6273

74+
## Sentry monitoring
75+
76+
See [here](authorizer-app-backend/README.md#sentry-monitoring) for instructions on how to enable Sentry monitoring.
77+
6378
## Migrating from 1.\*.\* version to 2.\*
6479

6580
1. Move configurations from application.yml and environment variables to `authorizer.yml` following the description in `authorizer.yml.template`.

authorizer-app-backend/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# RADAR-REST-Source-Auth backend
2+
3+
This is the backend for the RADAR REST Source Authorizer application.
4+
5+
## Sentry monitoring
6+
7+
To enable Sentry monitoring:
8+
1. Set a `SENTRY_DSN` environment variable that points to the desired Sentry DSN.
9+
2. (Optional) Set the `SENTRY_LOG_LEVEL` environment variable to control the minimum log level of events sent to Sentry.
10+
The default log level for Sentry is `WARN`. Possible values are `TRACE`, `DEBUG`, `INFO`, `WARN`, and `ERROR`.

authorizer-app-backend/build.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ plugins {
44
kotlin("plugin.noarg")
55
kotlin("plugin.jpa")
66
kotlin("plugin.allopen")
7+
// TODO Remove this when new release of radar-commons is available and used in this project.
8+
// This version has Sentry support built in for radar-kotlin plugin.
9+
id("io.sentry.jvm.gradle") version "4.11.0"
710
}
811

912
application {
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<!--
3+
~ /*
4+
~ * Copyright 2024 The Hyve
5+
~ *
6+
~ * Licensed under the Apache License, Version 2.0 (the "License");
7+
~ * you may not use this file except in compliance with the License.
8+
~ * You may obtain a copy of the License at
9+
~ *
10+
~ * http://www.apache.org/licenses/LICENSE-2.0
11+
~ *
12+
~ * Unless required by applicable law or agreed to in writing, software
13+
~ * distributed under the License is distributed on an "AS IS" BASIS,
14+
~ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
~ * See the License for the specific language governing permissions and
16+
~ * limitations under the License.
17+
~ */
18+
-->
19+
20+
<configuration status="INFO">
21+
<appenders>
22+
<Console name="Console" target="SYSTEM_OUT">
23+
<PatternLayout
24+
pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"
25+
/>
26+
</Console>
27+
<!-- For Sentry to work the DSN must be set via SENTRY_DSN environment variable
28+
When SENTRY_DSN is empty string, the Sentry SDK is disabled -->
29+
<Sentry name="Sentry" debug="false"/>
30+
</appenders>
31+
32+
<loggers>
33+
<root level="INFO">
34+
<appender-ref ref="Console" />
35+
<!-- Note that the Sentry logging threshold is at WARN level by default -->
36+
<appender-ref ref="Sentry" level="${env:SENTRY_LOG_LEVEL:-WARN}" />
37+
</root>
38+
</loggers>
39+
</configuration>

0 commit comments

Comments
 (0)