autometrics-dev / autometrics-ts

Easily add metrics to your system – and actually understand them using automatically customized Prometheus queries

Home Page:https://autometrics.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

πŸ› Caller information is sometimes missing

arendjr opened this issue Β· comments

Environment information

Server-side code running in Node or Deno can extract caller information using AsyncLocalStorage. Unfortunately, we load this from the node:async_hooks module, which is not available in browsers. Because of this we attempt to load in a promise, but while this promise is still pending, any (synchronous) calls that should be tracked by Autometrics will be lacking their caller information.

What happened?

Calls that are tracked by Autometrics before the AsyncLocalStorage is initialized lack caller information.

Expected result

Caller information should be available at all times if the environment supports it.