Anuragp22 opened a new pull request, #38749:
URL: https://github.com/apache/beam/pull/38749

   Adds Python SDK support for the `disableCounterMetrics`, 
`disableStringSetMetrics`, and `disableBoundedTrieMetrics` pipeline 
experiments, mirroring the Java SDK `Metrics.MetricsFlag` behavior. 
High-throughput Python pipelines previously had no way to opt out of user 
metric kinds that add pressure to metric backends; Java already honored these 
three experiments, this PR brings parity to Python.
   
   ## What changes
   
   - `sdks/python/apache_beam/metrics/metric.py`: new internal `MetricsFlag` 
class (singleton, idempotent `set_default_pipeline_options`). 
`DelegatingCounter.inc`, `DelegatingStringSet.add`, and 
`DelegatingBoundedTrie.add` now consult the flag and early-return when 
disabled, so no `MetricCell` is touched and no monitoring info is emitted.
   - `sdks/python/apache_beam/runners/worker/sdk_worker_main.py`: calls 
`MetricsFlag.set_default_pipeline_options(sdk_pipeline_options)` during harness 
init, before the first metric update can flow.
   - `sdks/python/apache_beam/metrics/metric_test.py`: ports Java 
`MetricsTest.testMetricsFlag` plus three smoke tests confirming each disabled 
kind short-circuits without raising.
   - `CHANGES.md`: entry under 2.75.0 New Features / Improvements.
   
   Fixes #38746.
   
   R: @Abacn
   
   ------------------------
   
   Thank you for your contribution! Follow this checklist to help us 
incorporate your contribution quickly and easily:
   
    - [x] Mention the appropriate issue in your description (for example: 
`addresses #123`), if applicable. This will automatically add a link to the 
pull request in the issue. If you would like the issue to automatically close 
on merging the pull request, comment `fixes #<ISSUE NUMBER>` instead.
    - [x] Update `CHANGES.md` with noteworthy changes.
    - [ ] If this contribution is large, please file an Apache [Individual 
Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to