Skip to content

Commit

Permalink
Restore high-cardinality Lettuce metrics for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
jon-signal committed Feb 9, 2024
1 parent 587c385 commit c5dc01e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,14 @@ public DistributionStatisticConfig configure(final Meter.Id id, final Distributi
return defaultDistributionStatisticConfig.merge(config);
}
})
// Remove high-cardinality `command` and `remote` tags from Lettuce metrics and prepend "chat." to meter names
// Remove high-cardinality `command` tags from Lettuce metrics and prepend "chat." to meter names
.meterFilter(new MeterFilter() {
@Override
public Meter.Id map(final Meter.Id id) {
if (id.getName().startsWith("lettuce")) {
return id.withName(PREFIX + "." + id.getName())
.replaceTags(id.getTags().stream()
.filter(tag -> !"command".equals(tag.getKey()))
.filter(tag -> !"remote".equals(tag.getKey()))
.toList());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ void lettuceTagRejection() {
Meter meter = meters.get(0);
assertThat(meter.getId().getName()).isEqualTo("chat.lettuce.command.completion.max");
assertThat(meter.getId().getTag("command")).isNull();
assertThat(meter.getId().getTag("remote")).isNull();
assertThat(meter.getId().getTag("allowed")).isNotNull();
}
}

0 comments on commit c5dc01e

Please sign in to comment.