1.0.1 • Published 1 year ago

@autometrics/autometrics v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@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
1.0.1

1 year ago

1.0.0

2 years ago

0.7.0-beta2

2 years ago

0.7.0-beta3

2 years ago

0.7.0-beta4

2 years ago

0.7.0-beta5

2 years ago

0.7.0-beta6

2 years ago

0.7.0-beta7

2 years ago

0.7.0-beta8

2 years ago

0.7.0-beta9

2 years ago

0.7.2-beta.0

2 years ago

0.7.0-beta10

2 years ago

0.7.0-beta11

2 years ago

0.7.0-beta

2 years ago

0.7.0

2 years ago

0.6.0

2 years ago

0.5.0

2 years ago

0.3.0

2 years ago

0.4.0

2 years ago

0.2.0

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.1

2 years ago