apache_beam.metrics.metrics_flag module
Process-wide switches that stop kinds of user metrics from being reported.
This module is imported by apache_beam.metrics.execution and by the
pipeline and worker start-up code, so it deliberately keeps its imports to a
minimum to avoid circular imports.
- class apache_beam.metrics.metrics_flag.MetricsFlag[source]
Bases:
objectProcess-wide switches that stop kinds of user metrics from being reported.
High throughput jobs may want to turn off metrics that put pressure on the metrics backend. Mirroring the Java SDK, the
disableCounterMetrics,disableStringSetMetricsanddisableBoundedTrieMetricsexperiments make the correspondingMetrics.counter,Metrics.string_setandMetrics.bounded_trieupdates no-ops. The metric objects themselves are unchanged, so code that holds on to them keeps working.- classmethod set_default_pipeline_options(options: PipelineOptions) None[source]
Initializes the flags from
optionsif not already done so.Called when a
Pipelineis constructed and at SDK worker harness start-up. As in the Java SDK, the first call wins so that user code running on a worker cannot change the flags the harness was started with.