
Security News
PyPI Expands Trusted Publishing to GitLab Self-Managed as Adoption Passes 25 Percent
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads
@splunk/otel-react-native
Advanced tools
:construction: Splunk React Native instrumentation distribution is currently in BETA. By using this package in production-grade environments, users accept all limitations of beta maturity software, including the possibility of breaking changes introduced in any release. Limited support will be provided to active Splunk Observability Cloud customers.
This library lets you autoinstrument React Native applications. Minimum supported React Native version is 0.68. To instrument applications running on React Native versions lower than 0.68, see Instrument lower versions.
[!IMPORTANT] This library instruments React Native applications for Android and iOS devices. For React web instrumentation, see the splunk-otel-js-web project.
To instrument your React Native application, follow these steps.
# npm
npm install @splunk/otel-react-native
# yarn
yarn add @splunk/otel-react-native
import { SplunkRum } from '@splunk/otel-react-native';
const Rum = SplunkRum.init({
realm: 'us0',
applicationName: 'reactNativeTest',
rumAccessToken: 'token',
});
realm: The Splunk Observability Cloud realm of your organization. For example, us0.rumAccessToken: Your Splunk RUM authentication token. You can find or generate the token here. Notice that RUM and APM authentication tokens are different.applicationName: Name of your application. Set it to distinguish your app from others in Splunk Observability Cloud.If needed, you can set a different target URL by specifying a value for
beaconEndpoint. Setting a different beacon URL overrides therealmsetting.
To instrument applications running on React Native versions lower than 0.68, edit your metro.config.js file to force metro to use browser specific packages. For example:
const defaultResolver = require('metro-resolver');
module.exports = {
resolver: {
resolveRequest: (context, realModuleName, platform, moduleName) => {
const resolved = defaultResolver.resolve(
{
...context,
resolveRequest: null,
},
moduleName,
platform,
);
if (
resolved.type === 'sourceFile' &&
resolved.filePath.includes('@opentelemetry')
) {
resolved.filePath = resolved.filePath.replace(
'platform\\node',
'platform\\browser',
);
return resolved;
}
return resolved;
},
},
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: true,
},
}),
},
};
react-navigation version 5 and 6 are supported.
The following example shows how to instrument navigation:
import { startNavigationTracking } from '@splunk/otel-react-native';
export default function App() {
const navigationRef = useNavigationContainerRef();
return (
<NavigationContainer
ref={navigationRef}
onReady={() => {
startNavigationTracking(navigationRef);
}}
>
<Stack.Navigator>
...
</Stack.Navigator>
</NavigationContainer>
);
}
The library exports data using the Zipkin exporter. Adding your own exporters and processors isn't supported yet.
Supported features:
For more information about how this library uses Opentelemetry and about future plans check CONTRIBUTING.md.
Copyright 2023 Splunk Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
ℹ️ SignalFx was acquired by Splunk in October 2019. See Splunk SignalFx for more information.
FAQs
Splunk distribution of Open Telemetry for react native.
The npm package @splunk/otel-react-native receives a total of 1,626 weekly downloads. As such, @splunk/otel-react-native popularity was classified as popular.
We found that @splunk/otel-react-native demonstrated a not healthy version release cadence and project activity because the last version was released 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.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.

Security News
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.