Package io.prometheus.client
Class SampleNameFilter
java.lang.Object
io.prometheus.client.SampleNameFilter
Filter samples (i.e. time series) by name.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionReplacement for Java 8'sPredicate.and()for compatibility with Java versions < 8.restrictToNamesEqualTo(Predicate<String> filter, Collection<String> allowedNames) Helper method to compose a filter such that Sample names must match the existing filter and be in the list of allowedNames This should be used to implement thenames[]query parameter in HTTP exporters.Helper method to deserialize adelimiter-separated list of Strings into aList<String>.boolean
-
Field Details
-
ALLOW_ALL
For convenience, a filter that allows all names.
-
-
Method Details
-
test
-
and
Replacement for Java 8'sPredicate.and()for compatibility with Java versions < 8. -
stringToList
Helper method to deserialize adelimiter-separated list of Strings into aList<String>.delimiteris one of, ; \t \n.This is implemented here so that exporters can provide a consistent configuration format for lists of allowed names.
-
restrictToNamesEqualTo
public static Predicate<String> restrictToNamesEqualTo(Predicate<String> filter, Collection<String> allowedNames) Helper method to compose a filter such that Sample names must- match the existing filter
- and be in the list of allowedNames
names[]query parameter in HTTP exporters.- Parameters:
filter- may be null, indicating that the resulting filter should just filter byallowedNames.allowedNames- may be null or empty, indicating thatfilteris returned unmodified.- Returns:
- a filter combining the exising
filterand theallowedNames, ornullif both parameters werenull.
-