AKS Monitoring Deep Dive — Part 3

Overview about Prometheus scraping in Azure Monitor
kubectl apply -f https://aka.ms/container-azm-ms-agentconfig
kubectl get pods -n kube-system | grep oms<.. list of omsagent pods ..>kubectl exec -n kube-system -it omsagent-hr279 -- /bin/bash
TOKEN=`cat /var/run/secrets/kubernetes.io/serviceaccount/token`curl https://kubernetes.default.svc/metrics -k -H "Authorization: Bearer ${TOKEN}"
curl returning the metrics provided by the apiserver
kubectl edit cm/container-azm-ms-agentconfig -n kube-system
kubernetes_services = ["https://kubernetes.default.svc/metrics"]
InsightsMetrics| where TimeGenerated > ago(24h)| extend scrapeUrl = tostring(parse_json(Tags).scrapeUrl)| where scrapeUrl == "https://kubernetes.default.svc/metrics"| summarize count() by Name
List of metrics from the apiserver available in Log Analytics
kubectl get nodes -o wide
kubectl exec -n kube-system -it omsagent-hr279 -- /bin/bash
TOKEN=`cat /var/run/secrets/kubernetes.io/serviceaccount/token`
curl https://10.1.4.4:10250/metrics -k -H "Authorization: Bearer ${TOKEN}"
kubectl edit cm/container-azm-ms-agentconfig -n kube-system
urls = ["https://$NODE_IP:10250/metrics"]

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store