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

sendBeacon - cannot send #307

Closed
myieye opened this issue Oct 6, 2023 · 3 comments · Fixed by #308
Closed

sendBeacon - cannot send #307

myieye opened this issue Oct 6, 2023 · 3 comments · Fixed by #308
Labels
bug Something isn't working OpenTelemetry owner: Tim, Kevin
Milestone

Comments

@myieye
Copy link
Contributor

myieye commented Oct 6, 2023

We often get sendBeacon - cannot send errors in the browser console (honeycomb).
This has to do with imposed data limits in the beacon API:

If the amount of data to be queued exceeds the user agent limit (as defined in HTTP-network-or-cache fetch), this method returns false

It's somewhat fascinating that we are sometimes able to trace these errors (which contain the entire body of the failed beacon) using the beacon API. 🤔 I initially thought the problem was the size of individual beacon, but the docs say that it's rather a limit of what gets queued, which explains why we do manage to trace them after the fact.

I'll try to queue the beacons in smaller chunks, hoping that that prevents the total queue size from getting as big 🤔 and then we can compare the results in a few weeks to so if there are less failures.

@myieye myieye added bug Something isn't working OpenTelemetry owner: Tim, Kevin labels Oct 6, 2023
@hahn-kev hahn-kev added this to the MVP milestone Oct 9, 2023
@hahn-kev
Copy link
Collaborator

hahn-kev commented Oct 9, 2023

so sendBeacon is being used to send the telemetry, is there a fallback that we can use if that fails? Can't it just post via fetch?

@myieye
Copy link
Contributor Author

myieye commented Oct 9, 2023

@hahn-kev good question. So, the main benefit of the beacon API is that requests don't get cancelled on navigation, but I just discovered that fetch with keepalive is an explicit replacement for that. So, I'll take a look.

@myieye
Copy link
Contributor Author

myieye commented Oct 9, 2023

As discussed, this is a minimal-effort attempt to resuce more traces. We'll see.
We'll look into this more in #312.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working OpenTelemetry owner: Tim, Kevin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants