From b2dfebda07f7adf5dd5db4bdff5480b61d13f635 Mon Sep 17 00:00:00 2001 From: "nastassia.dailidava" Date: Sat, 19 Oct 2024 21:06:22 +0200 Subject: [PATCH] allegro-internal/flex-roadmap#819 returned all other metrics (FIXES) --- .../servicemesh/envoycontrol/snapshot/SnapshotUpdater.kt | 4 +--- .../envoycontrol/synchronization/RemoteServices.kt | 7 ++----- .../envoycontrol/snapshot/SnapshotUpdaterTest.kt | 4 +--- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/SnapshotUpdater.kt b/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/SnapshotUpdater.kt index 720845943..63bd0e7a3 100644 --- a/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/SnapshotUpdater.kt +++ b/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/SnapshotUpdater.kt @@ -12,7 +12,6 @@ import pl.allegro.tech.servicemesh.envoycontrol.logger import pl.allegro.tech.servicemesh.envoycontrol.services.MultiClusterState import pl.allegro.tech.servicemesh.envoycontrol.utils.CHECKPOINT_TAG import pl.allegro.tech.servicemesh.envoycontrol.utils.COMMUNICATION_MODE_ERROR_METRIC -import pl.allegro.tech.servicemesh.envoycontrol.utils.METRIC_EMITTER_TAG import pl.allegro.tech.servicemesh.envoycontrol.utils.OPERATION_TAG import pl.allegro.tech.servicemesh.envoycontrol.utils.ParallelizableScheduler import pl.allegro.tech.servicemesh.envoycontrol.utils.SERVICES_STATE_METRIC @@ -186,8 +185,7 @@ class SnapshotUpdater( SNAPSHOT_GROUP_ERROR_METRIC, Tags.of( SERVICE_TAG, group.serviceName, - OPERATION_TAG, "create-snapshot", - METRIC_EMITTER_TAG, "snapshot-updater" + OPERATION_TAG, "create-snapshot" ) ).increment() logger.error("Unable to create snapshot for group ${group.serviceName}", e) diff --git a/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/synchronization/RemoteServices.kt b/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/synchronization/RemoteServices.kt index 91f073f8a..050ba1c74 100644 --- a/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/synchronization/RemoteServices.kt +++ b/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/synchronization/RemoteServices.kt @@ -12,7 +12,6 @@ import pl.allegro.tech.servicemesh.envoycontrol.utils.CLUSTER_TAG import pl.allegro.tech.servicemesh.envoycontrol.utils.CROSS_DC_SYNC_CANCELLED_METRIC import pl.allegro.tech.servicemesh.envoycontrol.utils.CROSS_DC_SYNC_SECONDS_METRIC import pl.allegro.tech.servicemesh.envoycontrol.utils.CROSS_DC_SYNC_TOTAL_METRIC -import pl.allegro.tech.servicemesh.envoycontrol.utils.METRIC_EMITTER_TAG import pl.allegro.tech.servicemesh.envoycontrol.utils.OPERATION_TAG import pl.allegro.tech.servicemesh.envoycontrol.utils.SERVICES_STATE_ERRORS_METRIC import reactor.core.publisher.Flux @@ -75,8 +74,7 @@ class RemoteServices( SERVICES_STATE_ERRORS_METRIC, Tags.of( CLUSTER_TAG, cluster, - OPERATION_TAG, "get-state", - METRIC_EMITTER_TAG, "cross-dc-synchronization" + OPERATION_TAG, "get-state" ) ).increment() logger.warn("Error synchronizing instances ${it.message}", it) @@ -93,8 +91,7 @@ class RemoteServices( SERVICES_STATE_ERRORS_METRIC, Tags.of( CLUSTER_TAG, cluster, - OPERATION_TAG, "get-instances", - METRIC_EMITTER_TAG, "cross-dc-synchronization" + OPERATION_TAG, "get-instances" ) ).increment() logger.warn("Failed fetching instances from $cluster", e) diff --git a/envoy-control-core/src/test/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/SnapshotUpdaterTest.kt b/envoy-control-core/src/test/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/SnapshotUpdaterTest.kt index aa984a880..fd8b9b4bf 100644 --- a/envoy-control-core/src/test/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/SnapshotUpdaterTest.kt +++ b/envoy-control-core/src/test/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/SnapshotUpdaterTest.kt @@ -57,7 +57,6 @@ import pl.allegro.tech.servicemesh.envoycontrol.snapshot.resource.routes.EnvoyIn import pl.allegro.tech.servicemesh.envoycontrol.snapshot.resource.routes.RequestPolicyMapper import pl.allegro.tech.servicemesh.envoycontrol.snapshot.resource.routes.ServiceTagMetadataGenerator import pl.allegro.tech.servicemesh.envoycontrol.utils.DirectScheduler -import pl.allegro.tech.servicemesh.envoycontrol.utils.METRIC_EMITTER_TAG import pl.allegro.tech.servicemesh.envoycontrol.utils.OPERATION_TAG import pl.allegro.tech.servicemesh.envoycontrol.utils.ParallelScheduler import pl.allegro.tech.servicemesh.envoycontrol.utils.ParallelizableScheduler @@ -477,8 +476,7 @@ class SnapshotUpdaterTest { .tags( Tags.of( SERVICE_TAG, "example-service", - OPERATION_TAG, "create-snapshot", - METRIC_EMITTER_TAG, "snapshot-updater" + OPERATION_TAG, "create-snapshot" ) ) .counter()?.count()