Netflow Prometheus Implementation#543
Conversation
|
|
||
| Visit the [docs](https://docs.cast.ai/docs/getting-started) to connect your cluster. | ||
|
|
||
| ## Build Instructions |
There was a problem hiding this comment.
Let's add this to DEVELOPMENT.md file.
| var err error | ||
|
|
||
| ciliumCt4, err = bpf.OpenMap(proc.HostPath(filepath.Join(defaults.BPFFSRoot, defaults.TCGlobalsPath, ctmap.MapNameTCP4Global)), &ctmap.CtKey4Global{}, &ctmap.CtEntry{}) | ||
| ciliumCt4, err = bpf.OpenMap(filepath.Join(defaults.BPFFSRoot, defaults.TCGlobalsPath, ctmap.MapNameTCP4Global), &ctmap.CtKey4Global{}, &ctmap.CtEntry{}) |
There was a problem hiding this comment.
Are there some issues accessing cilium ebpf maps via /proc/1/root ?
There was a problem hiding this comment.
It didn't work for me in a kubeadm cluster baked by flatcar in AWS.
Did it for you?
There was a problem hiding this comment.
I haven't tested such setup. But on GKE, EKS with cilium haven't saw any issues.
Do you have some more context regarding the issue, what exactly didn't work just to understand it better?
There was a problem hiding this comment.
In cilium 1.16 the conntrackaccounting was disabled by default, thats why it wasnt reporting the bytes...
In 1.17 is solved (but you need to explicit enable this feature)
| var ( | ||
| // egressd-compatible metrics | ||
| egressdTransmitBytesTotal = promauto.NewCounterVec(prometheus.CounterOpts{ | ||
| Name: "egressd_transmit_bytes_total", |
There was a problem hiding this comment.
Sadly this approach will not work efficiently. In egressd we have explicit metrics push via remote write api.
https://github.com/castai/egressd/blob/main/exporter/sinks/prom.go#L116
By using remote write api it will support not only original prometheus but mimir/cortex too. Also it allows to have different prometheus instance just for netflows metrics.
There was a problem hiding this comment.
On egressd was the controller gathering metrics from the agent and then pushing remotely.
Probably kvisor has to implement the same approach... Do you have it on the roadmap?
There was a problem hiding this comment.
Yes, kvisor agent could push metrics directly from each agent to prometheus similar to clickhouse exporter.
For now we are no plans for it, but if you could update current prometheus_netflow_exporter that would great :)
|
Thanks for the change. Added few comments. |
Trying to address: #540
I am exposing the same metrics as it was in egressd.
This is just a starting point, it would be amazing to understand how far I can go to integrate these changes in kvisor.