{"repo":"somehowchris/rocket-tracing-fairing-example","free":true,"listed":false,"github":"https://github.com/somehowchris/rocket-tracing-fairing-example","clone":"git clone https://github.com/somehowchris/rocket-tracing-fairing-example.git","description":"An example of a fairing for rocket to use tracing (as this pops up at many places in dicussions and questions)","language":"Rust","stars":17,"topics":["rocket","tracing","async","tokio","tokio-rs","fairing"],"license":null,"category":"analytics","readme_excerpt":"Rocket Tracing Fairing Example This repository aims to give a short example of how you can add a Fairing to your Rocket for tracing and how to use it in requests. As Rocket currently doesn't implement this by default many have asked about implementing this. The actix-web tracing crate has been taken as a reference for the info span data Logging There 2 log types and 5 log levels you can configure at runtime. Log Types Log types control how your output is formatted. They can be controlled via the environment variable LOG TYPE . The 2 types are: - formatted (default): a good choice for development - json : the propert choice if you are running your app in a production environment. If you are using vector you can check out parse json(...) Log Levels A lot of that code originated from a stable PR in rocket's repository SergioBenites/Rocket#1579 so thanks a lot to the people there and @jebrosen for the awesome work. You can controll these with the environment variable LOG LEVEL : - critical : Shows only critical logs - support : Shows logs to help out - normal : Includes all your default logs - debug : Shows debuging with tracing - off : Shows exactly nothing Request-Tracing You need to add the enter and drop statements inside your request as Rocket will not enter the span by default as it is currently not implemented in the base repository. Names If your parser follows the opentelemetry spec it will pick up the otel.name field as the name of the span which is a composit of the ur","default_branch":null,"files":null,"tree":[],"storefront":"/r/somehowchris","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/somehowchris/rocket-tracing-fairing-example/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}