-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into update/scalafmt-core-3.8.2
- Loading branch information
Showing
6 changed files
with
47 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
...src/main/scala/dev/nomadblacky/scalatest_otel_reporter/OpenTelemetryApiTestReporter.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package dev.nomadblacky.scalatest_otel_reporter | ||
|
||
import io.opentelemetry.api.OpenTelemetry | ||
|
||
import java.util.logging.Logger | ||
|
||
trait OpenTelemetryApiTestReporter extends OpenTelemetryTestReporter[OpenTelemetry] { | ||
private lazy val logger: Logger = Logger.getLogger(classOf[OpenTelemetryApiTestReporter].getName) | ||
|
||
protected def shutdownOtel(): Unit = { | ||
// OpenTelemetryApiTestReporter does not shutdown OpenTelemetry because OpenTelemetry API does not have a shutdown method. | ||
// If you are using something like the OpenTelemetry Java Agent, it will automatically shutdown when the process terminates. | ||
// However, in other environments, it will not run shutdown, so if the process terminates immediately after the test ends, telemetry data may be lost. | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
...src/main/scala/dev/nomadblacky/scalatest_otel_reporter/OpenTelemetrySdkTestReporter.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package dev.nomadblacky.scalatest_otel_reporter | ||
import io.opentelemetry.sdk.OpenTelemetrySdk | ||
|
||
import java.util.logging.Logger | ||
|
||
trait OpenTelemetrySdkTestReporter extends OpenTelemetryTestReporter[OpenTelemetrySdk] { | ||
private lazy val logger = Logger.getLogger(classOf[OpenTelemetrySdkTestReporter].getName) | ||
|
||
override protected def shutdownOtel(): Unit = { | ||
logger.info("Shutting down OpenTelemetry") | ||
otel.close() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters