<p>I am planning to deploy 15 different applications initially and would endup with 300+ applications on azure kubernetes and would be using Prometheus and Grafana for monitoring.</p>
<p>I have deployed both the Prometheus and Grafana on a separate namespace on the dedicated node.</p>
<p>How do I enable horizontal pod scaling for Prometheus and Grafana?</p>

<p>You can scale your applications based on <a href="https://github.com/kubernetes/community/blob/master/contributors/design-proposals/instrumentation/custom-metrics-api.md" rel="nofollow noreferrer">custom metrics</a> gathered by Prometheus and presented in the Grafana dashboard.</p>
<p>In order to do that you'll need the <a href="https://github.com/DirectXMan12/k8s-prometheus-adapter#prometheus-adapter-for-kubernetes-metrics-apis" rel="nofollow noreferrer">Prometheus Adapter</a> to implement the custom metrics API, which enables the <code>HorizontalPodAutoscaler</code> controller to retrieve metrics using the <code>custom.metrics.k8s.io</code> API. You can define your own metrics through the adapter’s configuration so the HPA would scale based on those stats.</p>
<p><a href="https://www.section.io/blog/horizontal-pod-autoscaling-custom-metrics/" rel="nofollow noreferrer">Here</a> you can find a short guide that would get you started.</p>
