package prometheus-reporter

  1. Overview
  2. Docs
Renderer and standard collectors for Prometheus monitoring

Install

dune-project
 Dependency

Authors

Maintainers

Sources

prometheus-2.0.tbz
sha256=94cb5e95606d5ff17b4d11801ead1ea1981c06b17b084950d7a032933d991a83
sha512=236cc53cc50e24e18e31bf58dd29e9b98b50da0a92f7077d37ff13088c2b31eee49ed4eced8322f67406b0e4216c4751685002d357d9056335f7fc3e618c7f13

doc/prometheus-reporter.unix/Prometheus_reporter_unix/Logging/index.html

Module Prometheus_reporter_unix.LoggingSource

Report metrics for messages logged.

Sourceval init : ?default_level:Logs.level -> ?levels:(string * Logs.level) list -> ?formatter:Format.formatter -> unit -> unit

Initialise the Logs library with a reporter that reports prometheus metrics too. The reporter is configured to log to stderr and the log messages include a timestamp and the event's source.

A server will typically use the following code to initialise logging:

let () = Prometheus_reporter_unix.Logging.init ()

Or:

let () =
  Prometheus_reporter_unix.Logging.init ()
    ~default_level:Logs.Debug
    ~levels:[
      "cohttp.lwt.io", Logs.Info;
    ]
  • parameter default_level

    The default log-level to use (default Logs.level.Info).

  • parameter levels

    Provides levels for specific log sources.

  • parameter formatter

    A custom formatter (default Fmt.stderr).

Sourceval inc_counter : Logs.level -> string -> unit

inc_counter level src increments the count of messages logged by src at level. The reporter installed by init calls this automatically, but you might want to use this if you use your own reporter instead.