Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vtex/splunk-react
React HOC that leverage the functionalities from splunk-events to ease logging to Splunk from React components.
https://github.com/vtex/splunk-react
Last synced: about 1 month ago
JSON representation
React HOC that leverage the functionalities from splunk-events to ease logging to Splunk from React components.
- Host: GitHub
- URL: https://github.com/vtex/splunk-react
- Owner: vtex
- Created: 2021-07-23T13:27:41.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-19T03:25:32.000Z (over 1 year ago)
- Last Synced: 2024-11-17T10:56:10.606Z (about 2 months ago)
- Language: TypeScript
- Size: 2.73 MB
- Stars: 1
- Watchers: 10
- Forks: 2
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![splunk-react on npm](https://img.shields.io/npm/v/splunk-react?style=flat-square)](https://www.npmjs.com/package/splunk-react)
splunk-react
Reach us at #frontend-monitoring channel on Slack
---
## SplunkMonitoring instance
```ts
import { SplunkMonitoring } from "splunk-react";const monitoring = new SplunkMonitoring({
token: "12345",
endpoint: "http://my-splunk-endpoint:9999",
// Only set `vtexIO` info in case your app
// is running on top of VTEX IO
vtexIO: {
runtimeInfo: {
account: global.__RUNTIME__.account,
workspace: global.__RUNTIME__.workspace,
renderMajor: global.__RUNTIME__.renderMajor,
production: global.__RUNTIME__.production,
},
appInfo: {
appId: process.env.VTEX_APP_ID as string,
appVersion: process.env.VTEX_APP_VERSION as string,
},
},
});
```## High order methods available in this application
### withErrorBoundary monitoring
```tsx
import { SplunkMonitoring, withErrorBoundary } from "splunk-react";const monitoring = new SplunkMonitoring({
// Your config here
});const App = () =>
Hello world;const AppWithErrorBoundaryMonitoring = withErrorBoundary(monitoring)(App);
```