-
Notifications
You must be signed in to change notification settings - Fork 884
feat: allow events other than 'unload' to be configured to trigger the shutdown procedure in OTLPExporterBase #4326
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
Conversation
@dyladan is there a procedure for getting comments/reviews on PRs here? |
Not really. Joining the SIG meeting on wednesdays is a good idea if you have the time in order to explain the issue you're trying to solve and how your solution works to potential reviewers. Web-specific changes also tend to be reviewed by different people than node-focused things, and at least one of them has been on vacation for the last week or two. |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #4326 +/- ##
==========================================
+ Coverage 89.72% 92.21% +2.49%
==========================================
Files 164 333 +169
Lines 3309 9460 +6151
Branches 692 2010 +1318
==========================================
+ Hits 2969 8724 +5755
- Misses 340 736 +396
|
Looks like the lint is failing. I looked into the linked article about the deprecation of |
Right now, we're blocked from using bfcache on our site because of this Thanks for looking into this! |
Separate question: Is a shutdown needed on exporter anyway as it shouldn't have state - the closest required functionality would be in batcher where Line 43 in f4b681d
|
I agree with above, we should just remove (or let it die when chrome stops supporting Why? If we trigger a "Shutdown" in reaction to the wrong event and the environment (page) either doesn't "shutdown" (beforeunload gets cancelled by the user) or it gets rehydrated then the exporter (in theory) thinks it's dead while its still being used. |
I'd really like this approach and this does solve my immediate needs. How can I help make this happen? |
I have raised an alternative solution here: #4438 where the shutdown event listening is removed altogether and left for the consuming code to implement if desired. |
Which problem is this PR solving?
Google is planning to deprecate unload. This also currently blocks sites that use OTEL from benefiting from back/forward cache.
This PR proposes allowing the exporterConfig to possibly define whatever event they want and gives a union type of suggestions to be used (of course this can be overridden by tsignore if they choose).
Fixes #2205
Short description of the changes
As described in this comment: #4438 (comment) I have made this property an optional array. If it is not present, it will only assign the
unload
event.Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Checklist: