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(@opentelemetry-instrumentation-fetch): optionally ignore network events #3028

Merged
merged 2 commits into from
Jun 15, 2022

Conversation

gregolsen
Copy link
Contributor

@gregolsen gregolsen commented Jun 9, 2022

Which problem is this PR solving?

Summary: This PR allows to optionally disable adding network events as span events to control the total volume of telemetry data produced.

Some of the modern vendors treat spans and span events (annotations) equally – both are counted towards the overall retained events volume. Similarly, vendors that charge for the overall size of data retained will count span annotations as part of the data. Typically, span produced by the @opentelemetry-instrumentation-fetch includes 9 network events – 10 event items along with the span itself. It would be great to have ability to optionally disable network events being added as span annotations to reduce the overall volume of data/events generated and eventually retained.

Short description of the changes

This PR adds an optional boolean flag ignoreNetworkEvents to the FetchInstrumentation. When set to true network events are not added to the span.

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

Running npm run test:browser will run the newly added test as part of the suite:

    ...
    when network events are ignored
      ✓ should NOT add network events

Checklist:

  • Followed the style guidelines of this project
  • Unit tests have been added
  • Documentation has been updated

@gregolsen gregolsen requested a review from a team June 9, 2022 08:37
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jun 9, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: gregolsen / name: Inokentii Mykhailov (4f9feef)

@vmarchaud
Copy link
Member

@gregolsen you'll need to add a entry in the global CHANGELOG, apart from that lgtm

@codecov
Copy link

codecov bot commented Jun 12, 2022

Codecov Report

Merging #3028 (e36c928) into main (c8c4ec6) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

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

@@            Coverage Diff             @@
##             main    #3028      +/-   ##
==========================================
- Coverage   92.65%   92.64%   -0.02%     
==========================================
  Files         187      187              
  Lines        6167     6169       +2     
  Branches     1301     1303       +2     
==========================================
+ Hits         5714     5715       +1     
- Misses        453      454       +1     
Impacted Files Coverage Δ
...s/opentelemetry-instrumentation-fetch/src/fetch.ts 96.47% <100.00%> (+0.04%) ⬆️
...emetry-core/src/platform/node/RandomIdGenerator.ts 87.50% <0.00%> (-6.25%) ⬇️

@gregolsen
Copy link
Contributor Author

Ah, thank you @vmarchaud. I modified experimental/CHANGELOG – I hope that's what you've meant by "global" – I figured the one in experimental fits better as my change is for the package located under experimental directory.

@vmarchaud
Copy link
Member

I hope that's what you've meant by "global" – I figured the one in experimental fits better as my change is for the package located under experimental directory.

Yeah sorry that was exactly what i meant, thanks

@vmarchaud vmarchaud merged commit 5f9ef51 into open-telemetry:main Jun 15, 2022
@gregolsen gregolsen deleted the ignore-network-events branch June 17, 2022 20:27
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.

3 participants