 Welcome to Prometheus Day, I'm Ravi Hari working as a Principal Software Engineer at NQIA. The topic is real-time prediction for autoscaling using Prometheus metrics. Briefly, we are in NQIA, started in 1983, and we have about 100 million customers, and you have seen many in so far. Prometheus is a defective monitoring tool in Kubernetes, and Prometheus metrics are consumed for various use cases. For example, monitoring, alerting anomaly detection and autoscaling, etc. Time series forecasting can be leveraged to make predictions, and in order to make a good prediction, we can follow some rules that we can collect aggregated data to avoid noise in the data, and the data used for forecasting should be updated frequently, and the horizon in which we predict this data, it should be over a short duration to make these predictions more accurate. Some of the time series prediction algorithms or models that are already existing today are some autoregressive models like ARIMA, and if you had seasonality interference, it's called ARIMA, and some of the other two models like LSTM exponential smoothing and other things are also available. A couple of them are also contributed by some popular companies like Facebook and Google into tools like Prophet and Temporal. So we can see how we can use this time series data. So this is the data. These have continuous utilization that we want to create predictions for and then see how we can use that in a custom autoscaling. So the data that we have is given here, and let's try to use that with ARIMA. Let's make a quick run of ARIMA model here and plot the graph. You can see that graph is given here. The red line is ARIMA model. The blue line is actual data. The trend actually is replicated with ARIMA model. However, there is slight delay in here. Now let's try with the Facebook Profit. Let's execute all these things. So here we are using the same data and we are creating the chart and then we are creating a model by considering some seasonality of this and then here is the data with the Profit tool. Here the blue line is actually the predicted data that you can see and dotted lines as you can see up to here, these are the ones that's actual data. And you see there is a shade of blue here up and above this blue line that indicates there is uncertainty in this data and it gives lower bound and upper bound for these values. Now let's use this information and see if we can predict the auto scaling on CPU utilization. So we are getting this data points. Let's now try to see. So this is a deployment in which there are five replicas and based on the prediction of the CPU usage, we want to reduce that in this replica. So that is a controller already running here. Let me go ahead and submit a CR to briefly go over the CR. This has namespace and deployment on which we want to act upon and lower bound and upper bound CPU. If the value is in between these values, it doesn't do anything. What if the value is above or lesser than the values that we are giving it? It will either add or reduce the number of replicas. So let me apply this. So I created this one and it has acted upon this and we are watching the deployment here. So earlier it was like five replicas. Now that there's reduced by one because the prediction for this is 18% and the pressure we have is 20. If it is less than 20, it would go ahead and reduce it. Here is a simple code for that. And here we are calling the prediction and prediction is nothing but a service of the perfect thing that you have deployed in the cluster. And we're calling that service and getting the value recommendation. And if it is in between the boundaries, it doesn't do anything. If it is lesser than lower bound, it will reduce by one, correspondingly for higher values. So we can leverage these things and then optimize our resources and reduce costs for the Kubernetes resources if you're running a cloud provider. That is the demo that I wanted to show. Thank you.