Skip to content

Commit

Permalink
Merge pull request #44 from onaio/sentry-integration
Browse files Browse the repository at this point in the history
Sentry Integration 🔊
  • Loading branch information
ndegwamartin authored Mar 26, 2024
2 parents ba26ac1 + 3a5bd65 commit 6a950c9
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 6 deletions.
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,38 @@ environment variables. Below is a list of the required configurations.
- `BACKEND_TYPE`: The type of backend, either `HAPI` or `GCP`. `HAPI` should be
used for most FHIR servers, while `GCP` should be used for GCP FHIR stores.

**Logging**

The OpenSRP FHIR Gateway uses Sentry to capture exception logs. The Sentry
integration is _optional_ but if you enable it the following environment
variables are required.

- `SENTRY_DSN` - The Sentry DSN to send event logs to.
[Read more about Sentry DSN here](https://docs.sentry.io/product/sentry-basics/concepts/dsn-explainer/).
(_Leave empty to disable sentry integration_)
- `SENTRY_RELEASE` - The release version of the Gateway you are running _e.g.
v1.0.8_
- `SENTRY_ENVIRONMENT` - The server environment you are running _e.g.
ecbis.production_
- `SENTRY_LOG_LEVEL` - The minimum log level from which you wish to capture
_e.g. error_

Note, Sentry can also be configured using an `application.properties` file in
the classpath e.g.

```.properties
# ../plugins/resources/application.properties
sentry.dsn=<dsn url>
sentry.logging.minimum-event-level=error
sentry.logging.minimum-breadcrumb-level=debug
sentry.environment=<app deployment>.<envrironment> #e.g. echis.production
sentry.release=1.0.8
```

**Note:** If you want to disable Sentry integration just leave out the
`SENTRY_DSN` configuration.

**Caching**

The plugins implementation supports caching for the sync strategy details which
Expand Down
4 changes: 2 additions & 2 deletions exec/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.smartregister</groupId>
<artifactId>opensrp-gateway-plugin</artifactId>
<version>1.0.7</version>
<version>1.0.8</version>
</parent>

<artifactId>exec</artifactId>
Expand Down Expand Up @@ -70,7 +70,7 @@
<dependency>
<groupId>org.smartregister</groupId>
<artifactId>plugins</artifactId>
<version>1.0.7</version>
<version>1.0.8</version>
</dependency>

<dependency>
Expand Down
13 changes: 11 additions & 2 deletions plugins/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.smartregister</groupId>
<artifactId>opensrp-gateway-plugin</artifactId>
<version>1.0.7</version>
<version>1.0.8</version>
</parent>

<artifactId>plugins</artifactId>
Expand Down Expand Up @@ -48,7 +48,16 @@
<version>1.0.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>io.sentry</groupId>
<artifactId>sentry-logback</artifactId>
<version>7.6.0</version>
</dependency>
<dependency>
<groupId>io.sentry</groupId>
<artifactId>sentry-spring-boot-starter</artifactId>
<version>7.6.0</version>
</dependency>
</dependencies>

</project>
6 changes: 6 additions & 0 deletions plugins/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
sentry.dsn=
sentry.logging.minimum-event-level=error
sentry.logging.minimum-breadcrumb-level=debug
sentry.debug=true
sentry.environment=debug.localhost.testing
sentry.release=1.0.8-dev
3 changes: 1 addition & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<groupId>org.smartregister</groupId>
<artifactId>opensrp-gateway-plugin</artifactId>
<version>1.0.7</version>
<version>1.0.8</version>
<packaging>pom</packaging>

<modules>
Expand Down Expand Up @@ -41,7 +41,6 @@
<skip>true</skip>
</configuration>
</plugin>

<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
Expand Down

0 comments on commit 6a950c9

Please sign in to comment.