-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to support struct type value #253
Comments
Please use markdown when you quote code, it's hard to read code without any indentation. Prometheus metrics have basic types: counter, gauge, histograms (which is just a bunch of counters). All of these have just float64 as values, as described in prometheus data model: Given that, I'm not sure what you would do with a struct in a map value. |
Hello, could you consider allowing struct values and similarly having labels and decoders for each struct member? I think this is very useful. I am counting a large amount of values in a struct because they all belong to the same key. For ebpf_exporter I would have to split this struct into a dozen maps with value u64. This will probably have a lot of lookup overhead. Thank you. |
What is your concrete use-case? What kind of metrics and labels do you want to produce? |
Let's say I'm collecting a dozen counters, that is u64 monotonically increasing variables, all related to the same block device - it makes perfect sense to group these together. I have a per-cpu hash map with a For example:
Currently, I would have to split this struct by creating a new map for each field. I tried just that and profiling the two BPF programs with bpftool shows degraded performance on the ebpf_exporter-compatible program. Another thing is that when I first tried writing a configuration with a struct as the value type, ebpf_exporter gave no warning or error at all. At least the silent failure should be avoided with a warning. |
Conceptually it makes sense. Can you quantify you performance degradation? How expensive is it with a single map vs multiple maps? Is it visible in overall CPU usage? |
It's unclear to me how to make complex values atomic. It's trivial to increment a single u64. How would you increment an array of them joined together? |
I opened #257 to validate value sizes for maps so that there are no silent failures. |
This is a good point. So far, I've used per-CPU maps to solve this, so that could be a requirement. |
Could you share the benchmark you're using? I'm still very interesting in these questions: #253 (comment). |
I made #260, but I can't say I'm a big fan of this. |
hi,
I also want to discuss a issue, whether it is possible to use struct type for value,
although I see in tcp-window-clamps.bpf.c
but it don't use by metrics .
Currently, it seems that a struct type cannot be supported, and it can parse multiple member values.
Can you explain this problem, thanks!
The text was updated successfully, but these errors were encountered: