Monitoring your IRIS deployment is crucial. With the deprecation of System Alert and Monitoring (SAM), a modern, scalable solution is necessary for real-time insights, early issue detection, and operational efficiency. This guide covers setting up Prometheus and Grafana in Kubernetes to monitor InterSystems IRIS effectively.
This guide assumes you already have an IRIS cluster deployed using the InterSystems Kubernetes Operator (IKO), which simplifies deployment, integration and mangement.
Why Prometheus and Grafana?
Prometheus and Grafana are widely adopted tools for cloud-native monitoring and visualization. Here’s why they are a fit:
- Scalability: Prometheus handles large-scale data ingestion efficiently.
- Alerting: Customizable alerts via Prometheus Alertmanager.
- Visualization: Grafana offers rich, customizable dashboards for Kubernetes metrics.
- Ease of Integration: Seamlessly integrates with Kubernetes workloads.
Prerequisites
Before starting, ensure you have the following:
- Basic knowledge of Kubernetes and Linux
kubectl
andhelm
installed.- Familiarity with Prometheus concepts (refer to the Prometheus documantion for more information).
- A deployed IRIS instance using the InterSystems Kubernetes Operator (IKO), refer to another article here.
Step 1: Enable Metrics in InterSystems IRIS
InterSystems IRIS exposes metrics via /api/monitor/
in the Prometheus format. Ensure this endpoint is enabled:
- Open the Management Portal.
- Go to System Administration > Security > Applications > Web Applications.
- Ensure
/api/monitor/
is enabled and accessible by Prometheus. You can check its status by navigating to the Management Portal, going to System Administration > Security > Applications > Web Applications, and verifying that the endpoint is listed and enabled.
Verify its availability by accessing:
http://<IRIS_HOST>:<PORT>/api/monitor/metrics
Step 2: Deploy Prometheus Using Helm
Deploying Prometheus using Helm provides an easy-to-manage monitoring setup. We will use the kube-prometheus-stack
chart that includes Prometheus, Alertmanager, and Grafana.
- Prepare the configuration: Create a
values.yaml
file with the following settings:prometheus: prometheusSpec: additionalScrapeConfigs: - job_name: 'intersystems_iris_metrics' metrics_path: '/api/monitor/metrics' static_configs: - targets: - 'iris-app-compute-0.iris-svc.commerce.svc.cluster.local:80' # Replace with your IRIS service # To scrape custom metrics from the REST API created in IRIS - job_name: 'custom_iris_metrics' metrics_path: '/web/metrics' static_configs: - targets: - 'commerce-app-webgateway-0.iris-svc.commerce.svc.cluster.local:80' basic_auth: username: '_SYSTEM' password: 'SYS'
- Explanation:
iris-app-compute-0.iris-svc.commerce.svc.cluster.local:80
: The format of the target should follow this convention:<pod-name>-iris-svc.<namespace>.svc.cluster.local:80
. Replace<pod-name>
with your IRIS pod, specify whether you want to scrapecompute
ordata
pods, and adjust the namespace as needed.basic_auth
** section**: If authentication is required to access the IRIS metrics endpoint, provide the necessary credentials.
- Explanation:
- Add the Helm repository:
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts helm repo update
- Install Prometheus using Helm:
helm install monitoring prometheus-community/kube-prometheus-stack -n monitoring --create-namespace -f values.yaml
- Verify the deployment:
kubectl get pods -n monitoring
Step 3: Custom Metrics with REST API
You can create a custom metrics CSP page that serves your application metrics. In this guide, I provide an example of a simple CSP page that extracts system metrics from IRIS itself, but you can totally build your own CSP page with your own custom metrics—just make sure they are in the Prometheus format.
Deploy this as a REST service under a new web application called metrics
in IRIS, and add its path to Prometheus for scraping.
Step 4: Verify Prometheus Setup
- Open the Prometheus UI (
http://<PROMETHEUS_HOST>:9090
). - Go to Status > Targets and confirm IRIS metrics are being scraped.
Step 5: Access Grafana
With Prometheus scraping IRIS metrics, the next step is to visualize the data using Grafana.
1. Retrieve the Grafana service details:
kubectl get svc -n monitoring
If you’re using an ingress controller, you can access Grafana using the configured hostname (e.g., http://grafana.example.com
). Otherwise, you can use the following options:
- Port Forwarding: Use
kubectl port-forward
to access Grafana locally:
Then, access Grafana atkubectl port-forward svc/monitoring-grafana -n monitoring 3000:80
http://localhost:3000
. - NodePort or ClusterIP: Refer to the
NodePort
orClusterIP
service details from the command output to connect directly.
Step 6: Log In to Grafana
Use the default credentials to log in:
- Username:
admin
- Password:
prom-operator
(or the password set during installation).
Step 7: Import a Custom Dashboard
I’ve created a custom dashboard specifically tailored for InterSystems IRIS metrics, which you can use as a starting point for your monitoring needs. The JSON file for this dashboard is hosted on GitHub for easy access and import: Download the Custom Dashboard JSON
To import the dashboard:
- Navigate to Dashboards > Import in Grafana.
- Paste the URL of the JSON file into the Import via panel JSON field or upload the file directly.
- Assign the dashboard to a folder and Prometheus data source when prompted.
Once imported, you can edit the panels to include additional metrics, customize the visualizations, or refine the layout for better insights into your IRIS environment.
Conclusion
By following this guide, we've successfully set up Prometheus to scrape InterSystems IRIS metrics and visualize them using Grafana. Additionally, you can explore other monitoring tools such as Loki to also monitor logs efficiently and configure alerts using Alertmanager or external services like PagerDuty and Slack. If you have any questions or feedback, feel free to reach out!
That's really helpful, I appreciate it!
Glad it was useful for you
thanx
better than a lot of the other alternatives
Great guide! Clear, concise, and super helpful for setting up Prometheus and Grafana with IRIS. Well done!
Excellent step by step that so many of our customers have been asking about since the deprecation of SAM - thank you Stav!
Thank you, Ari! Glad that it will address the needs from SAM's deprecation.
@Daniel Kutac - you asked for that
Excellent!, thank you @Evgeny Shvarov for pointing me at this article. And thank you Stav for great article!
Really helpful, Thank you Stav!
I appreciate the attention to not-so-obvious details, great work.