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 SampleNameFilterbuild()SampleNameFilter.BuildernameMustBeEqualTo(String... names)SampleNameFilter.BuildernameMustBeEqualTo(Collection<String> names)Only samples with one of thenameswill be included.SampleNameFilter.BuildernameMustNotBeEqualTo(String... names)SampleNameFilter.BuildernameMustNotBeEqualTo(Collection<String> names)All samples that are not innameswill be excluded.SampleNameFilter.BuildernameMustNotStartWith(String... prefixes)SampleNameFilter.BuildernameMustNotStartWith(Collection<String> prefixes)Samples with names starting with one of theprefixeswill be excluded.SampleNameFilter.BuildernameMustStartWith(String... prefixes)SampleNameFilter.BuildernameMustStartWith(Collection<String> prefixes)Only samples whose name starts with one of theprefixeswill 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 thenameswill be included.Note that the provided
nameswill 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 innameswill be excluded.Note that the provided
nameswill 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 theprefixeswill 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 theprefixeswill be excluded.- Parameters:
prefixes- empty means no time series will be excluded.
-
build
public SampleNameFilter build()
-
-