
Research
/Security News
10 npm Typosquatted Packages Deploy Multi-Stage Credential Harvester
Socket researchers found 10 typosquatted npm packages that auto-run on install, show fake CAPTCHAs, fingerprint by IP, and deploy a credential stealer.
@splunk/otel-web
Advanced tools
π Installation & Setup Β Β β’Β Β βοΈ Configuration Β Β β’Β Β π οΈ Troubleshooting Β Β β’Β Β π API Reference
For complete instructions for how to get started with the Splunk distribution of OpenTelemetry JavaScript for Web, see Install the Browser RUM agent for Splunk RUM and Instrument browser-based web applications for Splunk RUM.
Splunk RUM for Browser collects performance metrics, web vitals, errors, and other forms of data for every user session to enable you to detect and troubleshoot problems in your application. For a complete view of your application from browser to back-end, integrate with Splunk APM.
npm install @splunk/otel-web
# or
pnpm add @splunk/otel-web
# or
yarn add @splunk/otel-web
import { SplunkRum } from '@splunk/otel-web'
SplunkRum.init({
realm: 'us1', // Your Splunk realm
rumAccessToken: 'YOUR_RUM_ACCESS_TOKEN', // RUM access token
applicationName: 'my-web-app', // Application identifier
deploymentEnvironment: 'production', // Environment (dev, staging, prod)
})
Choose a versioning strategy based on your needs:
Major Version Lock (Recommended)
<!-- Locks to v1.x.x - gets latest minor and patch updates -->
<script src="https://cdn.signalfx.com/o11y-gdi-rum/v1/splunk-otel-web.js" crossorigin="anonymous"></script>
Minor Version Lock
<!-- Locks to v1.1.x - gets latest patch updates only -->
<script src="https://cdn.signalfx.com/o11y-gdi-rum/v1.1/splunk-otel-web.js" crossorigin="anonymous"></script>
Exact Version Lock
<!-- Locks to exact version v1.1.0 - no automatic updates -->
<script
src="https://cdn.signalfx.com/o11y-gdi-rum/v1.1.0/splunk-otel-web.js"
crossorigin="anonymous"
integrity="sha384-<integrity>"
></script>
Latest Version (Not Recommended)
<!-- Always pulls the latest released version -->
<script src="https://cdn.signalfx.com/o11y-gdi-rum/latest/splunk-otel-web.js" crossorigin="anonymous"></script>
β οΈ Warning: Using
latestautomatically pulls the newest released version of the RUM agent, which may introduce breaking changes without notice. This can cause unexpected behavior in production. Use a version lock strategy instead.
π For version numbers and integrity hashes, see GitHub Releases.
π For detailed CDN setup instructions, see the official documentation.
<script>
SplunkRum.init({
realm: 'us1', // Your Splunk realm
rumAccessToken: 'YOUR_RUM_ACCESS_TOKEN', // RUM access token
applicationName: 'my-web-app', // Application identifier
deploymentEnvironment: 'production', // Environment (dev, staging, prod)
})
</script>
<!DOCTYPE html>
<html>
<head>
<title>My Web App</title>
<!-- Load Splunk RUM (using major version lock) -->
<script src="https://cdn.signalfx.com/o11y-gdi-rum/v1/splunk-otel-web.js" crossorigin="anonymous"></script>
<script>
SplunkRum.init({
realm: 'us1',
rumAccessToken: 'YOUR_RUM_ACCESS_TOKEN',
applicationName: 'my-web-app',
deploymentEnvironment: 'production',
debug: false, // Set to true for development
})
</script>
</head>
<body>
<!-- Your app content -->
</body>
</html>
| Option | Type | Required | Default | Description |
|---|---|---|---|---|
realm | string | β | - | Splunk realm (us0, us1, eu0, etc.) |
rumAccessToken | string | β | - | Publicly-visible RUM access token |
applicationName | string | β | 'unknown-browser-app' | Application name identifier |
deploymentEnvironment | string | β | - | Sets the environment attribute |
version | string | β | - | Sets the app.version attribute |
beaconEndpoint | string | β | - | Custom destination URL (overrides realm) |
debug | boolean | β | false | Enable internal debug logging |
cookieDomain | string | β | window.location.hostname | Domain for session cookies |
ignoreUrls | Array<string|RegExp> | β | [] | URLs to exclude from tracing |
globalAttributes | Attributes | β | {} | Attributes added to every span |
persistence | 'cookie'|'localStorage' | β | 'cookie' | Where to store session data |
disableAutomationFrameworks | boolean | β | false | Block automation frameworks |
disableBots | boolean | β | false | Block bots (Google bot, Bing bot, etc.) |
user.trackingMode | 'noTracking'|'anonymousTracking' | β | 'noTracking' | User tracking behavior |
exporter.otlp | boolean | β | false | Use OTLP format instead of Zipkin |
exporter.onAttributesSerializing | function | β | - | Transform attributes before export |
privacy.maskAllText | boolean | β | true | Mask all text from text nodes |
privacy.sensitivityRules | Array<SensitivityRule> | β | [] | Rules for text sensitivity by selector |
| Instrumentations | ||||
instrumentations.connectivity | boolean|Config | β | false | Network connectivity monitoring |
instrumentations.document | boolean|Config | β | true | Document load instrumentation |
instrumentations.errors | boolean|Config | β | true | Error capture |
instrumentations.fetch | boolean|Config | β | true | Fetch API monitoring |
instrumentations.interactions | boolean|Config | β | true | User interaction tracking |
instrumentations.longtask | boolean|Config | β | true | Long task detection (>50ms) |
instrumentations.postload | boolean|Config | β | true | Post-load resource timing |
instrumentations.socketio | boolean|Config | β | false | Socket.IO client monitoring |
instrumentations.visibility | boolean|Config | β | false | Page visibility changes |
instrumentations.webvitals | boolean|Config | β | true | Web Vitals collection |
instrumentations.websocket | boolean|Config | β | false | WebSocket monitoring |
instrumentations.xhr | boolean|Config | β | true | XMLHttpRequest monitoring |
The privacy configuration allows you to control how text content is collected from user interactions:
maskAllText: When true (default), all text from text nodes is masked unless an unmask rule appliessensitivityRules: Array of rules that determine text sensitivity based on CSS selectors. Rules are applied in order, with later rules overriding earlier onesRule Types:
mask: Mask text content in matching elementsunmask: Unmask text content in matching elementsexclude: Exclude matching elements from text collection entirelyExample:
privacy: {
maskAllText: true,
sensitivityRules: [
{ rule: 'unmask', selector: '.public-content' },
{ rule: 'exclude', selector: '.sensitive-data' },
{ rule: 'mask', selector: '.public-content .private-info' }
]
}
import { SplunkRum } from '@splunk/otel-web'
SplunkRum.init({
// Required settings
realm: 'us1',
rumAccessToken: 'YOUR_RUM_ACCESS_TOKEN',
// Application identification
applicationName: 'my-web-app',
deploymentEnvironment: 'production',
version: '1.2.3',
cookieDomain: window.location.hostname,
persistence: 'cookie',
ignoreUrls: [/\/health-check/, '/analytics/track', 'https://third-party-ads.com'],
// Global attributes for all spans
globalAttributes: {
'team': 'frontend',
'feature.flag.checkout': 'enabled',
},
// Bot detection
disableAutomationFrameworks: true,
disableBots: true,
// User tracking
user: {
trackingMode: 'anonymousTracking',
},
// Privacy configuration
privacy: {
maskAllText: true, // Mask all text from text nodes by default
sensitivityRules: [
// Unmask text in specific elements
{ rule: 'unmask', selector: '.public-content' },
{ rule: 'unmask', selector: 'h1, h2, h3' },
// Exclude sensitive elements entirely
{ rule: 'exclude', selector: '.sensitive-data' },
// Override previous rules for specific cases
{ rule: 'mask', selector: '.public-content .private-info' },
],
},
// Export options
exporter: {
otlp: true, // Use OTLP instead of Zipkin
onAttributesSerializing: (attributes, span) => {
// Remove or hash sensitive data
if (attributes['http.url']) {
attributes['http.url'] = sanitizeUrl(attributes['http.url'])
}
return attributes
},
},
// Instrumentation control
instrumentations: {
// Core instrumentations (enabled by default)
document: true,
errors: true,
fetch: true,
interactions: true,
longtask: true,
postload: true,
webvitals: true,
xhr: true,
// Optional instrumentations (disabled by default)
connectivity: false,
socketio: false,
visibility: false,
websocket: false,
},
// Development
debug: process.env.NODE_ENV !== 'production',
})
| Method | Parameters | Returns | Description |
|---|---|---|---|
init(config) | SplunkRumConfig | void | Initialize the RUM SDK |
setGlobalAttributes(attrs) | Attributes | void | Add global span attributes |
getSessionId() | - | string | Get current session ID |
| Property | Type | Description |
|---|---|---|
provider | TracerProvider | OpenTelemetry tracer provider |
For troubleshooting issues with the Splunk Distribution of OpenTelemetry JS for Web, see Troubleshoot browser instrumentation for Splunk Observability Cloud in the official documentation.
Licensed under the Apache License, Version 2.0. See LICENSE for the full license text.
βΉοΈΒ Β SignalFx was acquired by Splunk in October 2019. See Splunk SignalFx for more information.
1.1.0
@splunk/otel-web
[Button]), ensuring no sensitive information is capturedmaskAllText and sensitiveRules configuration options to control text capture behavior, similar to session replay functionalityClicked to '[Button]' for <button>Potentially sensitive text</button>Clicked to 'Potentially sensitive text'@splunk/otel-web-session-recorder
FAQs
Splunk distribution of Open Telemetry for browser environment.
The npm package @splunk/otel-web receives a total of 10,662 weekly downloads. As such, @splunk/otel-web popularity was classified as popular.
We found that @splunk/otel-web demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.Β It has 14 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Socket researchers found 10 typosquatted npm packages that auto-run on install, show fake CAPTCHAs, fingerprint by IP, and deploy a credential stealer.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authoritiesβ publishing activity, highlighting trends and transparency across the CVE ecosystem.