1.0.1 • Published 3 months ago
@autometrics/autometrics v1.0.1
@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
- 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
- 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
3 months ago
1.0.0
6 months ago
0.7.0-beta2
9 months ago
0.7.0-beta3
9 months ago
0.7.0-beta4
9 months ago
0.7.0-beta5
9 months ago
0.7.0-beta6
9 months ago
0.7.0-beta7
9 months ago
0.7.0-beta8
9 months ago
0.7.0-beta9
9 months ago
0.7.2-beta.0
8 months ago
0.7.0-beta10
9 months ago
0.7.0-beta11
8 months ago
0.7.0-beta
10 months ago
0.7.0
8 months ago
0.6.0
10 months ago
0.5.0
12 months ago
0.3.0
1 year ago
0.4.0
1 year ago
0.2.0
1 year ago
0.1.2
1 year ago
0.1.1
1 year ago
0.1.0
1 year ago
0.0.1
1 year ago