Socket
Socket
Sign inDemoInstall

@autometrics/exporter-prometheus-push-gateway

Package Overview
Dependencies
8
Maintainers
4
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @autometrics/exporter-prometheus-push-gateway

Export metrics by pushing them to a Prometheus-compatible gateway


Version published
Weekly downloads
0
decreased by-100%
Maintainers
4
Created
Weekly downloads
 

Changelog

Source

[v0.7.0]

Changed

BREAKING: v0.7 is a big change to how the Autometrics library works in JavaScript. The core library interface of wrappers and decorators remains the same and will collect the metrics as previously, however it will not export them. For that purpose exporters are now separate to the library itself allowing the user more control as to how they want to set up the metrics collection: as a pull endpoint for Prometheus, push gateway, OpenTelemetry collector or something else.

  • Users need to explicitly choose an exporter and call its init() function.
  • Experimental: Eagerly push metrics when pushInterval is set to 0.

Added

  • Support Bun runtime in the core library.
  • Warn on a potentially incorrect HTTP OTLP endpoint.
  • Experimental: Initial Gravel Gateway Support.

Fixed

  • Clear timer on handover.
  • Log error when fetch is not defined in push context.
  • Fix default Prometheus exporter port.
  • Various smaller bugfixes.
  • Updated all our examples.

Readme

Source

@autometrics/exporter-prometheus-push-gateway

Export metrics by pushing them to a Prometheus-compatible push gateway.

For this exporter to work, you need to have a Prometheus-compatible push gateway, such as: https://github.com/sinkingpoint/prometheus-gravel-gateway

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-push-gateway

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

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

Usage

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

init({ url: "https://<your-push-gateway>" });

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

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

FAQs

Last updated on 26 Sep 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc