Crates.io | tracing-attributes-hyper |
lib.rs | tracing-attributes-hyper |
version | 0.0.0 |
source | src |
created_at | 2022-02-27 06:37:44.034358 |
updated_at | 2022-02-27 06:37:44.034358 |
description | No-op attribute placeholders for the Hyper compile-time tracing plugin system. |
homepage | https://docs.rs/tracing-attributes-hyper |
repository | https://github.com/taqtiqa-mark/tracing-attributes-hyper |
max_upload_size | |
id | 540249 |
size | 23,409 |
tracing-attributes-hyper
This crate is in development and should not be used until version > 0.0
A proc-macro crate providing Tracing placeholder spans in Hyper.
Many projects prefer or require specific structured log data is produced by their application. In addition, bespoke tracing logic often cannot be published to a registry.
Hyper does not impose trace data preferences on your application. Hyper does not require your tracing logic be published.
Instead, this crate serves as a placeholder that your application will:
[dependencies]
stanza: redirect to a published crate, or[patch]
stanza: redirect to an published crate (e.g. github, etc.).This pattern repurposes Cargo's [patch]
(and [dependencies]
) from
[overiding dependencies], to serve as a compile-time plugin system for
Hyper tracing.
Hyper uses a subset of the tracing-attributes-http
crate, so this is a
functional default.
If the Hyper tracing plugin has been published to crates.io:
[dependencies]
tracing-attributes-hyper = { version = "0.2", package = "tracing-attributes-http" }
Plug in unpublished Hyper tracing logic uniformly across all your projects (see the note below),
stabilized
in Rust version >= 1.56
:
# ~/.cargo/config.toml
# Your Cargo configuration details
[patch.crates-io]
tracing-attributes-hyper = {
git = https://github.com/taqtiqa-mark/tracing-attributes-http,
features = ["otel"]
}
Plug in unpublished tracing logic specific to one project:
# Cargo.toml
[package]
# Your Hyper based application details
[patch.crates-io]
tracing-attributes-hyper = {
git = https://github.com/taqtiqa-mark/tracing-attributes-http,
features = ["otel", "http-optional"]
}
If a given dependency is patched both in a cargo configuration file and a Cargo.toml file, the patch in the configuration file is used. If multiple configuration files patch the same dependency, standard cargo configuration merging is used, which prefers the value defined closest to the current directory, with $HOME/.cargo/config.toml taking the lowest precedence.
To publish the crate:
cargo login <api-token>
cargo publish
cargo publish --dry-run
Licensed under either of
Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.