#logging #metrics #profiling #telemetry #tracing

macro tracing-attributes-hyper

No-op attribute placeholders for the Hyper compile-time tracing plugin system

1 unstable release

Uses new Rust 2021

0.0.0 Feb 27, 2022

#40 in #telemetry

MIT license



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:

  1. in the [dependencies] stanza: redirect to a published crate, or
  2. in the [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:

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

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
# Your Hyper based application details

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

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.


~16K SLoC