Skip to content
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

Expose config for collecting cgroup and kubelet metrics in kepler exporter API #202

Open
vimalk78 opened this issue Sep 4, 2023 · 6 comments

Comments

@vimalk78
Copy link
Collaborator

vimalk78 commented Sep 4, 2023

enable/dsiable collecting cgroup and kubelet metrics by exposing bool config params in Exporter API.

Ref: https://github.com/sustainable-computing-io/kepler/pull/876/files
sustainable-computing-io/kepler#901

@vimalk78
Copy link
Collaborator Author

vimalk78 commented Sep 4, 2023

@rootfs @sunya-ch need your input here

@sunya-ch
Copy link
Collaborator

sunya-ch commented Sep 4, 2023

Could you clarify more about this issue? Do you mean to expose it via the Kepler command arguments not via the config map?

@vimalk78
Copy link
Collaborator Author

vimalk78 commented Sep 4, 2023

i mean expose it in ExporterSpec

apiVersion: kepler.system.sustainable.computing.io/v1alpha1
kind: Kepler
metadata:
  labels:
    app.kubernetes.io/name: kepler
    app.kubernetes.io/instance: kepler
    app.kubernetes.io/part-of: kepler-operator
  name: kepler
spec:
  exporter:
    port: 9103
    enableCGroupMetrics: true
    enableKubeletMetrics: true

these values will be used to populate the kepler configmap

@sunya-ch
Copy link
Collaborator

sunya-ch commented Sep 5, 2023

Thank you. The key of the configmap variables are all listed here: https://github.com/sustainable-computing-io/kepler/blob/02c16c1e223e32b1d1f20f3c7ad8e8959eb2fd87/pkg/config/config.go#L77.

@sthaha
Copy link
Collaborator

sthaha commented Sep 5, 2023

@vimalk78 How about something like this. This allows us to add additional fields to each of the metric later on. E.g. say in future, cgroup can not only be enabled but also a filter can be applied on the metrics, this would allow for change to be
added without breaking the api. Also grouping under metrics may allow us to add config that applies to all metrics (if any) in
future without breaking api

exporter:
  metrics:  # keep all metrics under MetricSpec
    cgroups:  # feature specific config
        enabled: true
    kubelet:
        enabled: true
    foobar:
       enabled: true
       additional: config

In general, I am wary of boolean flags.

@sunya-ch
Copy link
Collaborator

sunya-ch commented Sep 20, 2023

In addition to enabled, we also need a flag for exposed. Sometimes, we enable it for power model estimation but does not want to expose it to prometheus.

Currently, it uses the same config key though...
https://github.com/sustainable-computing-io/kepler/blob/main/pkg/config/config.go#L420

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants