opentelemetry-js icon indicating copy to clipboard operation
opentelemetry-js copied to clipboard

Persistence Exporter in Javascript library

Open akbarnafisaj opened this issue 3 years ago • 8 comments
trafficstars

  • [x] This only affects the JavaScript OpenTelemetry library
  • [ ] This may affect other libraries, but I would like to get opinions here first

Does Opentelemetry JS have similar feature to Persistence Exporter ?

akbarnafisaj avatar Mar 15 '22 13:03 akbarnafisaj

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

vmarchaud avatar Mar 19 '22 12:03 vmarchaud

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

legendecas avatar Mar 19 '22 15:03 legendecas

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.

github-actions[bot] avatar May 23 '22 06:05 github-actions[bot]

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.

dyladan avatar May 23 '22 20:05 dyladan

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.

ianhattendorf avatar Aug 24 '22 15:08 ianhattendorf

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

scheler avatar Aug 25 '22 07:08 scheler