bottlerocket icon indicating copy to clipboard operation
bottlerocket copied to clipboard

Allow enabling and configuring containerd metrics

Open mindw opened this issue 2 years ago • 5 comments

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

mindw avatar Jun 07 '23 06:06 mindw

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.

cbgbt avatar Jun 09 '23 21:06 cbgbt

Seems like there's one more setting, grpc_histogram: https://github.com/containerd/containerd/blob/main/services/server/config/config.go#L158

cbgbt avatar Jun 09 '23 22:06 cbgbt

As for the TCP address, the shape should follow TCP addresses as specified by golang's net.listen

cbgbt avatar Jun 09 '23 22:06 cbgbt

(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.

cbgbt avatar Jun 12 '23 19:06 cbgbt

Hey @cbgbt, has there been any progress on this? Are there any specific blockers for implementing it?

ditachev avatar Feb 24 '25 08:02 ditachev