feat: allow disabling otel exporter#1436
Conversation
🦋 Changeset detectedLatest commit: f8afa16 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
@Misfits09 is attempting to deploy a commit to the HyperDX Team on Vercel. A member of the Team first needs to authorize it. |
60f179a to
36d4dd0
Compare
|
@Misfits09 Lmk if comments make sense. Would love to get this PR out |
|
@Misfits09 Any updates? Let me know or I will port this to another PR |
36d4dd0 to
8fd9bb2
Compare
Very sorry for the delay, i missed the gh notifications !! |
8fd9bb2 to
183cdb0
Compare
packages/app/pages/api/config.ts
Outdated
| ) { | ||
| res.status(200).json({ | ||
| apiKey: HDX_API_KEY, | ||
| exporterEnabled: HDX_EXPORTER_ENABLED, |
There was a problem hiding this comment.
Do we need exporterEnabled? Since apiKey will be undefined if exporterEnabled is falsy, right?
There was a problem hiding this comment.
That's a good point ! Fixed it 👍
.vscode/settings.json
Outdated
| }, | ||
| "[typescriptreact]": { | ||
| "editor.defaultFormatter": "dbaeumer.vscode-eslint" | ||
| "editor.defaultFormatter": "vscode.typescript-language-features" |
There was a problem hiding this comment.
Not supposed to be there ! Removed it just now
Nw, thanks for checking this out |
183cdb0 to
7e3d630
Compare
We should be good now 😄 |
Context
The default behavior to try to export logs/metrics/traces to an otel collector is causing issues in cases where this collector is not publicly accessible. Therefore adding an option to disable it would avoid having many errors in the Network tabs of the browser.
It has been briefly discussed here on discord
Changes
Added a new
HDX_EXPORTER_ENABLEDconfiguration variable that prevents the instanciation ofHyperDX.init()from@hyperdx/browser. Which disables sending metrics to the collector