-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FDP-94: Add monitoring and small fixes #9
Changes from 5 commits
46408ff
e6b053a
4ee659a
3e77b6a
17b5deb
5fe8938
bb3dff0
537a951
1d14ae8
72682d2
abd1b02
dfed231
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is dit voldoende om ook bijv. fail-rates uit te halen? Of moeten we wat counters toeveoegen? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is het überhaupt nodig om fouten te timen? Kunnen we niet gerichter timeouts, technische exceptions etc. 'counten'? |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package org.gxf.soapbridge.monitoring | ||
|
||
import io.micrometer.core.instrument.MeterRegistry | ||
import io.micrometer.core.instrument.Timer | ||
import org.springframework.stereotype.Service | ||
import java.time.Duration | ||
import java.time.Instant | ||
|
||
@Service | ||
class MonitoringService( | ||
private val registry: MeterRegistry | ||
) { | ||
|
||
companion object { | ||
private const val METRIC_PREFIX = "gxf.soap.bridge" | ||
} | ||
|
||
fun recordConnectionTime(startTime: Instant, context: String, successful: Boolean) { | ||
sanderv marked this conversation as resolved.
Show resolved
Hide resolved
|
||
val duration = Duration.between(startTime, Instant.now()) | ||
|
||
Timer | ||
.builder("${METRIC_PREFIX}.connection.timer") | ||
.description("Counts the successful requests to the Maki API") | ||
sanderv marked this conversation as resolved.
Show resolved
Hide resolved
|
||
.tag("context", context) | ||
.tag("successful", successful.toString()) | ||
.register(registry) | ||
.record(duration) | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mogelijk is het nuttiger om errors te tellen. Eventueel naast het meten van de duratie.