Skip to content

Commit

Permalink
allegro-internal/flex-roadmap#819 Migrated metrics to prometheus (lint)
Browse files Browse the repository at this point in the history
  • Loading branch information
nastassia-dailidava committed Oct 1, 2024
1 parent e5efd7b commit c435189
Showing 1 changed file with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ class MetricsDiscoveryServerCallbacks(private val meterRegistry: MeterRegistry)
.toMap()

connectionsByType.forEach { (type, typeConnections) ->
meterRegistry.gauge("connections", Tags.of("connection-type", "grpc", "stream-type", type.name.lowercase()), typeConnections)
meterRegistry.gauge(
"connections",
Tags.of("connection-type", "grpc", "stream-type", type.name.lowercase()),
typeConnections
)
}
}

Expand All @@ -54,7 +58,11 @@ class MetricsDiscoveryServerCallbacks(private val meterRegistry: MeterRegistry)
override fun onV3StreamRequest(streamId: Long, request: V3DiscoveryRequest) {
meterRegistry.counter(
"requests.total",
Tags.of("connection-type", "grpc", "stream-type", StreamType.fromTypeUrl(request.typeUrl).name.lowercase(), "discovery-request-type", "total")
Tags.of(
"connection-type", "grpc",
"stream-type", StreamType.fromTypeUrl(request.typeUrl).name.lowercase(),
"discovery-request-type", "total"
)
)
.increment()
}
Expand All @@ -65,7 +73,11 @@ class MetricsDiscoveryServerCallbacks(private val meterRegistry: MeterRegistry)
) {
meterRegistry.counter(
"requests.total",
Tags.of("connection-type", "grpc", "stream-type", StreamType.fromTypeUrl(request.typeUrl).name.lowercase(), "discovery-request-type", "delta")
Tags.of(
"connection-type",
"grpc", "stream-type",
StreamType.fromTypeUrl(request.typeUrl).name.lowercase(), "discovery-request-type", "delta"
)
)
.increment()
}
Expand Down

0 comments on commit c435189

Please sign in to comment.