Why does `octocrab` need `tracing` as a feature?
Closed this issue ยท 4 comments
Recently while working on this PR, we noticed the below:
Octocrab octocrab tries to not download tracing
libraries for users who do not use tracing
feature. However,tracing
downloaded by default by hyper
. Since Octocrab depends on hyper
, tracing
library gets downloaded by default.
Unless all the upstream libraries have similar feature flag, the feature flag tracing
of octocrab
does not seem to have any benefit.
Can we remove the tracing
feature flag? if not, why?
If the feature flag serves other purposes, please let me know.
I am happy to work on this once you give your thoughts and direction ๐โโ๏ธ
Thank you for your issue! You're right that it doesn't save a dependency currently. however there is a compile time and runtime cost to tracing/logging, that is removed with the feature.
Also the goal is to eventually remove the hyper dependency entirely so users can choose their HTTP client library, so it will be more relevant then.
however there is a compile time and runtime cost to tracing/logging, that is removed with the feature.
wow! wasnt aware that simple tracing log statements could affect compile time and runtime.
Thanks for the clarification, closing this issue in that case. I have also raised an issue upstream hyperium/hyper#3304 requesting them to feature flag tracing
, i will probably try implementing that in hyper, not sure if it would be good-first-issue
for me to pick up tho. ๐ค
To be clear, depending on your application, the cost is incredibly minimal and it will usually never be a bottleneck, but there's always some cost, and it can also add extra noise to logs you might not want.
Thanks for clarification