diff --git a/README.md b/README.md index f00eb4fe..efe087d1 100644 --- a/README.md +++ b/README.md @@ -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**: diff --git a/docs/build-clio.md b/docs/build-clio.md index c681090f..6351b034 100644 --- a/docs/build-clio.md +++ b/docs/build-clio.md @@ -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 +``` diff --git a/docs/metrics-and-static-analysis.md b/docs/metrics-and-static-analysis.md deleted file mode 100644 index 79268565..00000000 --- a/docs/metrics-and-static-analysis.md +++ /dev/null @@ -1,30 +0,0 @@ -# Metrics and static analysis - -## 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/). - -## 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 -``` diff --git a/docs/run-clio.md b/docs/run-clio.md index 51c5a2ca..e5309a80 100644 --- a/docs/run-clio.md +++ b/docs/run-clio.md @@ -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/).