Instrument asset loading and processing.#12988
Merged
alice-i-cecile merged 1 commit intobevyengine:mainfrom Apr 16, 2024
Merged
Instrument asset loading and processing.#12988alice-i-cecile merged 1 commit intobevyengine:mainfrom
alice-i-cecile merged 1 commit intobevyengine:mainfrom
Conversation
viridia
approved these changes
Apr 16, 2024
james7132
approved these changes
Apr 16, 2024
github-merge-queue bot
pushed a commit
that referenced
this pull request
Dec 22, 2025
…t keep the instrumentation. (#22213) # Objective - In #12988, we added tracing spans to asset loading and processing, by creating wrapper structs `InstrumentedAssetLoader` and `InstrumentedAssetProcessor`. - Unfortunately, this causes an issue where `ErasedAssetLoader::{default_meta, type_path}` and `ErasedProcessor::default_meta` can return the wrong type path when using the `trace` feature, and this type path could be written into a meta file, which will be rendered unloadable/unprocessable. - Note even though the loader/processor's type use to have the instrumentation wrapper, when registering the loader/processor, we would actually register the loader/processor under the original type names. So you could still load non-`trace` written meta files, but `trace` written meta files would fail to load whether `trace` was enabled or not! ## Solution - Remove the wrapper loader/processor and instead just create the spans at the callsites. I checked and there's a single callsite of `load` and a single callsite of `process` - very good! - I also added testing that was omitted in #17216 (due to missing test utilities which have since been added). This is how I found out about this problem! Score one for testing. ## Testing - We still produce spans in the `asset_processing` example for both loading and processing. Note: We don't need a migration guide since users should really not be using these directly, and any meta files using these would just be broken.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Objective
As described in #12467, Bevy does not have any spans for any of the tasks scheduled onto the IO and async compute task pools.
Solution
Instrument all asset loads and asset processing. Since this change is restricted to asset tasks, it does not completely solve #12467, but it does mean we can record the asset path in the trace.
Changelog
Tracing will now include spans for asset loading and asset processing.