opentelemetry-js icon indicating copy to clipboard operation
opentelemetry-js copied to clipboard

feat(sdk-metrics)!: replace attributeKeys with custom processors option

Open pichlermarc opened this issue 1 year ago • 1 comments
trafficstars

Which problem is this PR solving?

See #4109

Drops the attributeKeys view option that implemented an "Allow List" for attribute keys.

Adds

  • createAllowListAttributesProcessor(), which replicates the functionality previously provided by attributeKeys
  • createDenyListAttributesProcessor(), which allows for dropping one or more attributes when added to a View, this can be useful for turning off attributes that are not needed or too high cardinality.
  • Adds IAttributesProcessor for custom attributes processors

Fixes #4109

Type of change

  • [x] New feature (non-breaking change which adds functionality)
  • [x] Breaking change (fix or feature that would cause existing functionality to not work as expected)

How Has This Been Tested?

  • [x] Unit tests

pichlermarc avatar Mar 08 '24 11:03 pichlermarc

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 92.89%. Comparing base (6804066) to head (9a662b6). Report is 1 commits behind head on next.

Additional details and impacted files
@@            Coverage Diff             @@
##             next    #4532      +/-   ##
==========================================
+ Coverage   92.87%   92.89%   +0.01%     
==========================================
  Files         328      328              
  Lines        9466     9484      +18     
  Branches     2023     2023              
==========================================
+ Hits         8792     8810      +18     
  Misses        674      674              
Files Coverage Δ
...ckages/sdk-metrics/src/state/AsyncMetricStorage.ts 100.00% <100.00%> (ø)
packages/sdk-metrics/src/state/MeterSharedState.ts 96.61% <100.00%> (ø)
...ackages/sdk-metrics/src/state/SyncMetricStorage.ts 100.00% <100.00%> (ø)
...ckages/sdk-metrics/src/view/AttributesProcessor.ts 100.00% <100.00%> (ø)
packages/sdk-metrics/src/view/View.ts 100.00% <100.00%> (ø)

codecov[bot] avatar Mar 08 '24 11:03 codecov[bot]

This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.

github-actions[bot] avatar Jun 17 '24 06:06 github-actions[bot]