Commits on Source (2)
-
Alexandre Janniaux authored
This commit allows rust code to use the tracer API, through the trace!() macro, and also exposes a TracerCapability and TracerModuleLoader to create new tracer modules in Rust.
3a3b5d67 -
Alexandre Janniaux authored
The tracer is designed to send the metrics towards a telegraf server using this kind of configuration: [[inputs.socket_listener]] service_address = "tcp://localhost:8094" The telegraf server can then forward the metrics towards an influxdb server for monitoring or directly to grafana live server[^1] for introspection. The influxdb database can also be used to query the metrics after they've been indexed. The application using the tracer can use the VLC_TELEGRAF_ENDPOINT environment variable (eg. VLC_TELEGRAF_ENDPOINT=tcp://127.0.0.1:8094) to set where the tracer will output the traces to. A bunch of notes and improvement left for later: - Unsafe code is still used for accessing the fields data since an union is used and union access is unsafe. It could probably be wrapped from the binding implementation. - There is no way to specify the address using the configuration since vlc_variable is not bound to the Rust bindings and no unsafe extern "C" code...
e8e46b0d
Showing
- Cargo.toml 3 additions, 2 deletionsCargo.toml
- modules/logger/Makefile.am 18 additions, 0 deletionsmodules/logger/Makefile.am
- modules/logger/telegraf-rs/Cargo.toml 13 additions, 0 deletionsmodules/logger/telegraf-rs/Cargo.toml
- modules/logger/telegraf-rs/src/lib.rs 119 additions, 0 deletionsmodules/logger/telegraf-rs/src/lib.rs
- src/rust/vlcrs-core/Cargo.toml 3 additions, 0 deletionssrc/rust/vlcrs-core/Cargo.toml
- src/rust/vlcrs-core/src/lib.rs 20 additions, 0 deletionssrc/rust/vlcrs-core/src/lib.rs
- src/rust/vlcrs-core/src/tracer/mod.rs 215 additions, 0 deletionssrc/rust/vlcrs-core/src/tracer/mod.rs
- src/rust/vlcrs-core/src/tracer/sys.rs 193 additions, 0 deletionssrc/rust/vlcrs-core/src/tracer/sys.rs
modules/logger/telegraf-rs/Cargo.toml
0 → 100644
modules/logger/telegraf-rs/src/lib.rs
0 → 100644
src/rust/vlcrs-core/src/tracer/mod.rs
0 → 100644
src/rust/vlcrs-core/src/tracer/sys.rs
0 → 100644