-
Notifications
You must be signed in to change notification settings - Fork 725
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
Improve #[instrument(ret, err)] handling for tracing-opentelemetry #2316
Open
notheotherben
wants to merge
21
commits into
tokio-rs:master
Choose a base branch
from
SierraSoftworks:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
e8818a7
attributes: Add support for recording raw err and ret values
notheotherben aa51983
attributes: Make further improvements to `#[instrument(err)]` output
notheotherben 24d5185
attributes: Improve output for #[instrument(ret)]
notheotherben 05fe072
refactor: Update to work with the latest version of tracing
notheotherben 26a72af
doc: Update code documentation per review suggestions
notheotherben 80badf2
refactor: Rename FormatMode::Raw to FormatMode::Value
notheotherben ab508da
refactor: Complete renaming of Raw -> Value
notheotherben 8cb7600
doc: Fixup documentation for new tracing macros
notheotherben c00b5e9
Merge branch 'master' into master
notheotherben 87bb7fd
tweak: Adjust error messages to use correct pluralization
notheotherben 4761bb5
Merge branch 'master' into master
notheotherben 9712c71
refactor: Make it easier to add new FormatModes in future
notheotherben ed8b172
test: Use the correct method name for the err_value test
notheotherben 7caabae
doc: Update documentation for the tracing-attributes crate to improve…
notheotherben 7d8fc38
style: Run cargo fmt
notheotherben f576114
refactor: Further updates to the FormatMode implementation to simplif…
notheotherben d1d3c93
refactor: Implement an options function to ensure that FormatMode err…
notheotherben d4578fd
refactor: Switch from an options list to an option_list function
notheotherben f8d1723
fix: Resolve compilation issues with the latest MSRV
notheotherben 5fbfd21
Merge branch 'master' into master
notheotherben 1440cc1
test: Fix test execution failures
notheotherben File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some types, such as
anyhow::Error
, don't actually implementError
directly, but haveAsRef<&dyn Error>
implementations. is there anything we can do to make this mode also work nicely for events that have to beas_ref
'd, without breaking returns for values which areError
implementers?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's an interesting area to think about. Presumably this falls into the problem domain of mapping attribute values to the
record_error(...)
hook within theLayer
implementation?I'm expecting that in this specific scenario we're not going to see too much by way of business logic around value types, though if I've missed something then please shout. As for implementing the business logic for handling
AsRef<&dyn Error>
I'm happy to chase that down, though I would propose landing that in a separate PR to keep the concepts neatly segregated.