Skip to content

Commit ae04885

Browse files
allegro-internal/flex-roadmap#819 removed MetricsDiscoveryServerCallbacks, RemoteServices
1 parent 025872c commit ae04885

File tree

3 files changed

+4
-35
lines changed

3 files changed

+4
-35
lines changed

envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/server/callbacks/MetricsDiscoveryServerCallbacks.kt

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import io.micrometer.core.instrument.MeterRegistry
66
import io.micrometer.core.instrument.Tags
77
import pl.allegro.tech.servicemesh.envoycontrol.utils.CONNECTIONS_METRIC
88
import pl.allegro.tech.servicemesh.envoycontrol.utils.CONNECTION_TYPE_TAG
9-
import pl.allegro.tech.servicemesh.envoycontrol.utils.DISCOVERY_REQ_TYPE_TAG
10-
import pl.allegro.tech.servicemesh.envoycontrol.utils.REQUESTS_METRIC
119
import pl.allegro.tech.servicemesh.envoycontrol.utils.STREAM_TYPE_TAG
1210
import java.util.concurrent.atomic.AtomicInteger
1311
import io.envoyproxy.envoy.service.discovery.v3.DeltaDiscoveryRequest as V3DeltaDiscoveryRequest
@@ -60,30 +58,14 @@ class MetricsDiscoveryServerCallbacks(private val meterRegistry: MeterRegistry)
6058
}
6159

6260
override fun onV3StreamRequest(streamId: Long, request: V3DiscoveryRequest) {
63-
meterRegistry.counter(
64-
REQUESTS_METRIC,
65-
Tags.of(
66-
CONNECTION_TYPE_TAG, "grpc",
67-
STREAM_TYPE_TAG, StreamType.fromTypeUrl(request.typeUrl).name.lowercase(),
68-
DISCOVERY_REQ_TYPE_TAG, "total"
69-
)
70-
)
71-
.increment()
61+
// noop
7262
}
7363

7464
override fun onV3StreamDeltaRequest(
7565
streamId: Long,
7666
request: V3DeltaDiscoveryRequest
7767
) {
78-
meterRegistry.counter(
79-
REQUESTS_METRIC,
80-
Tags.of(
81-
CONNECTION_TYPE_TAG, "grpc",
82-
STREAM_TYPE_TAG, StreamType.fromTypeUrl(request.typeUrl).name.lowercase(),
83-
DISCOVERY_REQ_TYPE_TAG, "delta"
84-
)
85-
)
86-
.increment()
68+
// noop
8769
}
8870

8971
override fun onStreamCloseWithError(streamId: Long, typeUrl: String, error: Throwable) {

envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/synchronization/RemoteServices.kt

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import pl.allegro.tech.servicemesh.envoycontrol.utils.CROSS_DC_SYNC_CANCELLED_ME
1313
import pl.allegro.tech.servicemesh.envoycontrol.utils.CROSS_DC_SYNC_SECONDS_METRIC
1414
import pl.allegro.tech.servicemesh.envoycontrol.utils.CROSS_DC_SYNC_TOTAL_METRIC
1515
import pl.allegro.tech.servicemesh.envoycontrol.utils.OPERATION_TAG
16-
import pl.allegro.tech.servicemesh.envoycontrol.utils.SERVICES_STATE_ERRORS_METRIC
1716
import reactor.core.publisher.Flux
1817
import reactor.core.publisher.FluxSink
1918
import java.lang.Integer.max
@@ -70,13 +69,6 @@ class RemoteServices(
7069
.thenApply { servicesStateFromCluster(cluster, it) }
7170
.orTimeout(interval, TimeUnit.SECONDS)
7271
.exceptionally {
73-
meterRegistry.counter(
74-
SERVICES_STATE_ERRORS_METRIC,
75-
Tags.of(
76-
CLUSTER_TAG, cluster,
77-
OPERATION_TAG, "get-state"
78-
)
79-
).increment()
8072
logger.warn("Error synchronizing instances ${it.message}", it)
8173
clusterStateCache[cluster]
8274
}
@@ -87,13 +79,6 @@ class RemoteServices(
8779
val instances = controlPlaneInstanceFetcher.instances(cluster)
8880
cluster to instances
8981
} catch (e: Exception) {
90-
meterRegistry.counter(
91-
SERVICES_STATE_ERRORS_METRIC,
92-
Tags.of(
93-
CLUSTER_TAG, cluster,
94-
OPERATION_TAG, "get-instances"
95-
)
96-
).increment()
9782
logger.warn("Failed fetching instances from $cluster", e)
9883
cluster to emptyList()
9984
}

envoy-control-tests/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/MetricsDiscoveryServerCallbacksTest.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package pl.allegro.tech.servicemesh.envoycontrol
22

33
import io.micrometer.core.instrument.Tags
44
import org.assertj.core.api.Assertions.assertThat
5+
import org.junit.jupiter.api.Disabled
56
import org.junit.jupiter.api.Test
67
import org.junit.jupiter.api.extension.RegisterExtension
78
import pl.allegro.tech.servicemesh.envoycontrol.assertions.untilAsserted
@@ -205,6 +206,7 @@ class DeltaAdsMetricsDiscoveryServerCallbackTest : MetricsDiscoveryServerCallbac
205206
)
206207
}
207208

209+
@Disabled
208210
interface MetricsDiscoveryServerCallbacksTest {
209211
companion object {
210212
private val logger by logger()

0 commit comments

Comments
 (0)