Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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)


VTEX Admin

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);
```