Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • Guided learning
      Receive custom learning paths powered by our AI assistant.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

Understanding Red Hat OpenShift's Application Monitoring Operator

<p>&nbsp;</p> <quillbot-extension-portal></quillbot-extension-portal>

September 10, 2019
Jose Silva
Related topics:
ContainersKubernetesMicroservicesOperators
Related products:
Red Hat OpenShiftRed Hat OpenShift Container Platform

    Monitoring systems are usually composed of three layers: a database layer that hosts metrics data, a layer to display the stored metric data graphically in dashboards, and an alerting layer to send out notifications via methods such as email, on-call notification systems, and chat platforms. This article presents an overview of the components used in Red Hat OpenShift's Application Monitoring Operator, how to install them using the Operator, and an example of the Operator in action.

    Application monitoring stack components

    The OpenShift Application Monitoring Operator used in Red Hat Integration products aims to cover all of those layers by installing a set of tools to build a monitoring system on the cluster. This monitoring stack consists of three famous open source community components that are installed by deploying the Grafana and Prometheus Operators: Grafana, Prometheus, and Alertmanager.

    Prometheus

    Prometheus is an open source project designed to monitor and provide alerts in a microservices infrastructure. Prometheus supports scraping application instances to collect metrics and generate graphs. These metrics are exposed by services through HTTP(S), and Prometheus periodically scraps target-defined endpoints and writes the collected samples into its database.

    This tool comes with a functional query language called PromQL that lets users select and aggregate time series data in real time. The outcome of a query can be exposed as a graph or tabula data, or consumed via the HTTP API.

    The Application Monitoring Operator uses the Prometheus Operator to install instances of Prometheus in a simple, declarative way to create, configure, and manage Prometheus instances on the cluster.

    Alertmanager

    Here is where the alerts sent from Prometheus servers are handled. Alertmanager is responsible for receiving alerts and sending them out to notify the end user. An alerting system is useful to warn about a new problem, allowing teams to take action to prevent major issues or system downtime.

    When alerts are sent to Alertmanager, they can be filtered and grouped according to their severity, and then the system decides which action to take—that can either be to go silent or to notify a receiver (email, chat app, calls, etc.).

    Grafana

    When it comes to monitoring systems, the visualization layer helps teams detect and take action when anomalous behavior occurs. In the Application Monitoring Operator, we use Grafana as the visualization tool to display time series data collected from Prometheus in the dashboard format.

    Grafana is installed using the Grafana Operator Custom Resource (CR), which can deploy and manage Grafana instances in the cluster.

    Application Monitoring Operator installation

    After a brief introduction of each component in the application monitoring stack, let’s see how they all work together by installing the Application Monitoring Operator. The first thing we need is Red Hat OpenShift cluster, which can be provided by installing Minishift on your local machine. For more information about installing Minishift, see Getting Started with Minishift.

    Once you have your cluster up and running, you can start deploying the Operator:

    1. Clone the Operator from the git repository:
      $ git clone git@github.com:integr8ly/application-monitoring-operator.git
    2. Log in to OpenShift with the administrator role (it is required to have admin access to the cluster to create CRDs, ClusterRoles, and ClusterRoleBindings):
      $ oc login -u system:admin
    3. Install the Application Monitoring Operator using Make, which will trigger a shell script to create a new namespace on the cluster, create a new label (monitoring-key=middleware), and install all of the custom resource definitions required by the stack:
      $ make cluster/install

    After running Make, all of the components are installed in a new namespace called application-monitoring. To make sure the installation went well, you can check by running the following:

    $ oc project
    Using project "application-monitoring" on server "https://your-cluster-ip:8443"
    $ oc get pods

    You should be able to access Prometheus, Grafana, and Alertmanager by getting their respective routes:

    $ oc get route

    To access Openshift via the UI you may need to grant admin permission to users. To do so, run the command below:

    $ oc adm policy add-cluster-role-to-user admin "user_name"

    Application Monitoring Operator in action

    Now that the Application Monitoring Operator is running, let’s create a project to expose metrics to Prometheus. The first thing we need to do is create a new namespace on the cluster to host the project:

    $ oc new-project example-prometheus-nodejs

    The Application Monitoring Operator uses the Kubernetes labeling system to discover imported custom resources (Prometheus rules, service monitors, Grafana dashboards, etc.):

    • Prometheus rules define a set of alert rules in Prometheus.
    • Service monitors define how groups of services should be monitored, and the operator automatically configures Prometheus to scrap services according to the definition.
    • Grafana dashboard defines dashboards to be reconciled in Grafana.

    The label value can be changed on the Application Monitoring CR by changing the property labelSelector. To create a new label called middleware for our new namespace on the cluster, run:

    $ oc label namespace example-prometheus-nodejs monitoring-key=middleware

    In the project we cloned's repository is a template file that we use to deploy the application, import the CRs (Prometheus rules, service monitors, Grafana dashboards, etc.) that the application monitoring stack detects, and reconcile them.

    To deploy the application use the following command:

    $ oc process -f https://raw.githubusercontent.com/david-martin/example-prometheus-nodejs/master/template.yaml | oc create -f -

    An important thing to notice is that the Custom Resource Definition (CRD) the Grafana dashboard imported does not have the monitoring-key=middleware label required for Grafana to detect and reconcile new dashboards. To add the label, run the following command:

    $ oc label grafanadashboard monitoring-key=middleware --all

    After this action, we should see a new Grafana UI dashboard showing app memory usage (among other things). You should also see a new Prometheus target in example-prometheus-nodejs/example-prometheus-nodejs, and the new alert role APIHighMedianResponseTime.

    Additional resources

    • Example application for Prometheus monitoring
    • Prometheus repository
    • Prometheus documentation
    • Grafana documentation
    • Monitoring Red Hat integration
    Last updated: July 25, 2023

    Recent Posts

    • Red Hat Hardened Images: Top 5 benefits for software developers

    • How EvalHub manages two-layer Kubernetes control planes

    • Tekton joins the CNCF as an incubating project

    • Federated identity across the hybrid cloud using zero trust workload identity manager

    • Confidential virtual machine storage attack scenarios

    What’s up next?

     

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Chat Support

    Please log in with your Red Hat account to access chat support.