open-telemetry / opentelemetry-js

OpenTelemetry JavaScript Client
https://opentelemetry.io
Apache License 2.0
2.76k stars 810 forks source link

Persistence Exporter in Javascript library #2833

Open akbarnafisaj opened 2 years ago

akbarnafisaj commented 2 years ago

Does Opentelemetry JS have similar feature to Persistence Exporter ?

vmarchaud commented 2 years ago

Not currently, but this shouldn't be too hard to implement by extending the batch exporter there: https://github.com/open-telemetry/opentelemetry-js/blob/main/packages/opentelemetry-sdk-trace-base/src/export/BatchSpanProcessorBase.ts

legendecas commented 2 years ago

I think we need to define it in the spec first for us to release it as a built-in one.

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.

dyladan commented 2 years ago

What is the usecase for this in JS. In swift and android it is obviously useful for mobile apps which may have limited network access and be terminated before exports are complete. In most restricted JS environments such as browser, lambda, webworkers, and edge compute, persisting to disk is not guaranteed to be easy or possible.

ianhattendorf commented 2 years ago

What is the usecase for this in JS

This would be very useful for us as an Electron app. E.g. user is on a laptop without connectivity. Or the app crashes before the batch sends.

In most restricted JS environments such as browser, lambda, webworkers, and edge compute, persisting to disk is not guaranteed to be easy or possible

Allowing users to control storage (possibly via a callback?) could allow them to choose between filesystem/localstorage/etc.

scheler commented 2 years ago

Could this help with https://github.com/open-telemetry/opentelemetry-js/issues/2205 too for the browser?

github-actions[bot] commented 1 month ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.

pichlermarc commented 1 month ago

removing up-for-grabs as this is waiting for a specification before this can be picked up. If anyone stumbles upon this:

This issue needs