bottlerocket
bottlerocket copied to clipboard
Allow enabling and configuring containerd metrics
What I'd like: I would like to enable container built-in prometheus metrics. An example containerd configuration snippet
[metrics]
address = "127.0.0.1:1338"
Any alternatives you've considered:
- doing some very ugly things in a privileged pod.
relevant containerd documentation - https://github.com/containerd/containerd/blob/main/docs/ops.md#base-configuration
Allowing arbitrary additions to the containerd would cover this enchancment https://github.com/bottlerocket-os/bottlerocket/issues/2408
Hello, thanks for the suggestion. I think it makes a lot of sense to expose these options via the Bottlerocket API.
This should be as simple as supporting a TCP address to be set under something like settings.container-runtime.metrics.address.
Seems like there's one more setting, grpc_histogram: https://github.com/containerd/containerd/blob/main/services/server/config/config.go#L158
As for the TCP address, the shape should follow TCP addresses as specified by golang's net.listen
(More notes for myself as I look at implementing this)
net.Listen in golang is pretty close to the ToSocketAddrs implementation for str in Rust. I don't think we want to store this information as a string type in the model, but we can use this trait to model how to appropriately store this data.
Hey @cbgbt, has there been any progress on this? Are there any specific blockers for implementing it?