Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Conversation

pichlermarc
Copy link
Member

@pichlermarc pichlermarc commented Mar 8, 2024

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

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

How Has This Been Tested?

  • Unit tests

@pichlermarc pichlermarc changed the title feat(sdk-metrics)!: replace attributeKeys with an option to add custom processors feat(sdk-metrics)!: replace attributeKeys with custom processors option Mar 8, 2024
Copy link

codecov bot commented Mar 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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%> (ø)

@pichlermarc pichlermarc force-pushed the feat/custom-attribute-processors branch 4 times, most recently from 9dcb15f to 2342658 Compare March 8, 2024 12:06
@pichlermarc pichlermarc force-pushed the feat/custom-attribute-processors branch from 2342658 to a279256 Compare March 8, 2024 12:13
@pichlermarc pichlermarc added pkg:sdk-metrics target:next-major-release This PR targets the next major release (`next` branch) labels Mar 8, 2024
@pichlermarc pichlermarc marked this pull request as ready for review March 8, 2024 12:18
@pichlermarc pichlermarc requested a review from a team March 8, 2024 12:18
Copy link

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 github-actions bot added the stale label Jun 17, 2024
@pichlermarc pichlermarc removed the stale label Jun 17, 2024
@pichlermarc pichlermarc merged commit 55f15e9 into open-telemetry:next Jun 18, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg:sdk-metrics target:next-major-release This PR targets the next major release (`next` branch)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants