
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
otel-agent-nodejs
Advanced tools
This package provides a reusable OpenTelemetry agent for Node.js applications. It simplifies the process of setting up distributed tracing and metrics collection by allowing developers to quickly integrate OpenTelemetry into their projects with minimal co
otel-agent-nodejs
is a reusable OpenTelemetry agent for Node.js applications, designed to simplify the setup of distributed tracing and metrics collection. This package allows developers to quickly integrate OpenTelemetry into their projects with minimal configuration.
Dockerfile
, configure NODE_OPTIONS
, and set environment variables.You can install the otel-agent-nodejs
package via NPM:
npm install otel-agent-nodejs
To use the OpenTelemetry agent in your Node.js application, follow these steps:
Add the following lines to your Dockerfile
to install and configure the OpenTelemetry agent:
FROM node:20
WORKDIR /app
COPY package*.json ./
RUN npm install
# Install the OpenTelemetry agent
RUN npm install otel-agent-nodejs
COPY . .
# Set NODE_OPTIONS to preload the agent before the application starts
ENV NODE_OPTIONS="--require otel-agent-nodejs"
EXPOSE 3000
CMD ["node", "index.js"]
In your docker-compose.yml
or directly in the environment where your application runs, configure the necessary environment variables:
services:
app:
build: .
ports:
- "3000:3000"
environment:
- OTEL_SERVICE_NAME=nodejs-otel-agent
- OTEL_TRACES_EXPORTER=otlp
- OTEL_METRICS_EXPORTER=otlp
- OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://otel-collector:4318/v1/traces
- OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://otel-collector:4318/v1/metrics
Build and run your Docker container as usual. The OpenTelemetry agent will automatically start and instrument your application:
docker-compose up --build
You can customize the behavior of the OpenTelemetry agent by setting additional environment variables:
otlp
(OpenTelemetry Protocol).otlp
.For a complete example project that uses otel-agent-nodejs
, refer to the example repository on GitHub.
Contributions are welcome! Please open an issue or submit a pull request if you have any improvements or new features you'd like to see.
This project is licensed under the MIT License. See the LICENSE file for details.
FAQs
This package provides a reusable OpenTelemetry agent for Node.js applications. It simplifies the process of setting up distributed tracing and metrics collection by allowing developers to quickly integrate OpenTelemetry into their projects with minimal co
The npm package otel-agent-nodejs receives a total of 1,481 weekly downloads. As such, otel-agent-nodejs popularity was classified as popular.
We found that otel-agent-nodejs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.