Skip to content

Backport everything up to May 2025 #3283

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 20 commits into
base: v0.1.x
Choose a base branch
from
Draft

Backport everything up to May 2025 #3283

wants to merge 20 commits into from

Conversation

hds
Copy link
Contributor

@hds hds commented May 21, 2025

Motivation

It's probably time to get a release of the core tracing crates out.

Solution

Backport all the missing changes since the last large backport: #3144

Checklist

The list is in git log order and should be completed from bottom to top. Commits
marked with (X) and no checkbox were already backported. Commits marked
with (S) have been skipped on purpose.

The portable-atomic PRs have been skipped because they depend on changes not present in the v0.1.x branch.

hds added 2 commits May 20, 2025 12:15
We had some broken link formatting in the `tracing-journald` docs which
clippy picked up (the text looked like a link definition, but wasn't
meant to be).

The incorrect links have now been corrected. They have to link to the
`tracing-core` crate because `tracing-journald` doesn't depend on
`tracing` directly.

Fixes for a broken link in the `tracing-subscriber` main page and
correcting the link to `Collect` from `tracing-log` (which also doesn't
depend on `tracing` directly) were also included.
There was a single case of the new
[`clippy::double_ended_iterator_last`] lint which was triggered in
`tracing-attributes` and needed to be fixed.

There were also a number of cases of incorrectly indented lines, caught
in [`clippy::doc_overindented_list_items`].

[`clippy::double_ended_iterator_last`]: https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last
[`clippy::doc_overindented_list_items`]: https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items
@hds hds requested review from hawkw and a team as code owners May 21, 2025 13:04
Fixes:  #3140

Co-authored-by: Hayden Stainsby <hds@caffeineconcepts.com>
Co-authored-by: David Barsky <me@davidbarsky.com>
Co-authored-by: Hayden Stainsby <hds@caffeineconcepts.com>
@hds hds marked this pull request as draft May 21, 2025 14:00
@oscargus
Copy link
Contributor

If one could get #3033 (or any of the other PRs bumping matchers) in, there seems to be quite some interest in that...

(One may also consider bumping mio to version 1, as there is now a stable API. Although that will require increasing MSRV to 1.70, for the above, 1.65 is enough. Let me know if I should provide a PR for that.)

The outdated release instructions have been removed.

Follow up of #2384.

Signed-off-by: Rustin170506 <tech@rustin.me>
@hds
Copy link
Contributor Author

hds commented May 27, 2025

@oscargus #3033 has been merged and added to the list. Thanks!

ilsubyeega and others added 4 commits May 27, 2025 13:07
## Motivation

I was checking the example from `/examples/` and saw that
some of the module names were incorrect in README, so I
fixed them.

## Solution

Changed the incorrect name to the correct name.
@jonhoo recorded a great resource about the crate's inner
workings and included practical suggestions about patterns
to follow when annotating one's code.

I added the link to the YouTube video under the "Talks" header
as that seemed appropriate enough.
…tor` (#2980)

## Motivation

The current behaviour of `DefaultVisitor` is that it will write
padding even if it is going to skip writing a value, which results
in extraneous padding being added when values are skipped
by the `tracing-log` integration.

## Solution

With this change, `DefaultVisitor` will only insert padding if it is
actually going to write a value.

Closes: #2979
… call (#3227)

## Motivation

Currently, Span.record_all() is part of the public API and accepts
ValueSet as a parameter. However, constructing a ValueSet is both
verbose and undocumented, making it not so practical.

## Solution

To make recording multiple values easier, we introduce a new macro:
record_all!, which wraps the Span.record_all() function.
As we don't intend anyone to call Span.record_all() directly, we hide
it from the documentation. We reference the new macro from Span.record()
doc comment instead.

The new record_all! macro supports optional formatting sigils % and ?,
ensuring a consistent DevEx with the other value-recording macros.

Co-authored-by: Hayden Stainsby <hds@caffeineconcepts.com>
@d-e-s-o
Copy link
Contributor

d-e-s-o commented May 27, 2025

Could you please include #3187 in the release? Thanks in advance.

@jplatte
Copy link
Member

jplatte commented May 28, 2025

I also merged a couple of very simple PRs now (see recent commits on main), most or all of which should be trivial to backport.

hds and others added 11 commits May 28, 2025 12:24
There is a report in #3174 that even in release mode, building the regex
used to parse `EnvFilter` directives can take a relatively large amount
of time (600us).

This change replaces the `regex` based parsing of the directives with a
state machine implementation that is faster and also easier to reason
about.

Fixes: #3174
* macros: Add test involving raw identifier

* macros: Remove 'r#' prefix from raw identifiers in field names
This example demonstrates how to use the `tracing-subscriber` crate's
`EnvFilter` type to filter log messages based on their metadata. The
example provides a text area where users can input an environment filter
string, and displays the log messages that would be captured by that
filter.
Update the version of the `matchers` crate to 0.2. This requires also
adding a direct dependency on `regex-automata` to enable the `std`
feature.
It can be useful to have a TestWriter that does not log to stdout but
stderr instead. For example, that allows for potentially easier
filtering of tracing output (because the remaining output of, say, cargo
test goes to stdout) or to mirror behavior of env_logger, which by
default logs to stderr.
Introduce the TestWriter::with_stderr() constructor to enable such
usage. The default is left unchanged.

Co-authored-by: David Barsky <me@davidbarsky.com>
Avoid ambiguities with any user-defined `tracing` modules by globally qualifying types used in the attribute-generated code e.g., `::tracing::Level`.
@jplatte
Copy link
Member

jplatte commented May 29, 2025

Checkboxes are all ticked, anything else to be done? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.