Coder Social home page Coder Social logo

metrics's Introduction


Test Coverage edoc Erlang/OTP Apache-2.0

Metrics

main

An Erlang/OTP Prometheus client application that providing the following metric types:

  • Counter. A counter is a cumulative metric that represents a single monotonically increasing counter whose value can only increase or be reset to zero on restart.

  • Gauge. A gauge is a metric that represents a single numerical value that can arbitrarily go up and down.

  • Histogram. A histogram samples observations (usually things like request durations or response sizes) and counts them in configurable buckets. It also provides a sum of all observed values.

Metrics are exposed using the text based exposition format via HTTP using Cowboy.

Internally metrics uses atomics and counters available since OTP21.2.

Overview

The data model follows that of Prometheus. Every time series is uniquely identified by its metric name and optional key-value pairs called labels.

The API has a single arity map parameter. While counters, gauges or histograms are not initialised before use, once a metric name has been used it cannot be used by another type.

1> metrics:counter(#{name => errors, value => 6}).
ok

2> metrics:value(#{name => errors}).
6

3> metrics:counter(#{name => requests_served,
                   label => #{channel => mobile},
                   delta => 11}).
ok

4> metrics:value(#{name => requests_served,
                   label => #{channel => mobile}}).
11


5> metrics:counter(#{name => requests_served,
                   label => #{channel => desktop},
                   delta => 56}).
ok

6> metrics:value(#{name => requests_served,
                   label => #{channel => desktop}}).
56

metrics's People

Contributors

shortishly avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

leapsight pavelzx

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.