Package io.prometheus.client
Class SampleNameFilter.Builder
- java.lang.Object
-
- io.prometheus.client.SampleNameFilter.Builder
-
- Enclosing class:
- SampleNameFilter
public static class SampleNameFilter.Builder extends Object
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SampleNameFilter
build()
SampleNameFilter.Builder
nameMustBeEqualTo(String... names)
SampleNameFilter.Builder
nameMustBeEqualTo(Collection<String> names)
Only samples with one of thenames
will be included.SampleNameFilter.Builder
nameMustNotBeEqualTo(String... names)
SampleNameFilter.Builder
nameMustNotBeEqualTo(Collection<String> names)
All samples that are not innames
will be excluded.SampleNameFilter.Builder
nameMustNotStartWith(String... prefixes)
SampleNameFilter.Builder
nameMustNotStartWith(Collection<String> prefixes)
Samples with names starting with one of theprefixes
will be excluded.SampleNameFilter.Builder
nameMustStartWith(String... prefixes)
SampleNameFilter.Builder
nameMustStartWith(Collection<String> prefixes)
Only samples whose name starts with one of theprefixes
will be included.
-
-
-
Constructor Detail
-
Builder
public Builder()
-
-
Method Detail
-
nameMustBeEqualTo
public SampleNameFilter.Builder nameMustBeEqualTo(String... names)
- See Also:
nameMustBeEqualTo(Collection)
-
nameMustBeEqualTo
public SampleNameFilter.Builder nameMustBeEqualTo(Collection<String> names)
Only samples with one of thenames
will be included.Note that the provided
names
will be matched against the sample name (i.e. the time series name) and not the metric name. For instance, to retrieve all samples from a histogram, you must include the '_count', '_sum' and '_bucket' names.This method should be used by HTTP exporters to implement the
?name[]=
URL parameters.- Parameters:
names
- empty means no restriction.
-
nameMustNotBeEqualTo
public SampleNameFilter.Builder nameMustNotBeEqualTo(String... names)
- See Also:
nameMustNotBeEqualTo(Collection)
-
nameMustNotBeEqualTo
public SampleNameFilter.Builder nameMustNotBeEqualTo(Collection<String> names)
All samples that are not innames
will be excluded.Note that the provided
names
will be matched against the sample name (i.e. the time series name) and not the metric name. For instance, to exclude all samples from a histogram, you must exclude the '_count', '_sum' and '_bucket' names.- Parameters:
names
- empty means no name will be excluded.
-
nameMustStartWith
public SampleNameFilter.Builder nameMustStartWith(String... prefixes)
- See Also:
nameMustStartWith(Collection)
-
nameMustStartWith
public SampleNameFilter.Builder nameMustStartWith(Collection<String> prefixes)
Only samples whose name starts with one of theprefixes
will be included.- Parameters:
prefixes
- empty means no restriction.
-
nameMustNotStartWith
public SampleNameFilter.Builder nameMustNotStartWith(String... prefixes)
- See Also:
nameMustNotStartWith(Collection)
-
nameMustNotStartWith
public SampleNameFilter.Builder nameMustNotStartWith(Collection<String> prefixes)
Samples with names starting with one of theprefixes
will be excluded.- Parameters:
prefixes
- empty means no time series will be excluded.
-
build
public SampleNameFilter build()
-
-