fix: drop type params from Go function names #3010
Merged
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.
This change involves the removal of type parameters from Go function names during the ingestion process.
The primary rationale behind this modification is that, in Go, function type parameters within profiles are often encountered in unexpected code paths. Allegedly, the Go profiler does not consider the call site when constructing the function name and may include parameters from irrelevant function instantiations. This behavior significantly increases the cardinality of stack traces. For more details, please refer to #2241, specifically this comment.
The elimination of type parameters results in a reduction of cardinality by up to 50% (ingester's heap, 1 hour):
Regarding the impact on PGO: given that we cannot rely on the parameters, no negative impact is expected.
We probably should be more specific about the Go version, but we do not have this information yet. Theoretically, we only have to do this for go < 1.22 / 1.21.6.
Related:
Go: