Skip to content

Commit

Permalink
Merge pull request #50 from michellymenezes/patch-1
Browse files Browse the repository at this point in the history
Index Readme documentation
  • Loading branch information
MalloZup authored Oct 2, 2020
2 parents 02bed10 + 44746d8 commit 0f4da02
Showing 1 changed file with 34 additions and 16 deletions.
50 changes: 34 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,27 @@ tasks.

**N.B.** Since version 0.1.9, iapetos is released as `clj-commons/iapetos` on Clojars. Previously it was available as `xsc/iapetos`.

## Basic Usage

### Registering Metrics
### Table of Contents
- [Basic Usage](#basic-usage)
- [Registering Metrics](#registering-metrics)
- [Metric Export](#metric-export)
- [Metric Push](#metric-push)
- [Labels](#labels)
- [Subsystems](#subsystems)
- [Features](#fatures)
- [Code Block Instrumentation](#code-block-instrumentation)
- [JVM Metrics](#jvm-metrics)
- [Function Instrumentation](#function-instrumentation)
- [Ring](#ring)
- [Exception Handling](#exception-handling)
- [Standalone HTTP Server](#standalone-http-server)
- [History](#history)
- [License](#license)


## Basic Usage <a name="basic-usage"></a>

### Registering Metrics <a name="registering-metrics"></a>

[__Documentation__](https://clj-commons.github.io/iapetos/iapetos.core.html)

Expand Down Expand Up @@ -60,7 +78,7 @@ All metric operations can be called directly on such a collector, i.e.:
(prometheus/set (registry :app/active-users-total) 22)
```

### Metric Export
### Metric Export <a name="metric-export"></a>

[__Documentation__](https://clj-commons.github.io/iapetos/iapetos.export.html)

Expand All @@ -83,7 +101,7 @@ Metrics can be transformed into a textual representation using
This could now be exposed e.g. using an HTTP endpoint (see also iapetos'
[Ring](#ring) integration or the [standalone server](#standalone-http-server) ).

### Metric Push
### Metric Push <a name="metric-push"></a>

[__Documentation__](https://clj-commons.github.io/iapetos/iapetos.export.html)

Expand Down Expand Up @@ -115,7 +133,7 @@ something like:
(run-job! ...)))
```

### Labels
### Labels <a name="labels"></a>

Prometheus allows for labels to be associated with metrics which can be declared
for each collector before it is registered:
Expand Down Expand Up @@ -151,7 +169,7 @@ registry with a label/value-map:
;; ...
```

### Subsystems
### Subsystems <a name="subsystems"></a>

In addition to namespaces, you can create collector declarations belonging to a
subsystem, i.e.:
Expand Down Expand Up @@ -191,9 +209,9 @@ original registry's collectors, i.e. you have to reregister things like
[function instrumentation](#function-instrumentation) or [Ring](#ring)
collectors.)

## Features
## Features <a name="features"></a>

### Code Block Instrumentation
### Code Block Instrumentation <a name="code-block-instrumentation"></a>

[__Documentation__](https://clj-commons.github.io/iapetos/iapetos.core.html)

Expand All @@ -211,7 +229,7 @@ See the auto-generated documentation for all available macros or the [function
instrumentation](#function-instrumentation) section below on how to easily wrap
them around existing functions.

### JVM Metrics
### JVM Metrics <a name="jvm-metrics"></a>

[__Documentation__](https://clj-commons.github.io/iapetos/iapetos.collector.jvm.html)

Expand Down Expand Up @@ -242,7 +260,7 @@ Alternatively, you can selectively register the JVM collectors:
__Note:__ You need to include the artifact `io.prometheus/simpleclient_hotspot`
explicitly in your project's dependencies.

### Function Instrumentation
### Function Instrumentation <a name="function-instrumentation"></a>

[__Documentation__](https://clj-commons.github.io/iapetos/iapetos.collector.fn.html)

Expand All @@ -268,7 +286,7 @@ Now, every call to `run-the-job!` will update a series of duration, success and
failure metrics. Note, however, that re-evaluation of the `run-the-job!`
declaration will remove the instrumentation again.

### Ring
### Ring <a name="ring"></a>

[__Documentation__](https://clj-commons.github.io/iapetos/iapetos.collector.ring.html)

Expand Down Expand Up @@ -306,7 +324,7 @@ These are, purposefully, compatible with the metrics produced by
[prometheus-clj](https://github.com/soundcloud/prometheus-clj), as to allow a
smooth migration.

#### Exception Handling
#### Exception Handling <a name="exception-handling"></a>

By default, if your ring handler throws an exception, only the `http_exceptions_total` counter would be incremented.
This means that if you respond with a 500 error code on exceptions:
Expand All @@ -329,7 +347,7 @@ will increment all 3 metrics, assuming a 500 response code for exceptions:
- `http_request_latency_seconds`
- `http_exceptions_total`

### Standalone HTTP Server
### Standalone HTTP Server <a name="standalone-http-server"></a>

[__Documentation__](https://clj-commons.github.io/iapetos/iapetos.standalone.html)

Expand All @@ -347,13 +365,13 @@ This is particularly useful for applications that do not expose an HTTP port
themselves but shall still be scraped by Prometheus. By default, metrics will
be exposed at `/metrics`.

## History
## History <a name="history"></a>

iapetos was originally created by Yannick Scherer ([@xsc](https://github.com/xsc)). In July 2019 it was moved to CLJ Commons for continued maintenance.

It could previously be found at [xsc/iapetos](https://github.com/xsc/iapetos). [clj-commons/iapetos](https://github.com/clj-commons/iapetos) is the canonical repository now.

## License
## License <a name="license"></a>

```
MIT License
Expand Down

0 comments on commit 0f4da02

Please sign in to comment.