Skip to content

Commit dc349d0

Browse files
authored
[OMON-753] Update docs for reading metrics from Kafka (#340)
1 parent 9c4de85 commit dc349d0

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

README.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -206,13 +206,15 @@ This guide explains manual installation. For `ansible` deployment see [AliceO2Gr
206206
## Receiving metrics from Monitoring system (development instructions)
207207

208208
### Requirements
209-
- CS8 or CC7 with `devtoolset-9`
210-
- Boost >= 1.70
209+
- Ubuntu, RHEL9, RHEL8, CS8, macOS, or CC7 with `devtoolset-9`
210+
- Boost >= 1.83, CMake
211211

212212
### Compile Monitoring library with Kafka backend
213+
214+
#### Manually
213215
- Compile `librdkafka`
214216
```bash
215-
git clone -b v1.8.2 https://github.com/edenhill/librdkafka && cd librdkafka
217+
git clone -b v2.3.0 https://github.com/edenhill/librdkafka && cd librdkafka
216218
cmake -H. -B./_cmake_build -DENABLE_LZ4_EXT=OFF -DCMAKE_INSTALL_LIBDIR=lib -DRDKAFKA_BUILD_TESTS=OFF -DRDKAFKA_BUILD_EXAMPLES=OFF -DCMAKE_INSTALL_PREFIX=~/librdkafka_install
217219
cmake --build ./_cmake_build --target install -j
218220
```
@@ -223,6 +225,11 @@ This guide explains manual installation. For `ansible` deployment see [AliceO2Gr
223225
cmake --build ./_cmake_build --target install -j
224226
```
225227

228+
#### aliBuild
229+
- Modify `monitoring.sh`: add `- librdkafka` to "requires"
230+
- Compile Monitoring: `aliBuild build Monitoring --defaults o2-dataflow --always-prefer-system`
231+
- Add `Monitoring` as dependency of your project
232+
226233
### Look for Monitoring library in your CMake
227234
As `librdkafka` is optional dependency of Monitoring it is not handled by CMakeConfig, therefore you need:
228235
```cmake
@@ -237,8 +244,8 @@ And then, link against `AliceO2::Monitoring` target.
237244
#include "Monitoring/MonitoringFactory.h"
238245
...
239246

240-
std::vector<std::string> topics = {"topic-to-subscribe"};
241-
auto client = MonitoringFactory::GetPullClient("kafka-server:9092", topics);
247+
std::vector<std::string> topics = {"<topic-to-subscribe>"};
248+
auto client = MonitoringFactory::GetPullClient("<kafka-server:9092>", topics, "<client-id>");
242249
for (;;) {
243250
auto metrics = client->pull();
244251
if (!metrics.empty()) {
@@ -248,5 +255,10 @@ for (;;) {
248255
}
249256
```
250257

258+
Run-time parameters:
259+
- `<topic-to-subscribe>` - List of topics to subscribe
260+
- `<kafka-server:9092>` - Kafka broker (staging or production)
261+
- `<client_id>` - unique, self-explainable string describing the client, eg. `dcs-link-status` or `its-link-status`.
262+
251263
### Data format
252264
Native data format is [Influx Line Protocol](https://docs.influxdata.com/influxdb/latest/reference/syntax/line-protocol/) but metrics can be converted into any format listed in here: https://docs.influxdata.com/telegraf/latest/data_formats/output/

0 commit comments

Comments
 (0)