Giter Site home page Giter Site logo

angpa / prometheus_client_nodejs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from streammachine/prometheus_client_nodejs

0.0 1.0 0.0 209 KB

Prometheus metrics client for Node.js

License: Apache License 2.0

CoffeeScript 42.16% JavaScript 57.84%

prometheus_client_nodejs's Introduction

Prometheus Client

WIP Prometheus instrumentation metrics library for Node.JS. Metrics are intended to be scraped by a Prometheus server.

Usage

Getting Started

Install the prometheus-client package with NPM:

npm install prometheus-client

Then require the package and set up a new client instance:

Prometheus = require("prometheus-client")

client = new Prometheus()

The client library can create an HTTP app to serve up your metrics, or you can point to the output function from your own app router.

To use the built-in server:

client.listen(9090)

Then use curl http://127.0.0.1:9090 to see a text representation of your metrics.

To use the metrics output function in your own express app, you might do:

app = express()
app.get("/metrics",client.metricsFunc())
app.listen(9090)

By default, the Prometheus client will use a global namespace. That means that any metrics registered inside your app (even by libraries) will show up in your client without any need to pass around a client object.

See examples/test.coffee for a full example of registering and using metrics in coffeescript and examples/counterAndGauge.js to see the same example written in Javascript.

prometheus_client_nodejs's People

Contributors

ewr avatar mansona avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.