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

prometheus-remote-write

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prometheus-remote-write

Send samples to prometheus via remote_write from NodeJS

  • 0.1.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5K
increased by6.42%
Maintainers
1
Weekly downloads
 
Created
Source

Push timeseries to Prometheus via remote_write

NPM version

Using remote_write facility (see https://prometheus.io/docs/prometheus/latest/configuration/configuration/#remote_write) to send metrics to remote Prometheus from NodeJS app.

Pretty much anything from https://prometheus.io/docs/operating/integrations/#remote-endpoints-and-storage should be supported, but tested only with grafana.com:

(List copied from https://github.com/prometheus/docs/blob/main/content/docs/operating/integrations.md)

Usage:

import pushTimeseries from "prometheus-remote-write";

const config = {
  // Remote url
  url: "http://localhost:9201",
  // Auth settings
  auth: {
    username: "...",
    password: "...",
  },
  // Optional prometheus protocol descripton .proto/.json
  proto: undefined,
  // Logging & debugging, disabled by default
  console: undefined,
  verbose: false,
  timing: false,
};

pushTimeseries(
  {
    labels: {
      __name__: "queue_depth_total",
      instance: "dev.example.com",
      service: "SQS",
    },
    samples: [
      {
        value: 150,
        timestamp: Date.now(),
      },
    ],
  },
  config
)

FAQs

Package last updated on 25 Jan 2022

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