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

@autonomize/sdk-js

v1.0.10

Published

A lightweight, easy-to-use SDK for implementing OpenTelemetry in Node.js and Nest.js applications. This SDK provides unified instrumentation for traces, metrics, and logs with automatic context propagation.

Downloads

282

Readme

OpenTelemetry SDK for Express.js

A lightweight, easy-to-use SDK for implementing OpenTelemetry in Node.js and Nest.js applications. This SDK provides unified instrumentation for traces, metrics, and logs with automatic context propagation.

Features

  • 📊 Unified Metrics Collection - Track custom metrics with counters, histograms, and up/down counters
  • 🔍 Distributed Tracing - Automatic trace context propagation across services
  • 📝 Structured Logging - Logs automatically correlated with traces
  • 🔌 Auto-Instrumentation - Built-in support for HTTP, Express, and NestJS
  • 🎯 Zero Configuration - Sensible defaults with flexible customization options

Installation

# Using npm
npm install

# Using yarn
yarn add

# Using pnpm
pnpm install

Quick Start

import { TelemetrySDK } from 'autonomize/opentelemetry-sdk';

// Initialize the SDK
const telemetry = new TelemetrySDK({
    serviceName: 'your-service-name',
    environment: 'production',
    otlpEndpoint: 'http://localhost:4318' // Your OpenTelemetry collector endpoint
});

// Start the SDK
await telemetry.start();

// Create and use metrics
const requestCounter = telemetry.createCounter({
    name: 'http_requests_total',
    description: 'Total number of HTTP requests'
});

// Add logs with trace context
telemetry.info('Application started', { version: '1.0.0' });

// Handle errors with automatic trace correlation
try {
    // Your code
} catch (error) {
    telemetry.error('Operation failed', error);
}

Configuration

interface TelemetryConfig {
    serviceName: string;          // Your service name
    environment: string;          // e.g., 'development', 'production'
    version?: string;            // Service version
    otlpEndpoint?: string;       // OpenTelemetry collector endpoint
    metricIntervalMs?: number;   // Metric export interval
}

Contributing

We welcome contributions! Here's how you can help:

  1. Fork the Repository

    git clone https://github.com/autonomize/opentelemetry-sdk.git
    cd opentelemetry-sdk
  2. Install Dependencies

    npm install
  3. Create a Branch

    git checkout -b feature/your-feature-name
  4. Make Your Changes

    • Write tests for new features
    • Follow the existing code style
    • Update documentation as needed
  5. Run Tests

    npm test
  6. Submit a Pull Request

    • Describe your changes
    • Link any related issues
    • Update the changelog

Development Guidelines

  • Write clear commit messages
  • Add TypeScript types for all new code
  • Include unit tests for new features
  • Update documentation and examples
  • Follow semantic versioning

License

MIT License - see LICENSE for details

Related Projects

Changelog

[1.0.0] - 2024-01-01

  • Initial release
  • Basic metrics, traces, and logs support
  • Express and NestJS integration