Skip to content

Conversation

@Misfits09
Copy link

@Misfits09 Misfits09 commented Dec 3, 2025

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_ENABLED configuration variable that prevents the instanciation of HyperDX.init() from @hyperdx/browser. Which disables sending metrics to the collector

@changeset-bot
Copy link

changeset-bot bot commented Dec 3, 2025

🦋 Changeset detected

Latest commit: 36d4dd0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@hyperdx/app Patch
@hyperdx/api Patch

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

@vercel
Copy link

vercel bot commented Dec 3, 2025

@Misfits09 is attempting to deploy a commit to the HyperDX Team on Vercel.

A member of the Team first needs to authorize it.

@Misfits09 Misfits09 force-pushed the feature/allow-disabling-otel-exporter branch 2 times, most recently from b8cf975 to 60f179a Compare December 3, 2025 16:44
@Misfits09 Misfits09 force-pushed the feature/allow-disabling-otel-exporter branch from 60f179a to 36d4dd0 Compare December 3, 2025 16:45
Comment on lines +11 to 12
exporterEnabled: HDX_EXPORTER_ENABLED,
apiKey: HDX_API_KEY,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment on lines +29 to +33
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No changes are needed here if the env var is only available on the next api side

@wrn14897
Copy link
Member

wrn14897 commented Jan 2, 2026

@Misfits09 Lmk if comments make sense. Would love to get this PR out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants