Azure-Samples / contoso-real-estate

Intelligent enterprise-grade reference architecture for JavaScript, featuring OpenAI integration, Azure Developer CLI template and Playwright tests.
MIT License
889 stars 528 forks source link

Monitoring Power Consumption of the ACA with Kepler #321

Closed Ma1kr0s0ft closed 1 year ago

Ma1kr0s0ft commented 1 year ago

Is your feature request related to a problem? Please describe.

Effective, efficient, and sustainable source code is more important than ever in current times. Because "bad" code not only causes security risks but also wastes energy/resources. This is not foreseen in the current solution, which measures the consumption of each container and monitors the impact of code changes on energy consumption and CO2e emissions. However, since this solution is intended to serve as a reference example, in my view such a feature should be implemented so that the operator & user can understand how "clean" the application is running.

Describe the solution you'd like

Use & implementation of Kepler (Kubernetes-based Efficient Power Level Exporter) to determine and monitor the resources & CO2e consumption of the application running in ACA services. Kepler collects metrics for CPU, GPU, or memory on the kernel level and can map them to processes so you can see exactly how efficiently they are running. Afterward, the data will be put into Prometheus and can then be visualized via Dashboards like Grafana.

Describe alternatives you've considered

As far as I know, there is actually no alternative on the market that covers the feature.

Additional context

_Since Microsoft as well as my employer NTT Data are active members of the Green Software Foundation. In this NGO, both companies are actively involved in making software, especially in the cloud, more efficient and "greener". Since this is an open source with international visibility, developers should be made aware of this topic and sensitized.

Link to the Kepler Homepage: https://sustainable-computing.io/_

kepler-arch

anfibiacreativa commented 1 year ago

Hi @Ma1kr0s0ft Looks like a very useful feature. I am not familiar with this tool and the only requirement we have to merge a capability like this to the upstream repo, is that the technologies are open-source and can be tested on free tiers, e2e.

Are you up to delivering a PoC?

Ma1kr0s0ft commented 1 year ago

Hi @anfibiacreativa, yes the tool is open source and is part of the CNCF & licensed with Apache 2.0.

I'm not sure if I'm able to do this by myself due for 2 reasons:

  1. I'm not a pro developer, I coming more from an Architecture perspective
  2. As far as i know & read so far is the installation guide for Kubernetes Cluster or Open Shift. Due to the fact that the ACA can also use KEDA, I expect that Kepler is also able to run because the underlying "Infrastructure" is also a Kubernetes Cluster. But that means that Kepler must be provisioned on the ACA Service Level itself and enabled via a Feature. So I think we need somebody from the ACA SME here to evaluate the possibility of implementing this feature first. After that we can setup & configure the Kepler based on that OPL: https://sustainable-computing.io/installation/kepler/
anfibiacreativa commented 1 year ago

Closed. Out of scope.