Skip to content

Commit

Permalink
fix span scope on current thread
Browse files Browse the repository at this point in the history
  • Loading branch information
jade-vogt committed Sep 17, 2023
1 parent 6df7e87 commit 59c703d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>best.tigers</groupId>
<artifactId>tigersbot</artifactId>
<version>1.3.2</version>
<version>1.3.3</version>
<properties>
<maven.compiler.source>19</maven.compiler.source>
<maven.compiler.target>19</maven.compiler.target>
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/best/tigers/tigersbot/services/BotService.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import best.tigers.tigersbot.util.Environment;
import best.tigers.tigersbot.util.Log;
import co.elastic.apm.api.ElasticApm;
import co.elastic.apm.api.Scope;
import co.elastic.apm.api.Transaction;
import com.pengrad.telegrambot.TelegramBot;
import com.pengrad.telegrambot.UpdatesListener;
Expand Down Expand Up @@ -55,7 +56,7 @@ private void processUpdate(Update update) {
for (var handler : handlers) {
if (handler.invokationTest(message)) {
Transaction transaction = ElasticApm.startTransaction();
try {
try (Scope scope = transaction.activate()){
transaction.setName(handler.getClass().getSimpleName());
transaction.setType(Transaction.TYPE_REQUEST);
handler.handle(message);
Expand Down

0 comments on commit 59c703d

Please sign in to comment.