---
title: "Monitoring Calico with Prometheus and Grafana"
source: "https://wordpress-1075849-4005834.cloudwaysapps.com/blog/monitoring-calico-with-prometheus-and-grafana/"
---

[Technical Blog](https://wordpress-1075849-4005834.cloudwaysapps.com/category/technical-blog/)

# Monitoring Calico with Prometheus and Grafana

By [Chris Hoge](https://wordpress-1075849-4005834.cloudwaysapps.com/blog/author/chrishoge/) on Jun 23, 2020 • 6 min read



*This guest blog post is by Reza Ramezanpour. Reza is a user group researcher and advocate for Project Calico. His previous experience includes being a co-founder of a startup company, ARPI, where he developed embedded IT based technologies to create smart city solutions. He is also certified by Australian computer society as a Computer network and system engineer.*






## Introduction






In this blog post I’d like to walk you through why monitoring can be beneficial for your cluster, how you can enable Calico monitoring information, and how to create a user friendly visual representation for it. Along the way I’ll try to explain why we should use monitoring in our infrastructure and how monitoring does its magic.






## What is monitoring?






Within the context of IT, monitoring can be viewed as an interpreter between the underlying technology and user experience side of your business. This translation enables you to gain a better perspective about your IT infrastructure, whether it is working as expected, and measure its value in your business.






## How monitoring does it?






Most applications or services have the ability to share some amount of information in real time to broadcast their status. Numerical status fields are often referred to as “Metrics” and are the essential part of any monitoring framework. Applications such as Prometheus or Grafana can use these metrics to conjure user friendly representations. 






Let’s start our Journey by examining how Calico components work. Each Calico node runs an instance of Felix which acts as the brain of Calico.






First create a namespace to group all the monitoring components we will install.






```
`~$ kubectl apply -f -<<EOF apiVersion: v1 kind: Namespace metadata: name: calico-monitoring labels: app: ns-calico-monitoring role: monitoring EOF`
```






Calico as a cloud native security solution implements [Prometheus metric standards](http://prometheus.io/docs/practices/naming/). This protocol publishes data in key/value pairs via HTTP Protocol. In order to enable Felix metrics you can use `calicoctl` to modify the related Calico setting.






```
`~$ calicoctl patch felixConfiguration default --patch '{"spec": {"prometheusMetricsEnabled": true}}'`
```






This modification enables a http service for all the nodes in your cluster to listen on port 9091 for incoming connections, and publish the required metrics that can be consumed by your monitoring framework. Prometheus can store these metrics as a time series database and gives you tools to query the metrics in various ways. However, there are some steps that should be taken in order to access the metrics via Prometheus.






Here you create permission to allow `calico-prometheus-user` to read metrics published by Felix and generate a base kubernetes configmap for your Prometheus instance.






```
`kubectl apply -f - <<EOF apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRole metadata: name: calico-prometheus-user rules: - apiGroups: [""] resources: - endpoints - services - pods verbs: ["get", "list", "watch"] - nonResourceURLs: ["/metrics"] verbs: ["get"] --- apiVersion: v1 kind: ServiceAccount metadata: name: calico-prometheus-user namespace: calico-monitoring --- apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRoleBinding metadata: name: calico-prometheus-user roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: calico-prometheus-user subjects: - kind: ServiceAccount name: calico-prometheus-user namespace: calico-monitoring --- apiVersion: v1 kind: ConfigMap metadata: name: prometheus-config namespace: calico-monitoring data: prometheus.yml: |- global: scrape_interval: 15s external_labels: monitor: 'tutorial-monitor' scrape_configs: - job_name: 'prometheus' scrape_interval: 5s static_configs: - targets: ['localhost:9090'] - job_name: 'felix_metrics' scrape_interval: 5s scheme: http kubernetes_sd_configs: - role: endpoints relabel_configs: - source_labels: [__meta_kubernetes_service_name] regex: felix-metrics-svc replacement: $1 action: keep - job_name: 'typha_metrics' scrape_interval: 5s scheme: http kubernetes_sd_configs: - role: endpoints relabel_configs: - source_labels: [__meta_kubernetes_service_name] regex: typha-metrics-svc replacement: $1 action: keep EOF`
```






Now that you have all the necessary components to run your monitoring framework it is time to create the Prometheus pod and link it to the configuration and permission.






```
`kubectl apply -f - <<EOF apiVersion: v1 kind: Pod metadata: name: prometheus-pod namespace: calico-monitoring labels: app: prometheus-pod role: monitoring spec: serviceAccountName: calico-prometheus-user containers: - name: prometheus-pod image: prom/prometheus resources: limits: memory: "128Mi" cpu: "500m" volumeMounts: - name: config-volume mountPath: /etc/prometheus/prometheus.yml subPath: prometheus.yml ports: - containerPort: 9090 volumes: - name: config-volume configMap: name: prometheus-config EOF`
```






At this point you have got a working instance of Prometheus connected to Felix collecting all available Calico metrics in your cluster. 






Understanding raw data can be a daunting task, Prometheus supports showing collected data in different forms via its expression browser. This feature has the ability to manipulate the data and create tables or charts but it’s not the best solution since it was mainly developed to address debugging needs.






Grafana, another great cloud native open source project could be a better option to visualize this information. In order to create a visualization you will have to configure Grafana to tell it where the data is stored and how it can be accessed.






Let’s create service for Prometheus and configure the Grafana datastore via a kubernetes configmap to point to it.






```
`kubectl apply -f - <<EOF apiVersion: v1 kind: Service metadata: name: prometheus-dashboard-svc namespace: calico-monitoring spec: selector: app: prometheus-pod role: monitoring ports: - port: 9090 targetPort: 9090 EOF --- apiVersion: v1 kind: ConfigMap metadata: name: grafana-config namespace: calico-monitoring data: prometheus.yaml: |- { "apiVersion": 1, "datasources": [ { "access":"proxy", "editable": true, "name": "calico-demo-prometheus", "orgId": 1, "type": "prometheus", "url": "http://prometheus-dashboard-svc.calico-monitoring.svc:9090", "version": 1 } ] } EOF`
```






Since Grafana can contain sensitive information it would be better to provide limited access for it. One of the ways that you can manage this in Kubernetes is by port-forwarding, using `kubectl` to map a local port from your computer and redirect it to a specific port in your cluster.






```
`kubectl port-forward pod/grafana-pod 3000:3000 -n calico-monitoring`
```






*Note: the default username password for Grafana is `admin`.*






Fire Up your favorite browser and navigate to [https://wordpress-1075849-4005834.cloudwaysapps.com](https://wordpress-1075849-4005834.cloudwaysapps.com/) your dashboard awaits you!





![Grafana dashboard displaying Felix metrics.](https://wordpress-1075849-4005834.cloudwaysapps.com/app/uploads/2020/06/grafana-dashboard-1024x640.png)




## Conclusion






In this blog post I wanted to show you how you can use monitoring frameworks to gain a better perspective about your Calico implementation. I would also like to mention that there are lots more metrics that Calico provides, and Kubernetes itself can be configured to provide metrics you might incorporate too. You can customize or create your own dashboards depending on your needs relatively easily.






If you like to know more about monitoring I would suggest following these links: 








- [Monitor Calico components metrics via Prometheus](http://docs.projectcalico.org/maintenance/monitor/monitor-component-metrics)

- [Visualizing metrics via Grafana](http://docs.projectcalico.org/master/maintenance/monitor/monitor-component-visual)

- [Prometheus](http://prometheus.io/docs/)

- [Grafana](http://grafana.com/docs/grafana/latest/)








If you enjoyed this blog then you may also like:








- [Introducing the Calico eBPF dataplane](https://wordpress-1075849-4005834.cloudwaysapps.com/blog/introducing-the-calico-ebpf-dataplane/)

- Free online training at [projectcalico.org/events](http://projectcalico.org/events) or subscribe to [Calico Essentials](https://info.tigera.io/rs/805-GFH-732/images/Calico-Essentials-Datasheet.pdf) for personalized training & workshops

- Learn about [Calico Enterprise](http://docs.projectcalico.org/calico-enterprise/)



[How-To](https://wordpress-1075849-4005834.cloudwaysapps.com/tags/how-to/)[Open Source](https://wordpress-1075849-4005834.cloudwaysapps.com/tags/open-source/)[Project Calico](https://wordpress-1075849-4005834.cloudwaysapps.com/tags/project-calico/)

Add Tigera as a preferred source on Google to see more of our content in your search results.

[![Add as a preferred source on Google](https://wordpress-1075849-4005834.cloudwaysapps.com/app/themes/tigera2021/dist/img/google-preferred-source-light.png)](https://www.google.com/preferences/source?q=tigera.io)

## Related posts

[![AI Assistant for Calico: Troubleshooting at the Speed of Thought](https://wordpress-1075849-4005834.cloudwaysapps.com/app/uploads/2026/03/Blog-Mar-20-AI-Assistant-for-Calico.png)](https://wordpress-1075849-4005834.cloudwaysapps.com/blog/ai-assistant-for-calico-troubleshooting-at-the-speed-of-thought/)

#### [AI Assistant for Calico: Troubleshooting at the Speed of Thought](https://wordpress-1075849-4005834.cloudwaysapps.com/blog/ai-assistant-for-calico-troubleshooting-at-the-speed-of-thought/)

By [Veronika Smolik](https://wordpress-1075849-4005834.cloudwaysapps.com/blog/author/veronika-smolik/)
on Mar 19, 2026

Despite the wealth of data available, distilling a coherent narrative from a Kubernetes cluster remains a challenge for modern infrastructure teams. Even with powerful visualization tools like the Policy Board, Service Graph, and specialized dashboards,...

[Read more](https://wordpress-1075849-4005834.cloudwaysapps.com/blog/ai-assistant-for-calico-troubleshooting-at-the-speed-of-thought/)

[![What Your EKS Flow Logs Aren’t Telling You](https://wordpress-1075849-4005834.cloudwaysapps.com/app/uploads/2026/03/Blog-Mar-18-What-Your-EKS-Flow-Logs-Arent-Telling-You.png)](https://wordpress-1075849-4005834.cloudwaysapps.com/blog/what-your-eks-flow-logs-arent-telling-you/)

#### [What Your EKS Flow Logs Aren’t Telling You](https://wordpress-1075849-4005834.cloudwaysapps.com/blog/what-your-eks-flow-logs-arent-telling-you/)

By [Phil DiCorpo](https://wordpress-1075849-4005834.cloudwaysapps.com/blog/author/phil-dicorpo/)
on Mar 18, 2026

If you’re running workloads on Amazon EKS, there’s a good chance you already have some form of network observability in place. VPC Flow Logs have been a staple of AWS networking for years, and AWS...

[Read more](https://wordpress-1075849-4005834.cloudwaysapps.com/blog/what-your-eks-flow-logs-arent-telling-you/)

[![What’s New in Calico: Winter 2026 Release](https://wordpress-1075849-4005834.cloudwaysapps.com/app/uploads/2026/03/What-is-new-in-Calico-winter-2026.png)](https://wordpress-1075849-4005834.cloudwaysapps.com/blog/whats-new-in-calico-winter-2026-release/)

[Company Blog](https://wordpress-1075849-4005834.cloudwaysapps.com/category/company-blog/)

#### [What’s New in Calico: Winter 2026 Release](https://wordpress-1075849-4005834.cloudwaysapps.com/blog/whats-new-in-calico-winter-2026-release/)

By [Veronika Smolik](https://wordpress-1075849-4005834.cloudwaysapps.com/blog/author/veronika-smolik/)
on Mar 4, 2026

AI Powered Intelligence, Unified Traffic Observability and Scalable Infrastructure Management As anyone managing one or more Kubernetes clusters knows by now, scaling can introduce an exponentially growing number of problems. The sheer volume of metrics,...

[Read more](https://wordpress-1075849-4005834.cloudwaysapps.com/blog/whats-new-in-calico-winter-2026-release/)

<!-- plugin=object-cache-pro client=phpredis metric#hits=6191 metric#misses=17 metric#hit-ratio=99.7 metric#bytes=2179285 metric#prefetches=0 metric#store-reads=419 metric#store-writes=14 metric#store-hits=431 metric#store-misses=6 metric#sql-queries=32 metric#ms-total=1219.63 metric#ms-cache=87.45 metric#ms-cache-avg=0.2024 metric#ms-cache-ratio=7.2 -->
