Skip to content

Commit cd0f215

Browse files
Fixed metric names (#438)
* allegro-internal/flex-roadmap#819 changed names
1 parent f43cedc commit cd0f215

File tree

14 files changed

+97
-104
lines changed

14 files changed

+97
-104
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
Lists all changes with user impact.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
5+
## [0.22.3]
6+
### Changed
7+
- Changed names of some metrics
8+
59
## [0.22.2]
610
### Changed
711
- Migrated metrics to prometheus

envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/groups/GroupChangeWatcher.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import io.envoyproxy.controlplane.cache.XdsRequest
1010
import io.micrometer.core.instrument.MeterRegistry
1111
import pl.allegro.tech.servicemesh.envoycontrol.EnvoyControlMetrics
1212
import pl.allegro.tech.servicemesh.envoycontrol.logger
13+
import pl.allegro.tech.servicemesh.envoycontrol.utils.CHANGE_WATCHER_METRIC
1314
import pl.allegro.tech.servicemesh.envoycontrol.utils.measureBuffer
14-
import pl.allegro.tech.servicemesh.envoycontrol.utils.REACTOR_METRIC
1515
import pl.allegro.tech.servicemesh.envoycontrol.utils.WATCH_TYPE_TAG
1616
import reactor.core.publisher.Flux
1717
import reactor.core.publisher.FluxSink
@@ -38,7 +38,7 @@ internal class GroupChangeWatcher(
3838
return groupsChanged
3939
.measureBuffer("group-change-watcher", meterRegistry)
4040
.checkpoint("group-change-watcher-emitted")
41-
.name(REACTOR_METRIC)
41+
.name(CHANGE_WATCHER_METRIC)
4242
.tag(WATCH_TYPE_TAG, "group")
4343
.metrics()
4444
.doOnSubscribe {

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ package pl.allegro.tech.servicemesh.envoycontrol.server.callbacks
22

33
import io.envoyproxy.controlplane.cache.Resources
44
import io.envoyproxy.controlplane.server.DiscoveryServerCallbacks
5-
import io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest as V3DiscoveryRequest
6-
import io.envoyproxy.envoy.service.discovery.v3.DeltaDiscoveryRequest as V3DeltaDiscoveryRequest
75
import io.micrometer.core.instrument.MeterRegistry
86
import io.micrometer.core.instrument.Tags
9-
import pl.allegro.tech.servicemesh.envoycontrol.utils.CONNECTION_TYPE_TAG
107
import pl.allegro.tech.servicemesh.envoycontrol.utils.CONNECTIONS_METRIC
8+
import pl.allegro.tech.servicemesh.envoycontrol.utils.CONNECTION_TYPE_TAG
119
import pl.allegro.tech.servicemesh.envoycontrol.utils.DISCOVERY_REQ_TYPE_TAG
1210
import pl.allegro.tech.servicemesh.envoycontrol.utils.REQUESTS_METRIC
1311
import pl.allegro.tech.servicemesh.envoycontrol.utils.STREAM_TYPE_TAG
1412
import java.util.concurrent.atomic.AtomicInteger
13+
import io.envoyproxy.envoy.service.discovery.v3.DeltaDiscoveryRequest as V3DeltaDiscoveryRequest
14+
import io.envoyproxy.envoy.service.discovery.v3.DiscoveryRequest as V3DiscoveryRequest
1515

1616
class MetricsDiscoveryServerCallbacks(private val meterRegistry: MeterRegistry) : DiscoveryServerCallbacks {
1717

envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/SnapshotUpdater.kt

Lines changed: 27 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,17 @@ import pl.allegro.tech.servicemesh.envoycontrol.groups.CommunicationMode.XDS
1010
import pl.allegro.tech.servicemesh.envoycontrol.groups.Group
1111
import pl.allegro.tech.servicemesh.envoycontrol.logger
1212
import pl.allegro.tech.servicemesh.envoycontrol.services.MultiClusterState
13-
import pl.allegro.tech.servicemesh.envoycontrol.utils.ERRORS_TOTAL_METRIC
14-
import pl.allegro.tech.servicemesh.envoycontrol.utils.METRIC_EMITTER_TAG
13+
import pl.allegro.tech.servicemesh.envoycontrol.utils.CHECKPOINT_TAG
14+
import pl.allegro.tech.servicemesh.envoycontrol.utils.COMMUNICATION_MODE_ERROR_METRIC
1515
import pl.allegro.tech.servicemesh.envoycontrol.utils.OPERATION_TAG
1616
import pl.allegro.tech.servicemesh.envoycontrol.utils.ParallelizableScheduler
17-
import pl.allegro.tech.servicemesh.envoycontrol.utils.REACTOR_METRIC
17+
import pl.allegro.tech.servicemesh.envoycontrol.utils.SERVICES_STATE_METRIC
1818
import pl.allegro.tech.servicemesh.envoycontrol.utils.SERVICE_TAG
1919
import pl.allegro.tech.servicemesh.envoycontrol.utils.SIMPLE_CACHE_METRIC
20-
import pl.allegro.tech.servicemesh.envoycontrol.utils.SNAPSHOT_STATUS_TAG
21-
import pl.allegro.tech.servicemesh.envoycontrol.utils.STATUS_TAG
20+
import pl.allegro.tech.servicemesh.envoycontrol.utils.SNAPSHOT_ERROR_METRIC
21+
import pl.allegro.tech.servicemesh.envoycontrol.utils.SNAPSHOT_GROUP_ERROR_METRIC
22+
import pl.allegro.tech.servicemesh.envoycontrol.utils.SNAPSHOT_METRIC
23+
import pl.allegro.tech.servicemesh.envoycontrol.utils.SNAPSHOT_UPDATE_DURATION_METRIC
2224
import pl.allegro.tech.servicemesh.envoycontrol.utils.UPDATE_TRIGGER_TAG
2325
import pl.allegro.tech.servicemesh.envoycontrol.utils.doOnNextScheduledOn
2426
import pl.allegro.tech.servicemesh.envoycontrol.utils.measureBuffer
@@ -60,12 +62,10 @@ class SnapshotUpdater(
6062
// step 2: only watches groups. if groups change we use the last services state and update those groups
6163
groups().subscribeOn(globalSnapshotScheduler)
6264
)
63-
.measureBuffer("snapshot-updater", meterRegistry, innerSources = 2)
65+
.measureBuffer("snapshot-updater-merged", meterRegistry, innerSources = 2)
6466
.checkpoint("snapshot-updater-merged")
65-
.name(REACTOR_METRIC)
66-
.tag(METRIC_EMITTER_TAG, "snapshot-updater")
67-
.tag(SNAPSHOT_STATUS_TAG, "merged")
68-
.tag(UPDATE_TRIGGER_TAG, "global")
67+
.name(SNAPSHOT_METRIC)
68+
.tag(CHECKPOINT_TAG, "merged")
6969
.metrics()
7070
// step 3: group updates don't provide a snapshot,
7171
// so we piggyback the last updated snapshot state for use
@@ -101,20 +101,17 @@ class SnapshotUpdater(
101101
// see GroupChangeWatcher
102102
return onGroupAdded
103103
.publishOn(globalSnapshotScheduler)
104-
.measureBuffer("snapshot-updater", meterRegistry)
104+
.measureBuffer("snapshot-updater-groups-published", meterRegistry)
105105
.checkpoint("snapshot-updater-groups-published")
106+
.name(SNAPSHOT_METRIC)
107+
.tag(CHECKPOINT_TAG, "published")
108+
.metrics()
106109
.map { groups ->
107110
UpdateResult(action = Action.SERVICES_GROUP_ADDED, groups = groups)
108111
}
109-
.name(REACTOR_METRIC)
110-
.tag(METRIC_EMITTER_TAG, "snapshot-updater")
111-
.tag(SNAPSHOT_STATUS_TAG, "published")
112-
.tag(UPDATE_TRIGGER_TAG, "groups")
113-
.metrics()
114112
.onErrorResume { e ->
115113
meterRegistry.counter(
116-
ERRORS_TOTAL_METRIC,
117-
Tags.of(UPDATE_TRIGGER_TAG, "groups", METRIC_EMITTER_TAG, "snapshot-updater")
114+
SNAPSHOT_ERROR_METRIC, Tags.of(UPDATE_TRIGGER_TAG, "groups")
118115
)
119116
.increment()
120117
logger.error("Unable to process new group", e)
@@ -124,17 +121,16 @@ class SnapshotUpdater(
124121

125122
internal fun services(states: Flux<MultiClusterState>): Flux<UpdateResult> {
126123
return states
127-
.name(REACTOR_METRIC)
128-
.tag(UPDATE_TRIGGER_TAG, "services")
129-
.tag(STATUS_TAG, "sampled")
130-
.onBackpressureLatestMeasured("snapshot-updater", meterRegistry)
124+
.name(SERVICES_STATE_METRIC)
125+
.tag(CHECKPOINT_TAG, "sampled")
126+
.metrics()
127+
.onBackpressureLatestMeasured("snapshot-updater-services-sampled", meterRegistry)
131128
// prefetch = 1, instead of default 256, to avoid processing stale states in case of backpressure
132129
.publishOn(globalSnapshotScheduler, 1)
133-
.measureBuffer("snapshot-updater", meterRegistry)
130+
.measureBuffer("snapshot-updater-services-published", meterRegistry)
134131
.checkpoint("snapshot-updater-services-published")
135-
.name(REACTOR_METRIC)
136-
.tag(UPDATE_TRIGGER_TAG, "services")
137-
.tag(STATUS_TAG, "published")
132+
.name(SERVICES_STATE_METRIC)
133+
.tag(CHECKPOINT_TAG, "published")
138134
.metrics()
139135
.createClusterConfigurations()
140136
.map { (states, clusters) ->
@@ -163,8 +159,7 @@ class SnapshotUpdater(
163159
.filter { it != emptyUpdateResult }
164160
.onErrorResume { e ->
165161
meterRegistry.counter(
166-
ERRORS_TOTAL_METRIC,
167-
Tags.of(METRIC_EMITTER_TAG, "snapshot-updater", UPDATE_TRIGGER_TAG, "services")
162+
SNAPSHOT_ERROR_METRIC, Tags.of(UPDATE_TRIGGER_TAG, "services")
168163
).increment()
169164
logger.error("Unable to process service changes", e)
170165
Mono.justOrEmpty(UpdateResult(action = Action.ERROR_PROCESSING_CHANGES))
@@ -187,18 +182,17 @@ class SnapshotUpdater(
187182
}
188183
} catch (e: Throwable) {
189184
meterRegistry.counter(
190-
ERRORS_TOTAL_METRIC,
185+
SNAPSHOT_GROUP_ERROR_METRIC,
191186
Tags.of(
192187
SERVICE_TAG, group.serviceName,
193-
OPERATION_TAG, "create-snapshot",
194-
METRIC_EMITTER_TAG, "snapshot-updater"
188+
OPERATION_TAG, "create-snapshot"
195189
)
196190
).increment()
197191
logger.error("Unable to create snapshot for group ${group.serviceName}", e)
198192
}
199193
}
200194

201-
private val updateSnapshotForGroupsTimer = meterRegistry.timer("snapshot.update.duration.seconds")
195+
private val updateSnapshotForGroupsTimer = meterRegistry.timer(SNAPSHOT_UPDATE_DURATION_METRIC)
202196

203197
private fun updateSnapshotForGroups(
204198
groups: Collection<Group>,
@@ -213,7 +207,7 @@ class SnapshotUpdater(
213207
} else if (result.xdsSnapshot != null && group.communicationMode == XDS) {
214208
updateSnapshotForGroup(group, result.xdsSnapshot)
215209
} else {
216-
meterRegistry.counter(ERRORS_TOTAL_METRIC, Tags.of("type", "communication-mode")).increment()
210+
meterRegistry.counter(COMMUNICATION_MODE_ERROR_METRIC).increment()
217211
logger.error(
218212
"Requested snapshot for ${group.communicationMode.name} mode, but it is not here. " +
219213
"Handling Envoy with not supported communication mode should have been rejected before." +

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import pl.allegro.tech.servicemesh.envoycontrol.services.ClusterStateChanges
55
import pl.allegro.tech.servicemesh.envoycontrol.services.MultiClusterState
66
import pl.allegro.tech.servicemesh.envoycontrol.services.MultiClusterState.Companion.toMultiClusterState
77
import pl.allegro.tech.servicemesh.envoycontrol.utils.CHECKPOINT_TAG
8-
import pl.allegro.tech.servicemesh.envoycontrol.utils.METRIC_EMITTER_TAG
9-
import pl.allegro.tech.servicemesh.envoycontrol.utils.REACTOR_METRIC
8+
import pl.allegro.tech.servicemesh.envoycontrol.utils.SERVICES_STATE_METRIC
109
import pl.allegro.tech.servicemesh.envoycontrol.utils.logSuppressedError
1110
import pl.allegro.tech.servicemesh.envoycontrol.utils.measureBuffer
1211
import pl.allegro.tech.servicemesh.envoycontrol.utils.onBackpressureLatestMeasured
@@ -47,8 +46,8 @@ class GlobalStateChanges(
4746
.logSuppressedError("combineLatest() suppressed exception")
4847
.measureBuffer("global-service-changes-combinator", meterRegistry)
4948
.checkpoint("global-service-changes-emitted")
50-
.name(REACTOR_METRIC)
51-
.tag(METRIC_EMITTER_TAG, "global-service-changes-combinator")
49+
.name(SERVICES_STATE_METRIC)
50+
.tag(CHECKPOINT_TAG, "combined")
5251
.metrics()
5352
}
5453

@@ -76,12 +75,13 @@ class GlobalStateChanges(
7675
.logSuppressedError("combineLatest() suppressed exception")
7776
.measureBuffer("global-service-changes-combine-latest", meterRegistry)
7877
.checkpoint("global-service-changes-emitted")
79-
.name(REACTOR_METRIC)
80-
.tag(METRIC_EMITTER_TAG, "global-service-changes")
78+
.name(SERVICES_STATE_METRIC)
8179
.tag(CHECKPOINT_TAG, "emitted")
80+
.metrics()
8281
.onBackpressureLatestMeasured("global-service-changes-backpressure", meterRegistry)
8382
.publishOn(scheduler, 1)
8483
.checkpoint("global-service-changes-published")
84+
.name(SERVICES_STATE_METRIC)
8585
.tag(CHECKPOINT_TAG, "published")
8686
.metrics()
8787
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package pl.allegro.tech.servicemesh.envoycontrol.synchronization
33
import pl.allegro.tech.servicemesh.envoycontrol.EnvoyControlProperties
44
import pl.allegro.tech.servicemesh.envoycontrol.services.ClusterStateChanges
55
import pl.allegro.tech.servicemesh.envoycontrol.services.MultiClusterState
6-
import pl.allegro.tech.servicemesh.envoycontrol.utils.METRIC_EMITTER_TAG
7-
import pl.allegro.tech.servicemesh.envoycontrol.utils.REACTOR_METRIC
6+
import pl.allegro.tech.servicemesh.envoycontrol.utils.CHECKPOINT_TAG
7+
import pl.allegro.tech.servicemesh.envoycontrol.utils.SERVICES_STATE_METRIC
88
import reactor.core.publisher.Flux
99

1010
class RemoteClusterStateChanges(
@@ -16,7 +16,7 @@ class RemoteClusterStateChanges(
1616
.getChanges(properties.sync.pollingInterval)
1717
.startWith(MultiClusterState.empty())
1818
.distinctUntilChanged()
19-
.name(REACTOR_METRIC)
20-
.tag(METRIC_EMITTER_TAG, "cross-dc-synchronisation")
19+
.name(SERVICES_STATE_METRIC)
20+
.tag(CHECKPOINT_TAG, "cross-dc")
2121
.metrics()
2222
}

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

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ import pl.allegro.tech.servicemesh.envoycontrol.utils.CLUSTER_TAG
1212
import pl.allegro.tech.servicemesh.envoycontrol.utils.CROSS_DC_SYNC_CANCELLED_METRIC
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
15-
import pl.allegro.tech.servicemesh.envoycontrol.utils.ERRORS_TOTAL_METRIC
1615
import pl.allegro.tech.servicemesh.envoycontrol.utils.OPERATION_TAG
17-
import pl.allegro.tech.servicemesh.envoycontrol.utils.METRIC_EMITTER_TAG
16+
import pl.allegro.tech.servicemesh.envoycontrol.utils.SERVICES_STATE_ERRORS_METRIC
1817
import reactor.core.publisher.Flux
1918
import reactor.core.publisher.FluxSink
2019
import java.lang.Integer.max
@@ -72,11 +71,10 @@ class RemoteServices(
7271
.orTimeout(interval, TimeUnit.SECONDS)
7372
.exceptionally {
7473
meterRegistry.counter(
75-
ERRORS_TOTAL_METRIC,
74+
SERVICES_STATE_ERRORS_METRIC,
7675
Tags.of(
7776
CLUSTER_TAG, cluster,
78-
OPERATION_TAG, "get-state",
79-
METRIC_EMITTER_TAG, "cross-dc-synchronization"
77+
OPERATION_TAG, "get-state"
8078
)
8179
).increment()
8280
logger.warn("Error synchronizing instances ${it.message}", it)
@@ -90,11 +88,10 @@ class RemoteServices(
9088
cluster to instances
9189
} catch (e: Exception) {
9290
meterRegistry.counter(
93-
ERRORS_TOTAL_METRIC,
91+
SERVICES_STATE_ERRORS_METRIC,
9492
Tags.of(
9593
CLUSTER_TAG, cluster,
96-
OPERATION_TAG, "get-instances",
97-
METRIC_EMITTER_TAG, "cross-dc-synchronization"
94+
OPERATION_TAG, "get-instances"
9895
)
9996
).increment()
10097
logger.warn("Failed fetching instances from $cluster", e)

envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/utils/Metrics.kt

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,19 @@ import io.micrometer.core.instrument.Tags
55
import io.micrometer.core.instrument.noop.NoopTimer
66

77
val noopTimer = NoopTimer(Meter.Id("", Tags.empty(), null, null, Meter.Type.TIMER))
8-
const val REACTOR_METRIC = "reactor"
9-
const val ERRORS_TOTAL_METRIC = "errors.total"
10-
const val CONNECTIONS_METRIC = "connections"
11-
const val REQUESTS_METRIC = "requests.total"
12-
const val WATCH_METRIC = "watch"
8+
const val REACTOR_METRIC = "reactor.stream.stats"
9+
const val REACTOR_DISCARDED_METRIC = "reactor.stream.discarded"
10+
const val SERVICES_STATE_METRIC = "services.state"
11+
const val SERVICES_STATE_ERRORS_METRIC = "services.state.errors.total"
12+
const val SNAPSHOT_METRIC = "snapshot"
13+
const val SNAPSHOT_UPDATE_DURATION_METRIC = "snapshot.update.duration.seconds"
14+
const val SNAPSHOT_ERROR_METRIC = "snapshot.errors"
15+
const val SNAPSHOT_GROUP_ERROR_METRIC = "snapshot.group.errors.total"
16+
const val COMMUNICATION_MODE_ERROR_METRIC = "communication.errors.total"
17+
const val CONNECTIONS_METRIC = "connection.stats"
18+
const val REQUESTS_METRIC = "request.stats"
19+
const val WATCH_ERRORS_METRIC = "services.watch.errors.total"
20+
const val WATCH_METRIC = "services.watch"
1321
const val ENVOY_CONTROL_WARM_UP_METRIC = "envoy.control.warmup.seconds"
1422
const val CROSS_DC_SYNC_METRIC = "cross.dc.synchronization"
1523
const val CROSS_DC_SYNC_CANCELLED_METRIC = "$CROSS_DC_SYNC_METRIC.cancelled.total"
@@ -19,6 +27,7 @@ const val SIMPLE_CACHE_METRIC = "simple.cache.duration.seconds"
1927
const val PROTOBUF_CACHE_METRIC = "protobuf.cache.serialize.time"
2028
const val CACHE_GROUP_COUNT_METRIC = "cache.groups.count"
2129
const val SNAPSHOT_FACTORY_SECONDS_METRIC = "snapshot.factory.seconds"
30+
const val CHANGE_WATCHER_METRIC = "group.change.watcher"
2231

2332
const val CONNECTION_TYPE_TAG = "connection-type"
2433
const val STREAM_TYPE_TAG = "stream-type"
@@ -27,7 +36,6 @@ const val WATCH_TYPE_TAG = "watch-type"
2736
const val DISCOVERY_REQ_TYPE_TAG = "discovery-request-type"
2837
const val METRIC_TYPE_TAG = "metric-type"
2938
const val METRIC_EMITTER_TAG = "metric-emitter"
30-
const val SNAPSHOT_STATUS_TAG = "snapshot-status"
3139
const val UPDATE_TRIGGER_TAG = "update-trigger"
3240
const val SERVICE_TAG = "service"
3341
const val OPERATION_TAG = "operation"

envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/utils/ReactorUtils.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ fun <T> Flux<T>.measureBuffer(
5252
fun <T> Flux<T>.measureDiscardedItems(name: String, meterRegistry: MeterRegistry): Flux<T> = this
5353
.doOnDiscard(Any::class.java) {
5454
meterRegistry.counter(
55-
REACTOR_METRIC,
56-
METRIC_TYPE_TAG, "discarded-items",
55+
REACTOR_DISCARDED_METRIC,
5756
METRIC_EMITTER_TAG, name
5857
).increment()
5958
}

envoy-control-core/src/test/kotlin/pl/allegro/tech/servicemesh/envoycontrol/snapshot/SnapshotUpdaterTest.kt

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,12 @@ import pl.allegro.tech.servicemesh.envoycontrol.snapshot.resource.routes.EnvoyIn
5757
import pl.allegro.tech.servicemesh.envoycontrol.snapshot.resource.routes.RequestPolicyMapper
5858
import pl.allegro.tech.servicemesh.envoycontrol.snapshot.resource.routes.ServiceTagMetadataGenerator
5959
import pl.allegro.tech.servicemesh.envoycontrol.utils.DirectScheduler
60+
import pl.allegro.tech.servicemesh.envoycontrol.utils.OPERATION_TAG
6061
import pl.allegro.tech.servicemesh.envoycontrol.utils.ParallelScheduler
6162
import pl.allegro.tech.servicemesh.envoycontrol.utils.ParallelizableScheduler
62-
import pl.allegro.tech.servicemesh.envoycontrol.utils.any
63-
import pl.allegro.tech.servicemesh.envoycontrol.utils.ERRORS_TOTAL_METRIC
64-
import pl.allegro.tech.servicemesh.envoycontrol.utils.METRIC_EMITTER_TAG
65-
import pl.allegro.tech.servicemesh.envoycontrol.utils.OPERATION_TAG
6663
import pl.allegro.tech.servicemesh.envoycontrol.utils.SERVICE_TAG
64+
import pl.allegro.tech.servicemesh.envoycontrol.utils.SNAPSHOT_GROUP_ERROR_METRIC
65+
import pl.allegro.tech.servicemesh.envoycontrol.utils.any
6766
import reactor.core.publisher.Flux
6867
import reactor.core.publisher.Mono
6968
import reactor.core.scheduler.Schedulers
@@ -473,8 +472,13 @@ class SnapshotUpdaterTest {
473472
val snapshot = cache.getSnapshot(servicesGroup)
474473
assertThat(snapshot).isEqualTo(null)
475474
assertThat(
476-
simpleMeterRegistry.find(ERRORS_TOTAL_METRIC)
477-
.tags(Tags.of(SERVICE_TAG, "example-service", OPERATION_TAG, "create-snapshot", METRIC_EMITTER_TAG, "snapshot-updater"))
475+
simpleMeterRegistry.find(SNAPSHOT_GROUP_ERROR_METRIC)
476+
.tags(
477+
Tags.of(
478+
SERVICE_TAG, "example-service",
479+
OPERATION_TAG, "create-snapshot"
480+
)
481+
)
478482
.counter()?.count()
479483
).isEqualTo(1.0)
480484
}

0 commit comments

Comments
 (0)