npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

opentelemetry-instrumentation-remix

v0.8.0

Published

open telemetry instrumentation for the `remix` package

Downloads

343,381

Readme

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

| Name | Type | Default Value | Description | |--------------------------|----------------------------------------------------|-----------------------------|---------------------------------------------------------------------------------------------| | actionFormDataAttributes | Record<string, boolean | string> | { _action: "actionType" } | Mapping of FormData field to span attribute names. | | legacyErrorAttributes | boolean | false | Whether 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.

| Operation | Example | Notes | |-----------------------------|--------------------------------|-------------------------------------------------------------------------------------| | remix.request [routePath] | remix.request /jokes/:jokeId | If the request does not match a route, the name of the span will be 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.route | HTTP route path, added if the request matches a route | "/jokes/:jokeId" | | http.status_code | Response status code | 200 | | match.route.id | Remix matched route ID, added if the request matches a route | "routes/jokes/$jokeId" | | error | Added if error detected and if legacyErrorAttributes enabled | true | | exception.message | Error message, if legacyErrorAttributes enabled and if applicable | "Kaboom!" | | exception.stacktrace | Error stacktrace, if legacyErrorAttributes enabled and if applicable | [stacktrace] |

| Status Code | Description | |------------------------|--------------------------------------------| | SpanStatusCode.ERROR | When an exception occurs during evaluation |

| Event | Attributes | Description | |-----------|------------------------|---------------------------------| | Exception | exception.message | Error message, if applicable | | | exception.stacktrace | Error stacktrace, if applicable |

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.route.id | Remix matched route id | "routes/jokes/$jokeId" | | match.params.[paramName] | Value for each remix matched param | [match.params.jokeId]: 23fc7bcf-2d35-4c70-877f-338eca1fd3ef" | | error | Added if error detected and if legacyErrorAttributes enabled | true | | exception.message | Error message, if legacyErrorAttributes enabled and if applicable | "Kaboom!" | | exception.stacktrace | Error stacktrace, if legacyErrorAttributes enabled and if applicable | [stacktrace] |

| Status Code | Description | |------------------------|--------------------------------------------| | SpanStatusCode.ERROR | When an exception occurs during evaluation |

| Event | Attributes | Description | |-----------|------------------------|---------------------------------| | Exception | exception.message | Error message, if applicable | | | exception.stacktrace | Error stacktrace, if applicable |

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.route.id | Remix 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" | | error | Added if error detected and if legacyErrorAttributes enabled | true | | exception.message | Error message, if legacyErrorAttributes enabled and if applicable | "Kaboom!" | | exception.stacktrace | Error stacktrace, if legacyErrorAttributes enabled and if applicable | [stacktrace] |

| Status Code | Description | |------------------------|--------------------------------------------| | SpanStatusCode.ERROR | When an exception occurs during evaluation |

| Event | Attributes | Description | |-----------|------------------------|---------------------------------| | Exception | exception.message | Error message, if applicable | | | exception.stacktrace | Error stacktrace, if applicable |

License

Apache 2.0 - See LICENSE for more information.