Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Remix documentation #86

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
49 changes: 49 additions & 0 deletions Remix_Documentation/Remix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Remix

HyperDX comes with simple to use out-of-the box Remix support via our [browser SDK](https://www.hyperdx.io/docs/install/browser). The [browser SDK](https://www.hyperdx.io/docs/install/browser) allows you to intrument your frontend application to send events, route logs, and session data to HyperDX. We also have multiple backend integrations depending on your Remix Stack, for example when using [Node.js](https://www.hyperdx.io/docs/install/javascript) servers like Express, Vercel, Netlify, Architect, etc.
MikeShi42 marked this conversation as resolved.
Show resolved Hide resolved

## Getting Started

### Install

```bash
npm install @hyperdx/browser
```

### Initialize HyperDX
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to mention the file path for adding this code snippet ?


```js
import HyperDX from '@hyperdx/browser';

HyperDX.init({
apiKey: '<YOUR_API_KEY_HERE>',
service: 'my-frontend-app',
tracePropagationTargets: [/api.myapp.domain/i], // Set to link traces from frontend to backend requests
consoleCapture: true, // Capture console logs (default false)
advancedNetworkCapture: true, // Capture full HTTP request/response headers and bodies (default false)
});
```

## (Optional) Use [opentelemetry-instrumentation-remix](https://github.com/justindsmith/opentelemetry-instrumentations-js/tree/main/packages/instrumentation-remix) package for Node.js servers.

### Install
MikeShi42 marked this conversation as resolved.
Show resolved Hide resolved

```bash
npm install opentelemetry-instrumentation-remix
```

#### Create tracing.js file in application folder
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to tell people how to run with 'tracing.js' file ?

Copy link
Author

Choose a reason for hiding this comment

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

Oh yeah totally forgot, will add!

Copy link
Contributor

Choose a reason for hiding this comment

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

sorry for the back and forth. could we rename this tracing.js to instrument.js ?


### Initilize SDK

```js
const { initSDK } = require('@hyperdx/node-opentelemetry');
const { RemixInstrumentation } = require('opentelemetry-instrumentation-remix');


initSDK({
consoleCapture: true, // optional, default: true
advancedNetworkCapture: true, // optional, default: false
additionalInstrumentations: [new RemixInstrumentation()]
});
```