Class SampleNameFilter.Builder

  • Enclosing class:
    SampleNameFilter

    public static class SampleNameFilter.Builder
    extends java.lang.Object
    • Field Detail

      • nameEqualTo

        private final java.util.Collection<java.lang.String> nameEqualTo
      • nameNotEqualTo

        private final java.util.Collection<java.lang.String> nameNotEqualTo
      • nameStartsWith

        private final java.util.Collection<java.lang.String> nameStartsWith
      • nameDoesNotStartWith

        private final java.util.Collection<java.lang.String> nameDoesNotStartWith
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • nameMustBeEqualTo

        public SampleNameFilter.Builder nameMustBeEqualTo​(java.util.Collection<java.lang.String> names)
        Only samples with one of the names 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​(java.util.Collection<java.lang.String> names)
        All samples that are not in names 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​(java.util.Collection<java.lang.String> prefixes)
        Only samples whose name starts with one of the prefixes will be included.
        Parameters:
        prefixes - empty means no restriction.
      • nameMustNotStartWith

        public SampleNameFilter.Builder nameMustNotStartWith​(java.util.Collection<java.lang.String> prefixes)
        Samples with names starting with one of the prefixes will be excluded.
        Parameters:
        prefixes - empty means no time series will be excluded.