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

@autometrics/autometrics-slim

Package Overview
Dependencies
Maintainers
4
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@autometrics/autometrics-slim

Easily add metrics to your system -- and actually understand them using automatically customized Prometheus queries

  • 0.7.2-beta.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
4
Created
Source

@autometrics/autometrics 📈✨

This is the official TypeScript implementation for https://autometrics.dev/.

Documentation

Full documentation for the @autometrics/autometrics library can be found here: https://github.com/autometrics-dev/autometrics-ts

Recipe: Server-side example with Prometheus

Installation

# npm
npm install @autometrics/autometrics @autometrics/exporter-prometheus

# yarn
yarn add @autometrics/autometrics @autometrics/exporter-prometheus

# pnpm
pnpm add @autometrics/autometrics @autometrics/exporter-prometheus

Usage

  1. Anywhere in your source code:
import { autometrics } from "@autometrics/autometrics";
import { init } from "@autometrics/exporter-prometheus";

init(); // starts the webserver with the `/metrics` endpoint on port 9464

async function createUserRaw(payload: User) {
  // ...
}

const createUser = autometrics(createUserRaw);
   // ^ instrumented function

Recipe: Client-side example with the OpenTelemetry Collector

Installation

# npm
npm install @autometrics/autometrics @autometrics/exporter-otlp-http

# yarn
yarn add @autometrics/autometrics @autometrics/exporter-otlp-http

# pnpm
pnpm add @autometrics/autometrics @autometrics/exporter-otlp-http

Usage

  1. Anywhere in your source code:
import { autometrics } from "@autometrics/autometrics";
import { init } from "@autometrics/exporter-otlp-http";

init({ url: "https://<your-otel-collector>" });

async function createUserRaw(payload: User) {
  // ...
}

const createUser = autometrics(createUserRaw);
   // ^ instrumented function

FAQs

Package last updated on 04 Oct 2023

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