Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into hds/mock-docs-expect
Browse files Browse the repository at this point in the history
  • Loading branch information
hds committed Oct 30, 2024
2 parents dfa827b + 21c5ce0 commit c467577
Show file tree
Hide file tree
Showing 186 changed files with 6,182 additions and 5,213 deletions.
3 changes: 0 additions & 3 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,5 @@
# David contributed the Registry implementation.
/tracing-subscriber/registry @davidbarsky @hawkw @tokio-rs/tracing

# Julian contributed the OpenTelemetry implementation.
/tracing-opentelemetry/ @jtescher @tokio-rs/tracing

# Zeki contributed the TracingAppender implementation
/tracing-appender/ @zekisherif @tokio-rs/tracing
55 changes: 14 additions & 41 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
name: cargo check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Check
run: cargo check --all --tests --benches
Expand All @@ -46,7 +46,7 @@ jobs:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
Expand All @@ -58,7 +58,7 @@ jobs:
runs-on: ubuntu-latest
needs: check
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
Expand All @@ -85,13 +85,11 @@ jobs:
- tracing-macros
- tracing-serde
- tracing-tower
- tracing-opentelemetry
- tracing
- tracing-subscriber
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable

- name: install cargo-hack
uses: taiki-e/install-action@cargo-hack
- name: cargo hack check
Expand Down Expand Up @@ -123,7 +121,7 @@ jobs:
shell: bash

check-msrv:
# Run `cargo check` on our minimum supported Rust version (1.49.0). This
# Run `cargo check` on our minimum supported Rust version (1.63.0). This
# checks with minimal versions; maximal versions are checked above.
name: "cargo check (+MSRV -Zminimal-versions)"
needs: check
Expand All @@ -143,29 +141,12 @@ jobs:
- tracing-serde
- tracing-subscriber
- tracing-tower
- tracing-opentelemetry
- tracing
toolchain:
- 1.49.0
- 1.63.0
- stable
# TODO(eliza): remove this when appender is on the same MSRV.
# same for tracing subscriber
exclude:
- subcrate: tracing-appender
toolchain: 1.49.0
- subcrate: tracing-subscriber
toolchain: 1.49.0
- subcrate: tracing-opentelemetry
toolchain: 1.49.0
include:
- subcrate: tracing-appender
toolchain: 1.53.0
- subcrate: tracing-subscriber
toolchain: 1.50.0
- subcrate: tracing-opentelemetry
toolchain: 1.56.0
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: install Rust nightly
uses: dtolnay/rust-toolchain@nightly
- name: "install Rust ${{ matrix.toolchain }}"
Expand Down Expand Up @@ -229,7 +210,7 @@ jobs:
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: "install Rust ${{ matrix.rust }}"
uses: dtolnay/rust-toolchain@master
with:
Expand Down Expand Up @@ -266,13 +247,12 @@ jobs:
- tracing-journald
- tracing-log
- tracing-macros
- tracing-opentelemetry
- tracing-serde
- tracing-subscriber
- tracing-tower
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
target: wasm32-unknown-unknown
Expand All @@ -288,9 +268,11 @@ jobs:
subcrate:
- tracing
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: actions/checkout@v4
- name: Install Rust 1.81
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.81
target: wasm32-unknown-unknown
- name: install test runner for wasm
uses: taiki-e/install-action@wasm-pack
Expand All @@ -299,35 +281,26 @@ jobs:

test-features-stable:
# Feature flag tests that run on stable Rust.
# TODO(david): once tracing's MSRV goes up to Rust 1.51, we should be able to switch to
# using cargo's V2 feature resolver (https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions)
# and avoid cd'ing into each crate's directory.
name: cargo test (feature-specific)
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: "Test log support"
run: cargo test
working-directory: "tracing/test-log-support"
- name: "Test static max level"
run: cargo test
working-directory: "tracing/test_static_max_level_features"
- name: "Test static max level (release)"
run: cargo test --release
working-directory: "tracing/test_static_max_level_features"
- name: "Test tracing-core no-std support"
run: cargo test --no-default-features
working-directory: tracing
- name: "Test tracing no-std support"
run: cargo test --no-default-features
working-directory: tracing
# this skips running doctests under the `--no-default-features` flag,
# as rustdoc isn't aware of cargo's feature flags.
- name: "Test tracing-subscriber with all features disabled"
run: cargo test --lib --tests --no-default-features
working-directory: tracing-subscriber

# all required checks except for the main test run (which we only require
# specific matrix combinations from)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
security_audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions-rs/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
if: github.repository_owner == 'tokio-rs'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: taiki-e/create-gh-release-action@v1
with:
prefix: tracing(-[a-z]+)?
Expand Down
9 changes: 7 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[workspace]

