Skip to content

Commit 4faa3f3

Browse files
committed
Add support for Sentry monitoring
Includes addition to documentation.
1 parent 38ecf12 commit 4faa3f3

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
# Restructure Kafka connector output files
22

3+
<!-- TOC -->
4+
* [Restructure Kafka connector output files](#restructure-kafka-connector-output-files)
5+
* [Upgrade instructions](#upgrade-instructions)
6+
* [Docker usage](#docker-usage)
7+
* [Command line usage](#command-line-usage)
8+
* [File Format](#file-format)
9+
* [Compression](#compression)
10+
* [Redis](#redis)
11+
* [Source and target](#source-and-target)
12+
* [Path format](#path-format)
13+
* [Cleaner](#cleaner)
14+
* [Service](#service)
15+
* [Sentry monitoring](#sentry-monitoring)
16+
* [Local build](#local-build)
17+
* [Extending the connector](#extending-the-connector)
18+
<!-- TOC -->
19+
320
Data streamed by a Kafka Connector will be converted to a RADAR-base oriented output directory, by organizing it by project, user and collection date.
421
It supports data written by [RADAR S3 sink connector](https://github.com/RADAR-base/RADAR-S3-Connector) is streamed to files based on topic name only. This package transforms that output to a local directory structure as follows: `projectId/userId/topic/date_hour.csv`. The date and hour are extracted from the `time` field of each record, and is formatted in UTC time.
522

@@ -225,6 +242,14 @@ The cleaner can also be enabled with the `--cleaner` command-line flag. To run t
225242

226243
To run the output generator as a service that will regularly poll the source directory, add the `--service` flag and optionally the `--interval` flag to adjust the polling interval or use the corresponding configuration file parameters.
227244

245+
## Sentry monitoring
246+
247+
To enable Sentry monitoring:
248+
249+
1. Set a `SENTRY_DSN` environment variable that points to the desired Sentry DSN.
250+
2. (Optional) Set the `SENTRY_LOG_LEVEL` environment variable to control the minimum log level of events sent to Sentry.
251+
The default log level for Sentry is `WARN`. Possible values are `TRACE`, `DEBUG`, `INFO`, `WARN`, and `ERROR`.
252+
228253
## Local build
229254

230255
This package requires at least Java JDK 8. Build the distribution with

build.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ plugins {
99
id("org.radarbase.radar-kotlin") version Versions.radarCommons
1010
id("org.radarbase.radar-publishing") version Versions.radarCommons
1111
id("com.avast.gradle.docker-compose") version Versions.dockerCompose
12+
// TODO Remove this when new release of radar-commons is available and used in this project.
13+
// This version has Sentry suppor1t built in for radar-kotlin plugin.
14+
id("io.sentry.jvm.gradle") version "4.11.0"
1215
}
1316

1417
description = "RADAR-base output restructuring"

src/main/resources/log4j2.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,16 @@
33
<Console name="STDOUT" target="SYSTEM_OUT">
44
<PatternLayout pattern="[%d] %-5level - %msg (%F:%L)%n"/>
55
</Console>
6+
<!-- For Sentry to work the DSN must be set via SENTRY_DSN environment variable
7+
When SENTRY_DSN is empty string, the Sentry SDK is disabled -->
8+
<Sentry name="Sentry" debug="false"/>
69
</Appenders>
710

811
<Loggers>
912
<Root level="${env:LOG4J_LOG_LEVEL:-INFO}">
1013
<AppenderRef ref="STDOUT"/>
14+
<!-- Note that the Sentry logging threshold is at WARN level by default -->
15+
<appender-ref ref="Sentry" level="${env:SENTRY_LOG_LEVEL:-WARN}" />
1116
</Root>
1217
</Loggers>
1318
</Configuration>

0 commit comments

Comments
 (0)