sillsdev / sillsdev/languageforge-lexbox
Stabilize client-side OTEL export
A pull request for this has already been merged.
- #341 by @myieye — merged
- Dominant language
- C#
- Stars
- 9
- Forks
- 8
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 49
Description
Client-side OTEL uses the Beacon API for exporting traces. That's pretty much what the beacon API is for:
Unlike requests made using XMLHttpRequest or the Fetch API, the browser guarantees to initiate beacon requests before the page is unloaded and to run them to completion.
The main use case for the Beacon API is to send analytics such as client-side events or session data to the server.
but it has limitations that make trace collection flaky (https://github.com/sillsdev/languageforge-lexbox/issues/307, https://github.com/open-telemetry/opentelemetry-js/issues/3489).
Using the fetch API with the keepalive parameter would be more reliable (although it's not implemented yet in FireFox).
Despite the lack of support in FF it still might be worth changing to the fetch API, but the last time this was discussed in OTEL it didn't lead anywhere. There doesn't seem to be an easy way to do it currently. There is a way to use XMLHttpRequest, but that wouldn't be as big of a win.
I was directed to what looks like the most active relevant OTEL issue:
There is some other relevant work, but most of it is somewhat stale:
- Adding fetch, so service workers can export: https://github.com/open-telemetry/opentelemetry-js/pull/3542
- Refactor exporting to make use of XHR, fetch and beacon API: https://github.com/open-telemetry/opentelemetry-js/issues/3845
- Smarter http client that chooses the right way to export: https://github.com/open-telemetry/opentelemetry-js/pull/3577
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the linked merged pull request 341 and the upstream OpenTelemetry issues 4116 and 3845 to understand what work has already been attempted. The issue is done only when a supported export approach is selected and client-side trace delivery is stabilized, including the browser support trade-offs described here.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- observability, web-dev
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 15/100