resolver = "2"
members = [
"tracing",
"tracing-core",
Expand All @@ -11,10 +11,15 @@ members = [
"tracing-log",
"tracing-macros",
"tracing-mock",
"tracing-opentelemetry",
"tracing-subscriber",
"tracing-serde",
"tracing-test",
"tracing-appender",
"tracing-journald",
"examples"
]

# This will be ignored with Rust older than 1.74, but for now that's okay;
# we're only using it to fix check-cfg issues that first appeared in Rust 1.80.
[workspace.lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ["cfg(flaky_tests)", "cfg(tracing_unstable)"] }
24 changes: 14 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,14 +254,14 @@ attachment that `Future::instrument` does.
## Supported Rust Versions

Tracing is built against the latest stable release. The minimum supported
version is 1.49. The current Tracing version is not guaranteed to build on Rust
version is 1.63. The current Tracing version is not guaranteed to build on Rust
versions earlier than the minimum supported version.

Tracing follows the same compiler support policies as the rest of the Tokio
project. The current stable Rust compiler and the three most recent minor
versions before it will always be supported. For example, if the current stable
compiler version is 1.45, the minimum supported version will not be increased
past 1.42, three minor versions prior. Increasing the minimum supported compiler
compiler version is 1.69, the minimum supported version will not be increased
past 1.66, three minor versions prior. Increasing the minimum supported compiler
version is not considered a semver breaking change as long as doing so complies
with this policy.

Expand Down Expand Up @@ -307,11 +307,6 @@ The crates included as part of Tracing are:

* [`tracing-log`]: Compatibility with the `log` crate (unstable).

* [`tracing-opentelemetry`]: Provides a layer that connects spans from multiple
systems into a trace and emits them to [OpenTelemetry]-compatible distributed
tracing systems for processing and visualization.
([crates.io][otel-crates]|[docs][otel-docs])

* [`tracing-serde`]: A compatibility layer for serializing trace data with
`serde` (unstable).

Expand Down Expand Up @@ -339,7 +334,6 @@ The crates included as part of Tracing are:
[`tracing-macros`]: tracing-macros
[`tracing-attributes`]: tracing-attributes
[`tracing-log`]: tracing-log
[`tracing-opentelemetry`]: tracing-opentelemetry
[`tracing-serde`]: tracing-serde
[`tracing-subscriber`]: tracing-subscriber
[`tracing-tower`]: tracing-tower
Expand Down Expand Up @@ -377,6 +371,7 @@ are not maintained by the `tokio` project. These include:
- [`tracing-actix-web`] provides `tracing` integration for the `actix-web` web framework.
- [`tracing-actix`] provides `tracing` integration for the `actix` actor
framework.
- [`axum-insights`] provides `tracing` integration and Application insights export for the `axum` web framework.
- [`tracing-gelf`] implements a subscriber for exporting traces in Greylog
GELF format.
- [`tracing-coz`] provides integration with the [coz] causal profiler
Expand Down Expand Up @@ -409,6 +404,8 @@ are not maintained by the `tokio` project. These include:
- [`tracing-logfmt`] provides a layer that formats events and spans into the logfmt format.
- [`tracing-chrome`] provides a layer that exports trace data that can be viewed in `chrome://tracing`.
- [`reqwest-tracing`] provides a middleware to trace [`reqwest`] HTTP requests.
- [`tracing-cloudwatch`] provides a layer that sends events to AWS CloudWatch Logs.
- [`clippy-tracing`] provides a tool to add, remove and check for `tracing::instrument`.

(if you're the maintainer of a `tracing` ecosystem crate not in this list,
please let us know!)
Expand All @@ -419,6 +416,7 @@ please let us know!)
[honeycomb.io]: https://www.honeycomb.io/
[`tracing-actix`]: https://crates.io/crates/tracing-actix
[`tracing-actix-web`]: https://crates.io/crates/tracing-actix-web
[`axum-insights`]: https://crates.io/crates/axum-insights
[`tracing-gelf`]: https://crates.io/crates/tracing-gelf
[`tracing-coz`]: https://crates.io/crates/tracing-coz
[coz]: https://github.com/plasma-umass/coz
Expand All @@ -440,7 +438,7 @@ please let us know!)
[Tracy]: https://github.com/wolfpld/tracy
[`tracing-elastic-apm`]: https://crates.io/crates/tracing-elastic-apm
[Elastic APM]: https://www.elastic.co/apm
[`tracing-etw`]: https://github.com/microsoft/tracing-etw
[`tracing-etw`]: https://github.com/microsoft/rust_win_etw/tree/main/win_etw_tracing
[ETW]: https://docs.microsoft.com/en-us/windows/win32/etw/about-event-tracing
[`sentry-tracing`]: https://crates.io/crates/sentry-tracing
[Sentry]: https://sentry.io/welcome/
Expand All @@ -451,6 +449,8 @@ please let us know!)
[`tracing-chrome`]: https://crates.io/crates/tracing-chrome
[`reqwest-tracing`]: https://crates.io/crates/reqwest-tracing
[`reqwest`]: https://crates.io/crates/reqwest
[`tracing-cloudwatch`]: https://crates.io/crates/tracing-cloudwatch
[`clippy-tracing`]: https://crates.io/crates/clippy-tracing

