# Prometheus metrics from AKS with Azure Monitor managed service for Prometheus

**URL:** <https://forums.k8slens.dev/t/prometheus-metrics-from-aks-with-azure-monitor-managed-service-for-prometheus/1664>\
**Category:** Lens Support & Troubleshooting\
**Tags:** lens-desktop, kubernetes\
**Created:** [October 4, 2023, 6:01pm UTC](https://forums.k8slens.dev/t/prometheus-metrics-from-aks-with-azure-monitor-managed-service-for-prometheus/1664 "2023-10-04T18:01:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gilias](https://forums.k8slens.dev/letter_avatar_proxy/v4/letter/g/bbe5ce/32.png) [@gilias](https://forums.k8slens.dev/u/gilias)\
**Post date:** [October 4, 2023, 6:01pm UTC](https://forums.k8slens.dev/t/prometheus-metrics-from-aks-with-azure-monitor-managed-service-for-prometheus/1664/1 "2023-10-04T18:01:12Z")

</div>

I have installed _Microsoft Azure Kubernetes Service - AKS_ (version 1.26.6) and have connected from Lens successfully to this cluster.

I have also installed _Azure Monitor managed service for Prometheus_ from Azure Portal (there is a checkbox option, see [Enable monitoring for AKS clusters - Azure Monitor | Microsoft Learn](https://learn.microsoft.com/en-us/azure/azure-monitor/containers/prometheus-metrics-enable?tabs=azure-portal)), and I noticed that the following pods have been deployed in AKS (in kube-system namespace) after Azure prometheus installation:  
_ama-metrics (one pod)_  
_ama-metrics-ksm (one pod)_  
_ama-metrics-node (one pod in each node)_

as well as service:  
_ama-metrics-ksm in port 8080_  
so I suppose (but I am not sure) that this is the prometheus service.

However in Lens I get:  
_“Metrics not available at the moment”_  
I have tried many different combinations in Cluster settings → Metrics (Auto Detect Prometheus, helm, helm14 etc., with kube-system/ama-metrics-ksm:8080, as well as various other services in format namespace/service:port), but I haven’t achieved to retrieve metrics.

How can I retrieve metrics from Azure Monitor managed service for Prometheus into Lens?  
Has anyone achieved that?

---

<div class="post-metadata">

**Author:** ![jehrismann](https://forums.k8slens.dev/user_avatar/forums.k8slens.dev/jehrismann/32/398_2.png) [@jehrismann](https://forums.k8slens.dev/u/jehrismann)\
**Post date:** [October 11, 2023, 3:56pm UTC](https://forums.k8slens.dev/t/prometheus-metrics-from-aks-with-azure-monitor-managed-service-for-prometheus/1664/2 "2023-10-11T15:56:12Z")

</div>

There is nothing in Lens that specifically supports metrics from prometheus via Azure Monitor, not sure anyone on the Lens team has experience with it. Maybe someone in the Lens community here can help. You may need to tweak security group type settings, RBAC rules, network access, etc.

Regarding the prometheus service you can always try port-forwarding for _ama-metrics-ksm_ to confirm that it is (go to this service’s details page, click on the 8080 port link, or click the **Forward…** button next to it). It should open the prometheus home page in your browser.

---

<div class="post-metadata">

**Author:** ![gilias](https://forums.k8slens.dev/letter_avatar_proxy/v4/letter/g/bbe5ce/32.png) [@gilias](https://forums.k8slens.dev/u/gilias)\
**Post date:** [October 17, 2023, 6:57am UTC](https://forums.k8slens.dev/t/prometheus-metrics-from-aks-with-azure-monitor-managed-service-for-prometheus/1664/3 "2023-10-17T06:57:12Z")

</div>

Thank you @jehrismann for your reply.  
I tried the port forwarding you suggested, and realized that this service is kube-state-metrics (that explains the _-ksm_ in service name).  
I suppose that prometheus server is installed somewhere that we cannot see/manage it…

So, I suppose that it is not feasible to collect metrics in Lens when having _Azure Monitor managed service for Prometheus_ installed in AKS.

If someone has any other findings I would be happy to hear about.
