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-node): override IdGenerator when using NodeSDK #3645

Merged

Conversation

haddasbronfman
Copy link
Member

@haddasbronfman haddasbronfman commented Mar 1, 2023

Which problem is this PR solving?

Add ability to override idGenerator when using NodeSDK
Fixes #3435

Short description of the changes

Add 'idGenerator' to the configuration of NodeSDK

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

I added a test that creates NodeSDK with a custom idGenerator object, then I created span and verified it has the id that my custom generator generates. (a constant id just for testing)

@haddasbronfman haddasbronfman requested a review from a team March 1, 2023 09:34
@codecov
Copy link

codecov bot commented Mar 1, 2023

Codecov Report

Merging #3645 (ea1659e) into main (a457d94) will increase coverage by 0.61%.
The diff coverage is 100.00%.

❗ Current head ea1659e differs from pull request most recent head f33fcf5. Consider uploading reports for the commit f33fcf5 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3645      +/-   ##
==========================================
+ Coverage   93.10%   93.72%   +0.61%     
==========================================
  Files         183      274      +91     
  Lines        4538     8060    +3522     
  Branches      905     1671     +766     
==========================================
+ Hits         4225     7554    +3329     
- Misses        313      506     +193     
Impacted Files Coverage Δ
api/src/diag/types.ts 100.00% <ø> (ø)
...imental/packages/opentelemetry-sdk-node/src/sdk.ts 93.87% <100.00%> (ø)
packages/sdk-metrics/src/aggregator/types.ts 100.00% <0.00%> (ø)
packages/sdk-metrics/src/state/MetricStorage.ts 100.00% <0.00%> (ø)
packages/sdk-metrics/src/state/HashMap.ts 100.00% <0.00%> (ø)
...dk-metrics/src/state/MultiWritableMetricStorage.ts 100.00% <0.00%> (ø)
...-metrics/src/exemplar/NeverSampleExemplarFilter.ts 100.00% <0.00%> (ø)
...ntal/packages/otlp-grpc-exporter-base/src/types.ts 100.00% <0.00%> (ø)
packages/sdk-metrics/src/state/MetricCollector.ts 100.00% <0.00%> (ø)
packages/sdk-metrics/src/InstrumentDescriptor.ts 100.00% <0.00%> (ø)
... and 87 more

Copy link
Member

@pichlermarc pichlermarc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great; thanks for adding this 🙂
Could you please also add the changelog entry? 🙂

Nit: I'm not sure about the scope of the conventional commit message in the PR title, as it looks like it changes the IdGenerator, maybe
feat(sdk-node): override IdGenerator when using NodeSDK #3645? 🙂

@haddasbronfman haddasbronfman changed the title feat(idGenerator): override IdGenerator when using NodeSDK feat(sdk-node): override IdGenerator when using NodeSDK Mar 1, 2023
Copy link
Member

@blumamir blumamir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I think you do need to add an entry in CHANGELOG.md

@dyladan
Copy link
Member

dyladan commented Mar 1, 2023

Please add a changelog entry

@pichlermarc pichlermarc merged commit 0fb7879 into open-telemetry:main Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NodeSDK does not allow to override idGenerator
4 participants