Add user_id obtained asynchronously to the exported metrics #3491
Unanswered
IonitaCatalin
asked this question in
Q&A
Replies: 1 comment
-
You should set user_id in the attributes instead. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello !
I am currently working on a instrumentation metrics and tracing instrumentation library for Nest.js using OpenTelemetry .
What I am trying to achieve as of now is having a set of decorators that would adnotate functions so that when the providers are injected in the importing module the function scope will be hijacked and a Meter callback would be wraped to that function execution like so.
Where the metric argument of this function would be something like this:
My only problem is that once I instantiated a new MeterProvider and I am getting the Meter out of it, it becomes impossible to update the Resources to add for instance details about the generated metric such as the user_id which is impossible to get synchronously, you only get it in the context of a request.
Would it be possible to change the Resources of a MeterProvider at runtime?
Beta Was this translation helpful? Give feedback.
All reactions