Skip to content

Fix: Container Names Missing from Uploaded Profile Data - #68

Open
artursarlo wants to merge 1 commit into
masterfrom
fix/profiling_data_missing_matadata_fields
Open

Fix: Container Names Missing from Uploaded Profile Data#68
artursarlo wants to merge 1 commit into
masterfrom
fix/profiling_data_missing_matadata_fields

Conversation

@artursarlo

@artursarlo artursarlo commented Mar 19, 2026

Copy link
Copy Markdown

Fix: Container Names Missing from Uploaded Profile Data

Problem

When the --flamegraph flag is enabled, uploaded profiles were always reporting an empty containers list in the profile metadata, causing container attribution to be lost on the backend.

The root cause was a side effect in _make_profile_metadata (merge.py): every time it is called with a non-None container_names_client, it reads and then immediately clears the container name cache via container_names_client.reset_cache().

The pre-generation block in _snapshot — which creates a temporary merged result solely to generate the flamegraph_html — was passing the real self._profiler_state.container_names_client to both concatenate_profiles and merge_profiles. This caused reset_cache() to be called during the temporary merge, draining the cache before the actual merged_result (which is what gets uploaded) had a chance to consume it.

Fix

Pass container_names_client=None in both temporary merge calls (concatenate_profiles and merge_profiles) inside the flamegraph pre-generation block.

Container names are not needed by the temporary merge — its output is only used to extract stripped stack data for flamegraph rendering. Passing None skips the cache read entirely, preserving the container names for the real merge that follows.

Impact

  • Before: metadata["containers"] was always [] in uploaded profiles when --flamegraph was enabled.
  • After: metadata["containers"] is correctly populated, matching the behavior when --flamegraph is disabled.
  • No change to flamegraph generation logic or output.

@artursarlo artursarlo changed the title Fix missing cantainer metadata information from profiling upload Fix: Container Names Missing from Uploaded Profile Data Mar 19, 2026
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