feat: allow disabling otel exporter#1436
Conversation
🦋 Changeset detectedLatest commit: 36d4dd0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 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. |
b8cf975 to
60f179a
Compare
60f179a to
36d4dd0
Compare
| exporterEnabled: HDX_EXPORTER_ENABLED, | ||
| apiKey: HDX_API_KEY, |
There was a problem hiding this comment.
I’d suggest removing the apiKey when HDX_EXPORTER_ENABLED is true. In this way users don’t need to inject an env var on the frontend side and rebuild the image
| ARG OTEL_EXPORTER_ENABLED | ||
| ARG OTEL_SERVICE_NAME | ||
| ARG IS_LOCAL_MODE | ||
| ENV NEXT_PUBLIC_OTEL_EXPORTER_OTLP_ENDPOINT $OTEL_EXPORTER_OTLP_ENDPOINT | ||
| ENV NEXT_PUBLIC_OTEL_EXPORTER_ENABLED $OTEL_EXPORTER_ENABLED |
There was a problem hiding this comment.
No changes are needed here if the env var is only available on the next api side
|
@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 |
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