Class MetricsFilter.Builder

java.lang.Object
org.apache.beam.sdk.metrics.MetricsFilter.Builder
Enclosing class:
MetricsFilter

public abstract static class MetricsFilter.Builder extends Object
Builder for creating a MetricsFilter.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • immutableNamesBuilder

      protected abstract org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.collect.ImmutableSet.Builder<MetricNameFilter> immutableNamesBuilder()
    • immutableStepsBuilder

      protected abstract org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.collect.ImmutableSet.Builder<String> immutableStepsBuilder()
    • addNameFilter

      public MetricsFilter.Builder addNameFilter(MetricNameFilter nameFilter)
      Add a MetricNameFilter.

      If no name filters are specified then all metric names will be included

      If one or more name filters are specified, then only metrics that match one or more of the filters will be included.

    • addStep

      public MetricsFilter.Builder addStep(String step)
      Add a step filter.

      If no steps are specified then metrics will be included for all steps.

      If one or more steps are specified, then metrics will be included if they are part of any of the specified steps.

      The step names of metrics are identified as a path within the pipeline. So for example, a transform that is applied with the name "bar" in a composite that was applied with the name "foo" would have a step name of "foo/bar".

      Step name filters may be either a full name (such as "foo/bar/baz") or a partial name such as "foo", "bar" or "foo/bar". However, each component of the step name must be completely matched, so the filter "foo" will not match a step name such as "fool/bar/foot"

      TODO(https://github.com/apache/beam/issues/20919): Beam does not guarantee a specific format for step IDs hence we should not assume a "foo/bar/baz" format here.

    • build

      public abstract MetricsFilter build()