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

deno_telemetry: programmable configuration and concurrent custom deno runtimes #28162

Open
ozwaldorf opened this issue Feb 18, 2025 · 0 comments
Labels
embedder Embedders using deno crates to build their own runtime rather than using Deno itself

Comments

@ozwaldorf
Copy link

ozwaldorf commented Feb 18, 2025

Currently the deno_telemetry extension is not very programmable for custom runtimes, and relies on some global statics that would conflict with them running on different threads at the same time.
The shared runtime for handling the async tasks is fine, but the global state for each exporter instance is an issue. Ideally, multiple runtimes should be able to initialize at the same time and export to different OTLP endpoints.

As far as I can tell, this can be solved by doing two things:

  • Move global static state to object(s) stored and initialized directly in the extension, allowing for concurrent custom runtimes
  • Move all environment variable configuration into a typed config struct, and include a from_env method that deno_runtime can use. This allows for custom runtimes to create the configuration however needed, or easily fallback to how deno itself will populate the values. It would be nice to just use the extension config pattern to take it as an input argument when binding the extension
@marvinhagemeister marvinhagemeister added the embedder Embedders using deno crates to build their own runtime rather than using Deno itself label Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
embedder Embedders using deno crates to build their own runtime rather than using Deno itself
Projects
None yet
Development

No branches or pull requests

2 participants