Skip to content

Nested (i.e., dotted) field name support in #[tracing::instrument] #3338

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

anarchvile
Copy link

Motivation

I was reading the #[tracing::instrument] documentation, and noticed it mentioning that nested/dotted field names were not supported by the macro. However, I had code written and instrumented with #[tracing::instrument] macros where I was explicitly adding fields whose names were nested/dotted, and it all seemed to work fine/as-expected (i.e., the emitted spans had the correct field name and value, even with the dotted notation)...

Solution

Decided to simply amend the docs to reflect that the nested/dotted field names do seem to work as of today, and modified a unit test to exercise this accordingly? That being said, I may be missing some broader context/other nuances that actually prevent this from working as-intended. If so, just let me know, am more than happy to learn and take any further actions as necessary! 😅

…s are not supported in the instrument macro, update unit test accordingly.
@anarchvile anarchvile requested review from hawkw and a team as code owners July 14, 2025 21:54
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.

1 participant