Socket
Book a DemoInstallSign in
Socket

@autometrics/exporter-prometheus

Package Overview
Dependencies
Maintainers
5
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@autometrics/exporter-prometheus

Export metrics by pushing them to a Prometheus-compatible gateway

1.0.1
latest
Source
npmnpm
Version published
Weekly downloads
186
31.91%
Maintainers
5
Weekly downloads
 
Created
Source

@autometrics/exporter-prometheus

Export metrics by opening up a Prometheus scrape endpoint.

This package will start a webserver on port 9464, with a Prometheus-compatible /metrics endpoint.

You should configure your Prometheus instance to scrape this endpoint. For instructions on how to do this, please refer to the Prometheus documentation: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#scrape_config

Documentation

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

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

FAQs

Package last updated on 28 Feb 2024

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.