nanoev/tiny_httpd/Tiny_httpd_prometheus/index.html
2025-05-05 14:16:16 +00:00

2 lines
4.9 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Tiny_httpd_prometheus (tiny_httpd.Tiny_httpd_prometheus)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 3.0.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../../index.html">Index</a> &#x00BB; <a href="../index.html">tiny_httpd</a> &#x00BB; Tiny_httpd_prometheus</nav><header class="odoc-preamble"><h1>Module <code><span>Tiny_httpd_prometheus</span></code></h1><p>Expose metrics over HTTP in the prometheus format.</p><p>This sub-library <code>tiny_httpd.prometheus</code> provides definitions for counters, gauges, and histogram, and endpoints to expose them for <a href="https://prometheus.io/">Prometheus</a> to scrape them.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.16</li></ul></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type anchored" id="type-tags"><a href="#type-tags" class="anchor"></a><code><span><span class="keyword">type</span> tags</span><span> = <span><span>(string * string)</span> list</span></span></code></div></div><div class="odoc-spec"><div class="spec module anchored" id="module-Registry"><a href="#module-Registry" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Registry/index.html">Registry</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div><div class="spec-doc"><p>Registry for metrics.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-global"><a href="#val-global" class="anchor"></a><code><span><span class="keyword">val</span> global : <a href="Registry/index.html#type-t">Registry.t</a></span></code></div></div><div class="odoc-spec"><div class="spec module anchored" id="module-Counter"><a href="#module-Counter" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Counter/index.html">Counter</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div><div class="spec-doc"><p>Counters</p></div></div><div class="odoc-spec"><div class="spec module anchored" id="module-Gauge"><a href="#module-Gauge" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Gauge/index.html">Gauge</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div><div class="spec-doc"><p>Gauges</p></div></div><div class="odoc-spec"><div class="spec module anchored" id="module-Histogram"><a href="#module-Histogram" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Histogram/index.html">Histogram</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-http_middleware"><a href="#val-http_middleware" class="anchor"></a><code><span><span class="keyword">val</span> http_middleware : <span><a href="Registry/index.html#type-t">Registry.t</a> <span class="arrow">&#45;&gt;</span></span> <a href="../Tiny_httpd_core/Server/Middleware/index.html#type-t">Tiny_httpd_core.Server.Middleware.t</a></span></code></div><div class="spec-doc"><p>Middleware to get basic metrics about HTTP requests</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-add_route_to_server"><a href="#val-add_route_to_server" class="anchor"></a><code><span><span class="keyword">val</span> add_route_to_server : <span><a href="../Tiny_httpd_core/Server/index.html#type-t">Tiny_httpd_core.Server.t</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Registry/index.html#type-t">Registry.t</a> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p>Add a &quot;/metrics&quot; route to the server</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-instrument_server"><a href="#val-instrument_server" class="anchor"></a><code><span><span class="keyword">val</span> instrument_server : <span><a href="../Tiny_httpd_core/Server/index.html#type-t">Tiny_httpd_core.Server.t</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Registry/index.html#type-t">Registry.t</a> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div><div class="spec-doc"><p>Add middleware and route</p></div></div><div class="odoc-spec"><div class="spec module anchored" id="module-GC_metrics"><a href="#module-GC_metrics" class="anchor"></a><code><span><span class="keyword">module</span> <a href="GC_metrics/index.html">GC_metrics</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div></div></div></body></html>