Skip to content

Commit

Permalink
Merge pull request #1 from doppleware/feature/observability
Browse files Browse the repository at this point in the history
udpated
  • Loading branch information
otaviojava authored Oct 16, 2023
2 parents cf7fa43 + 84727d7 commit c2cd455
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
21 changes: 21 additions & 0 deletions jnopo-talk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,23 @@
<jnosql.version>1.0.1</jnosql.version>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-bom</artifactId>
<version>1.10.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-api</artifactId>
</dependency>
<dependency>
<groupId>jakarta.platform</groupId>
<artifactId>jakarta.jakartaee-api</artifactId>
Expand Down Expand Up @@ -70,6 +86,11 @@
<artifactId>jnosql-couchbase</artifactId>
<version>${jnosql.version}</version>
</dependency>
<dependency>
<groupId>io.opentelemetry.instrumentation</groupId>
<artifactId>opentelemetry-instrumentation-annotations</artifactId>
<version>1.26.0</version>
</dependency>

</dependencies>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package br.org.soujava.coffewithjava.jnopo;

import br.org.soujava.coffewithjava.jnopo.core.GameOver;
import io.opentelemetry.instrumentation.annotations.WithSpan;
import jakarta.ejb.Schedule;
import jakarta.ejb.Singleton;
import jakarta.ejb.Startup;
Expand Down Expand Up @@ -67,6 +68,7 @@ public void onError(Session session,
}

@OnMessage
@WithSpan
public void onMessage(String message) {
logger.info("Received the event >> %s".formatted(message));
var event = jsonb.fromJson(message, GameEvent.class);
Expand Down Expand Up @@ -100,6 +102,7 @@ public void checkConnection() {
@Database(DatabaseType.DOCUMENT)
Playoffs playoffs;

@WithSpan
private void save(GameEvent event) {
var game = event.gameover();
var match = new GameMatch(game.gameId(),
Expand Down

0 comments on commit c2cd455

Please sign in to comment.