Skip to content

Commit

Permalink
docs: Move metrics and static analysis docs (#1864)
Browse files Browse the repository at this point in the history
Fixes #1219.
  • Loading branch information
maria-robobug authored Jan 31, 2025
1 parent e549657 commit e7702e9
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 31 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ Below are some useful docs to learn more about Clio.
**For Developers**:

- [How to build Clio](./docs/build-clio.md)
- [Metrics and static analysis](./docs/metrics-and-static-analysis.md)
- [Coverage report](./docs/coverage-report.md)

**For Operators**:
Expand Down
17 changes: 17 additions & 0 deletions docs/build-clio.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,20 @@ Sometimes, during development, you need to build against a custom version of `li
4. Build Clio as you would have before.
See [Building Clio](#building-clio) for details.
## Using `clang-tidy` for static analysis
The minimum [clang-tidy](https://clang.llvm.org/extra/clang-tidy/) version required is 19.0.
Clang-tidy can be run by Cmake when building the project. To achieve this, you just need to provide the option `-o lint=True` for the `conan install` command:
```sh
conan install .. --output-folder . --build missing --settings build_type=Release -o tests=True -o lint=True
```
By default Cmake will try to find `clang-tidy` automatically in your system.
To force Cmake to use your desired binary, set the `CLIO_CLANG_TIDY_BIN` environment variable to the path of the `clang-tidy` binary. For example:
```sh
export CLIO_CLANG_TIDY_BIN=/opt/homebrew/opt/llvm@19/bin/clang-tidy
```
30 changes: 0 additions & 30 deletions docs/metrics-and-static-analysis.md

This file was deleted.

12 changes: 12 additions & 0 deletions docs/run-clio.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,15 @@ Clio will fallback to hardcoded defaults when these values are not specified in

> [!TIP]
> See the [example-config.json](../docs/examples/config/example-config.json) for more details.
## Prometheus metrics collection

Clio natively supports [Prometheus](https://prometheus.io/) metrics collection. It accepts Prometheus requests on the port configured in the `server` section of the config.

Prometheus metrics are enabled by default, and replies to `/metrics` are compressed. To disable compression, and have human readable metrics, add `"prometheus": { "enabled": true, "compress_reply": false }` to Clio's config.

To completely disable Prometheus metrics add `"prometheus": { "enabled": false }` to Clio's config.

It is important to know that Clio responds to Prometheus request only if they are admin requests. If you are using the admin password feature, the same password should be provided in the Authorization header of Prometheus requests.

You can find an example docker-compose file, with Prometheus and Grafana configs, in [examples/infrastructure](../docs/examples/infrastructure/).

0 comments on commit e7702e9

Please sign in to comment.