Open
Description
Since Go 1.24, the default hash table implementation is based on Abseil's "Swiss Table".
Currently, this project only supports the previous implementation by iterating over each bucket slots.
Although span context extraction from HTTP request headers is still possible using a workaround (#1636), this approach might not be viable for other use cases. Ultimately, there’s a limitation when it comes to extracting data from hash maps in Go versions >1.24.
For example, this issue (#1975) would benefit from supporting the new implementation. The custom probe initiative (#1105) would also likely be affected, as multiple probes could rely on hash map lookup.
I suggest the following:
- Add support for Swiss Table-based hash map lookup.
- Move hash map lookup functionality into go_types.h, since currently, key lookup logic is embedded directly in the probes, for example in the net/http server probe.
Activity
MrAlias commentedon Apr 29, 2025
cc @grcevski
RonFed commentedon Apr 29, 2025
I'll take this
txabman42 commentedon Apr 30, 2025
I've taken a quick 👀 to current swiss table implementation but current map structs are not public (code). @RonFed is there any easy way to get that struct field positions? 🤔
RonFed commentedon Apr 30, 2025
@txabman42 yes, using our
offsetgen
tool we can get the offsets of private structs as well - and we do it for a lot of the current instrumentations.txabman42 commentedon Apr 30, 2025
@RonFed With private I mean inside
src/internal
package, not private fields.Before, map was defined under src/runtime/map.go however, now it has been moved to src/internal/runtime/maps/map.go.
I've been playing a bit with new swiss map internals and I could give a 👋 on pushing this issue if desired, but I was a bit blocked by this.