Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

opentelemetry-instrumentation-remix

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

opentelemetry-instrumentation-remix

open telemetry instrumentation for the `remix` package

  • 0.8.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
88K
increased by13.31%
Maintainers
1
Weekly downloads
 
Created
Source

OpenTelemetry Remix Instrumentation for Node.js

NPM version Apache 2.0 License

This module provides automatic instrumentation for remix.

Installation

npm install --save opentelemetry-instrumentation-remix

Supported Versions

  • 1.1.0 - 2.x

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();
tracerProvider.register();

registerInstrumentations({
  instrumentations: [
    new RemixInstrumentation()
  ]
});

Configuration

NameTypeDefault ValueDescription
actionFormDataAttributesRecord<string, boolean | string>{ _action: "actionType" }Mapping of FormData field to span attribute names.
legacyErrorAttributesbooleanfalseWhether to emit errors in the form of span attributes, as well as in span exception events.

Instrumentation

requestHandler

Emitted for every request into remix server.

OperationExampleNotes
remix.request [routePath]remix.request /jokes/:jokeIdIf the request does not match a route, the name of the span will be remix.request
AttributeDescriptionExample Value
code.functionName of executed function"requestHandler"
http.methodHTTP method"POST"
http.urlHTTP URL"https://remix.jokes/jokes/new?_data=routes%2Fjokes%2Fnew"
http.routeHTTP route path, added if the request matches a route"/jokes/:jokeId"
http.status_codeResponse status code200
match.route.idRemix matched route ID, added if the request matches a route"routes/jokes/$jokeId"
errorAdded if error detected and if legacyErrorAttributes enabledtrue
exception.messageError message, if legacyErrorAttributes enabled and if applicable"Kaboom!"
exception.stacktraceError stacktrace, if legacyErrorAttributes enabled and if applicable[stacktrace]
Status CodeDescription
SpanStatusCode.ERRORWhen an exception occurs during evaluation
EventAttributesDescription
Exceptionexception.messageError message, if applicable
exception.stacktraceError stacktrace, if applicable

loader

Emitted for every loader called.

OperationExample
LOADER [routeId]LOADER routes/jokes/$jokeId
AttributeDescriptionExample Value
code.functionName of executed function"loader"
http.methodHTTP method"POST"
http.urlHTTP URL"https://remix.jokes/jokes/new?_data=routes%2Fjokes%2Fnew"
http.status_codeResponse status code200
match.route.idRemix matched route id"routes/jokes/$jokeId"
match.params.[paramName]Value for each remix matched param[match.params.jokeId]: 23fc7bcf-2d35-4c70-877f-338eca1fd3ef"
errorAdded if error detected and if legacyErrorAttributes enabledtrue
exception.messageError message, if legacyErrorAttributes enabled and if applicable"Kaboom!"
exception.stacktraceError stacktrace, if legacyErrorAttributes enabled and if applicable[stacktrace]
Status CodeDescription
SpanStatusCode.ERRORWhen an exception occurs during evaluation
EventAttributesDescription
Exceptionexception.messageError message, if applicable
exception.stacktraceError stacktrace, if applicable

action

Emitted for every action called.

OperationExample
ACTION [routeId]ACTION routes/jokes/new
AttributeDescriptionExample Value
code.functionName of executed function"action"
http.methodHTTP method"POST"
http.urlHTTP URL"https://remix.jokes/jokes/new?_data=routes%2Fjokes%2Fnew"
http.status_codeResponse status code200
match.route.idRemix matched route id"routes/jokes/$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"
errorAdded if error detected and if legacyErrorAttributes enabledtrue
exception.messageError message, if legacyErrorAttributes enabled and if applicable"Kaboom!"
exception.stacktraceError stacktrace, if legacyErrorAttributes enabled and if applicable[stacktrace]
Status CodeDescription
SpanStatusCode.ERRORWhen an exception occurs during evaluation
EventAttributesDescription
Exceptionexception.messageError message, if applicable
exception.stacktraceError stacktrace, if applicable

License

Apache 2.0 - See LICENSE for more information.

Keywords

FAQs

Package last updated on 11 Oct 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc