Package Exports
- opentelemetry-instrumentation-remix
- opentelemetry-instrumentation-remix/dist/src/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (opentelemetry-instrumentation-remix) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
OpenTelemetry Remix Instrumentation for Node.js
This module provides automatic instrumentation for remix.
Installation
npm install --save opentelemetry-instrumentation-remixSupported Versions
^1.1.0
Cloudflare Worker Warning
This instrumentation does NOT support Cloudflare Workers. For more details follow opentelemetry-js issue #1214.
Usage
For further automatic instrumentation instruction see the @opentelemetry/instrumentation package.
const { NodeTracerProvider } = require('@opentelemetry/sdk-trace-node');
const { registerInstrumentations } = require('@opentelemetry/instrumentation');
const { RemixInstrumentation } = require('opentelemetry-instrumentation-remix');
const tracerProvider = new NodeTracerProvider();
provider.register();
registerInstrumentations({
instrumentations: [
new RemixInstrumentation()
]
});Configuration
| Name | Type | Default Value | Description | |
|---|---|---|---|---|
| actionFormDataAttributes | Record |
{ _action: "actionType" } |
Mapping of FormData field to span attribute names. |
Instrumentation
requestHandler
Emitted for every request into remix server.
| Operation |
|---|
remix.request |
| Attribute | Description | Example Value |
|---|---|---|
code.function |
Name of executed function | "requestHandler" |
http.method |
HTTP method | "POST" |
http.url |
HTTP URL | "https://remix.jokes/jokes/new?_data=routes%2Fjokes%2Fnew" |
http.status_code |
Response status code | 200 |
error |
Added if error detected | true |
exception.message |
Error message, if applicable | "Kaboom!" |
exception.stacktrace |
Error stacktrace, if applicable | [stacktrace] |
loader
Emitted for every loader called.
| Operation | Example |
|---|---|
LOADER [routeId] |
LOADER routes/jokes/$jokeId |
| Attribute | Description | Example Value |
|---|---|---|
code.function |
Name of executed function | "loader" |
http.method |
HTTP method | "POST" |
http.url |
HTTP URL | "https://remix.jokes/jokes/new?_data=routes%2Fjokes%2Fnew" |
http.status_code |
Response status code | 200 |
match.pathname |
Remix matched pathname | "/jokes/23fc7bcf-2d35-4c70-877f-338eca1fd3ef" |
match.route.id |
Remix matched route id | "routes/jokes/$jokeId" |
match.route.path |
Remix matched route path | ":jokeId" |
match.params.[paramName] |
Value for each remix matched param | [match.params.jokeId]: 23fc7bcf-2d35-4c70-877f-338eca1fd3ef" |
error |
Added if error detected | true |
exception.message |
Error message, if applicable | "Kaboom!" |
exception.stacktrace |
Error stacktrace, if applicable | [stacktrace] |
action
Emitted for every action called.
| Operation | Example |
|---|---|
ACTION [routeId] |
ACTION routes/jokes/new |
| Attribute | Description | Example Value |
|---|---|---|
code.function |
Name of executed function | "action" |
http.method |
HTTP method | "POST" |
http.url |
HTTP URL | "https://remix.jokes/jokes/new?_data=routes%2Fjokes%2Fnew" |
http.status_code |
Response status code | 200 |
match.pathname |
Remix matched pathname | "/jokes/23fc7bcf-2d35-4c70-877f-338eca1fd3ef" |
match.route.id |
Remix matched route id | "routes/jokes/$jokeId" |
match.route.path |
Remix matched route path | ":jokeId" |
match.params.[paramName] |
Value for each remix matched param | [match.params.jokeId]: "23fc7bcf-2d35-4c70-877f-338eca1fd3ef" |
formData.[fieldName] |
Value for each configured FormData field | [formData.actionType]: "createJoke" |
error |
Added if error detected | true |
exception.message |
Error message, if applicable | "Kaboom!" |
exception.stacktrace |
Error stacktrace, if applicable | [stacktrace] |
License
Apache 2.0 - See LICENSE for more information.