Open yfractal opened 2 years ago
Hi @yfractal You are right, appending to map is more complex than appending to slice and is not a logic we implemented yet. Until we implement the map operations the way we do it today is by appending to the slice created in the function that iterates over the map. In an HTTP client example a good candidate would be: https://cs.opensource.google/go/go/+/master:src/net/http/header.go;l=173
Both of these tasks (HTTP client support + appending to maps) are on our roadmap and will be implemented in future versions. If you would like to help, we will be happy to accept a PR 😄
Thanks edeNFed, I will try to figure how to do this, but I'm not sure when I can achieve this, I'm short of knowledge both C, eBPF and golang 😂
No worries, this will be added very soon
Really great, thanks edeNFed!
looking forward!
Feature request
Allow opentelemetry-go-instrumentation trace http requests.
How to implement?
A Golang project may send http request to other servers through Golang net/request, for doing distributed tracing need to add the trace id in http headers.
The header is a map https://cs.opensource.google/go/go/+/refs/tags/go1.19.2:src/net/http/request.go;l=148.
If we do this through
uprobe
, we need edit a Golang map.So how could we do this? Or do we have other options?
I guess eBPF program can't call a user's function easily, so we have to mange the memory, but map is complex, not sure how to do this.
Maybe we can calculate where we can put the key/value pair(we know the key and can know the length of value), and use the result to do memory management?