mirror of
https://github.com/valitydev/exporter-limits.git
synced 2024-11-06 00:25:22 +00:00
add limit_scope_type_all Tag
This commit is contained in:
parent
7f40ca1916
commit
0a81b00342
@ -109,11 +109,15 @@ public class LimitsService {
|
||||
|
||||
@SneakyThrows
|
||||
private List<Tag> getLimitScopeTypeTags(String limitScopeTypesJson) {
|
||||
return objectMapper.readValue(limitScopeTypesJson, new TypeReference<List<Map<String, Object>>>() {
|
||||
var tags = objectMapper.readValue(limitScopeTypesJson, new TypeReference<List<Map<String, Object>>>() {
|
||||
})
|
||||
.stream()
|
||||
.flatMap(stringObjectMap -> stringObjectMap.keySet().stream())
|
||||
.map(s -> Tag.of(String.format("limit_scope_type_%s", s), "true"))
|
||||
.collect(Collectors.toList());
|
||||
if (tags.isEmpty()) {
|
||||
tags.add(Tag.of(String.format("limit_scope_type_%s", "all"), "true"));
|
||||
}
|
||||
return tags;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user