**Note:** that some of the ecosystem crates are currently unreleased and
undergoing active development. They may be less stable than `tracing` and
Expand All @@ -466,14 +466,17 @@ Tracing.
* [Diagnostics with Tracing][tokio-blog-2019-08] on the Tokio blog, August 2019
* [Production-Grade Logging in Rust Applications][production-logging-2020], November 2020
* [Custom Logging in Rust using `tracing` and `tracing-subscriber`, part 1][custom-logging-part-1] and [part 2][custom-logging-part-2], October 2021
* [Instrumenting Axum projects][detsys-blog-2023-08], August 2023

[tokio-blog-2019-08]: https://tokio.rs/blog/2019-08-tracing/
[detsys-blog-2023-08]: https://determinate.systems/posts/instrumenting-axum

#### Talks

* [Bay Area Rust Meetup talk and Q&A][bay-rust-2019-03], March 2019
* [RustConf 2019 talk][rust-conf-2019-08-video] and [slides][rust-conf-2019-08-slides], August 2019
* [Are we observable yet? @ RustyDays talk][rusty-days-2020-08-video] and [slides][rusty-days-2020-08-slides], August 2020
* [Crabs with instruments!][tremorcon-2021-09], September 2021

[bay-rust-2019-03]: https://www.youtube.com/watch?v=j_kXRg3zlec
[rust-conf-2019-08-video]: https://www.youtube.com/watch?v=JjItsfqFIdo
Expand All @@ -483,6 +486,7 @@ Tracing.
[production-logging-2020]: https://medium.com/better-programming/production-grade-logging-in-rust-applications-2c7fffd108a6
[custom-logging-part-1]: https://burgers.io/custom-logging-in-rust-using-tracing
[custom-logging-part-2]: https://burgers.io/custom-logging-in-rust-using-tracing-part-2
[tremorcon-2021-09]: https://www.youtube.com/watch?v=ZC7fyqshun8

Help us expand this list! If you've written or spoken about Tracing, or
know of resources that aren't listed, please open a pull request adding them.
Expand Down
9 changes: 9 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Security Policy

Tracing is part of the Tokio project and uses the same security policy as [Tokio][tokio-security].

## Report a security issue

The process for reporting an issue is the same as for [Tokio][tokio-security]. This includes private reporting via [email protected].

[tokio-security]: https://github.com/tokio-rs/tokio/security/policy
14 changes: 8 additions & 6 deletions assets/warning.css → assets/warning-css.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#tracing-warning-header {
<style>
#tracing-warning-header {
z-index: 400;
position: fixed;
background-color: orange;
Expand All @@ -12,14 +13,15 @@
line-height: 0.6;
padding-top: 10px;
padding-left: 230px;
}
}

body {
body {
/* add top padding to fit the warning header */
padding-top: 50px !important;
}
}

.sidebar {
.sidebar {
/* add top padding to fit the warning header */
margin-top: 50px !important;
}
}
</style>
13 changes: 4 additions & 9 deletions examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "tracing-examples"
version = "0.0.0"
publish = false
edition = "2018"
rust-version = "1.49.0"
rust-version = "1.64.0"

[features]
default = []
Expand All @@ -21,7 +21,6 @@ tracing-futures = { version = "0.3", path = "../tracing-futures", features = ["f
tracing-attributes = { path = "../tracing-attributes", version = "0.2"}
tracing-log = { path = "../tracing-log", version = "0.2", features = ["env_logger"] }
tracing-serde = { path = "../tracing-serde" }
tracing-opentelemetry = { path = "../tracing-opentelemetry" }
tracing-appender = { path = "../tracing-appender" }
tracing-journald = { path = "../tracing-journald" }

Expand All @@ -31,9 +30,6 @@ serde_json = "1.0.82"
futures = "0.3.21"
tokio = { version = "1.20.0", features = ["full"] }

# env-logger example
env_logger = "0.8.4"

# tower examples
tower = { version = "0.4.13", features = ["full"] }
http = "0.2.8"
Expand All @@ -51,10 +47,9 @@ log = "0.4.17"
inferno = "0.11.6"
tempfile = "3.3.0"

# opentelemetry example
opentelemetry = { version = "0.18.0", default-features = false, features = ["trace"] }
opentelemetry-jaeger = "0.17.0"

# fmt examples
snafu = "0.6.10"
thiserror = "1.0.31"

[lints]
workspace = true
Loading

0 comments on commit c467577

Please sign in to comment.