Skip to content

📡 feat: Add Configurable HyperDX Browser Real User Monitoring#13287

Merged
danny-avila merged 1 commit into
danny-avila:devfrom
upman:feat/hyperdx-rum
May 29, 2026
Merged

📡 feat: Add Configurable HyperDX Browser Real User Monitoring#13287
danny-avila merged 1 commit into
danny-avila:devfrom
upman:feat/hyperdx-rum

Conversation

@upman
Copy link
Copy Markdown
Collaborator

@upman upman commented May 24, 2026

Pull Request Template

Summary

Adds opt-in HyperDX browser RUM support with a startup config surface, early fetch/XHR authorization header injection, HyperDX SDK initialization, route/user attributes, privacy-safe defaults, and tests.

Documentation PR: LibreChat-AI/librechat.ai#585

Change Type

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Testing

  • npx jest server/routes/__tests__/config.spec.js server/routes/__tests__/config.rum.spec.js --runInBand
  • npx jest src/lib/rum/routes.spec.ts src/lib/rum/early.spec.ts src/lib/rum/useRum.spec.tsx --runInBand

Test Configuration:

HyperDX RUM was tested with config-driven startup values and unit coverage for public token and authenticated user JWT modes.

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • I have made pertinent documentation changes
  • My changes do not introduce new warnings
  • I have written tests demonstrating that my changes are effective or that my feature works
  • Local unit tests pass with my changes
  • A pull request for updating the documentation has been submitted.

@upman upman force-pushed the feat/hyperdx-rum branch 4 times, most recently from a31c2bb to 8c3aeaa Compare May 24, 2026 15:25
@upman upman marked this pull request as ready for review May 24, 2026 15:38
@danny-avila
Copy link
Copy Markdown
Owner

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8c3aeaaf70

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

return {
provider: 'hyperdx',
enabled: true,
url: parsedUrl.href.replace(/\/$/, ''),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Remove URL credentials from client-exposed RUM config

When RUM_URL includes embedded credentials (for example https://user:pass@collector), this code forwards parsedUrl.href directly into /api/config, which is returned to browsers. That leaks collector credentials to every client that fetches startup config and can expose secrets via browser tooling, logs, and network captures. Reject URLs with username/password or strip userinfo before serializing the URL.

Useful? React with 👍 / 👎.

Comment thread api/server/services/Config/rum.js Outdated
}

function isLocalhost(url) {
return url.hostname === 'localhost' || url.hostname === '127.0.0.1' || url.hostname === '::1';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3 Badge Handle IPv6 localhost when validating HTTP RUM_URL

The localhost allowlist checks url.hostname === '::1', but new URL('http://[::1]:4318').hostname is '[::1]'. In public-token mode this makes valid loopback URLs fail isSafeRumUrl, so RUM is unexpectedly disabled for IPv6 localhost setups. Normalizing or accepting the bracketed IPv6 loopback hostname fixes this.

Useful? React with 👍 / 👎.

Comment thread client/src/lib/rum/early.ts Outdated
return;
}

originalOpen.call(this, method, url, true);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve XHR credentials when async is omitted

The interceptor rewrites xhr.open() and forces originalOpen(..., true) whenever async is not explicitly boolean, which discards the optional username/password arguments in that call path. Any XHR that relies on omitted async while supplying credentials can lose authentication and start failing (for example 401 responses), and this affects all XHR usage because the wrapper replaces window.XMLHttpRequest globally.

Useful? React with 👍 / 👎.

@danny-avila
Copy link
Copy Markdown
Owner

@upman please review eslint errors

@upman upman force-pushed the feat/hyperdx-rum branch from 8c3aeaa to 92993d2 Compare May 24, 2026 21:23
@upman
Copy link
Copy Markdown
Collaborator Author

upman commented May 24, 2026

@danny-avila Fixed

@danny-avila
Copy link
Copy Markdown
Owner

@codex review

@danny-avila
Copy link
Copy Markdown
Owner

@upman additional eslint issues here

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@upman upman force-pushed the feat/hyperdx-rum branch from 92993d2 to 7237b1b Compare May 26, 2026 16:49
@upman upman closed this May 26, 2026
@upman upman reopened this May 26, 2026
@danny-avila danny-avila changed the title feat(client): add configurable HyperDX RUM 📡 feat: Add Configurable HyperDX Browser Real User Monitoring May 29, 2026
@danny-avila danny-avila changed the base branch from main to dev May 29, 2026 18:04
@danny-avila danny-avila merged commit 71a7c9c into danny-avila:dev May 29, 2026
35 checks passed
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