Expand description
§fenrir-rs
Fenrir (Fenrir was the son of the trickster god Loki and the giantess Angrboða) facilitates collecting and shipping your applications logs to a Loki instance. It does this by integrating with the log crate.
§Getting Started
Examples are available for several use-cases, check out the examples folder.
-
Create a new Rust project:
cargo new example
-
Add dependencies to this create to your Cargo.toml file:
[dependencies.fenrir-rs] version = "0.5.0" features = ["ureq", "json"]
-
Use it 😉
§Development and testing
For easier testing and during the development phase, you can use the example docker-compose.yml to start your own instance of Loki locally.
Just use docker compose
to start the Loki container as well as a local Grafana instance for viewing the messages:
docker compose up -d
After the containers have started, you can visit http://localhost:3000/explore to query messages in your local Loki instance.
§Minimum Supported Rust Version (MSRV)
The MSRV for this tool ist 1.60.0
.
§License
This project is licensed under the MIT License.
Modules§
- noop
- A module which contains the implementation for the
FenrirBackend
trait which ignores all network requests. - reqwest
- A module which contains the implementation for the
FenrirBackend
trait which uses thereqwest
crate for network communication. - ureq
- A module which contains the implementation for the
FenrirBackend
trait which uses theureq
crate for network communication.
Structs§
- Fenrir
- The
Fenrir
struct implements the communication interface with a Loki instance. - Fenrir
Builder - The
FenrirBuilder
struct is used to create a new instance ofFenrir
using the builder pattern. - Loki
Visitor 🔒 - A struct for visiting all structured logging labels of a log message and collecting them
- Stream 🔒
- The data structure used for attaching tags / labels to logging entries before sending them to Loki
- Streams 🔒
- The base data structure Loki expects when receiving logging messages.
Enums§
- Authentication
Method - The
AuthenticationMethod
enum is used to specify the authentication method to use when sending the log messages to the remote endpoint. - Networking
Backend - The
NetworkingBackend
defines all possible networking backends which can be used within the crate. - Serialization
Format - The
SerializationFormat
is used to configure the format to which the logging messages should be serialized to before sending them to the Loki endpoint.
Traits§
- Fenrir
Backend 🔒 - This trait is used to specify the interfaces which are required for the communication with the remote endpoint.
Functions§
- noop_
serializer 🔒 - A serialization implementation which does nothing when requesting to serialize a object
Type Aliases§
- Serialization
Fn 🔒 - The function definition which is used to serialize the logging messages for Loki