OpenTelemetry exporter, self-hosted
Where is the appropriate entrypoint for creating
sdk.start() where sdk = new NodeSDK({...}) from @opentelemetry/sdk-node? It should ideally be invoked only once, on server start.
I thought I could achieve this with a nitro plugin, but I did not manage to get it to run.
I setup nitro.config.js (next to vite.config.js, so in the same directory where src/ lives, not in src/). I see that the config is called on startup (added a log in there).
I tried creating server/plugins/foo.ts and src/server/plugins/foo.ts and registering it in the nitro config, but it never got called.
Perhaps other option is to call it somewhere inside server.ts, which looks like this for me:
1 Reply
robust-apricot•3mo ago