How to enable open-telemetry with action #2023
-
Hello, I would like to set up open telemetry to trace the events of a Vue front. Has anyone succeeded yet? Otherwise would it be possible to wrap action to create a context with the trace and execute the original action in the context callback? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
I'm not 100% clear on what you're wanting to do, but I'm assuming you're wanting to associate network calls made from within an action and calls to the action itself with some kind of correlation id or other info? I'm also guessing that the standard web instrumentation OpenTelemtry JS library functionality isn't sufficient? If so, it's worth remembering that Pinia is specifically a state management library and has no knowledge of network calls. Any network calls within an action are because a developer added them, not because of Pinia's capabilities. You'll need to build your own solution. I'd suggest that during the action you store a correlation id of some kind in a Pinia store, and then use something like Axios interceptors to handle the network calls and pull from the store the correlation id to include in any logging statements. |
Beta Was this translation helpful? Give feedback.
I'm not 100% clear on what you're wanting to do, but I'm assuming you're wanting to associate network calls made from within an action and calls to the action itself with some kind of correlation id or other info? I'm also guessing that the standard web instrumentation OpenTelemtry JS library functionality isn't sufficient?
If so, it's worth remembering that Pinia is specifically a state management library and has no knowledge of network calls. Any network calls within an action are because a developer added them, not because of Pinia's capabilities.
You'll need to build your own solution. I'd suggest that during the action you store a correlation id of some kind in a Pinia store, and the…