Skip to main content
Introduction to Devops

Continuous Monitoring and the ELK Stack

Published: 2026-08-14
Level: postgraduate
Audience: Postgraduate students of software engineering and delivery

Prerequisite Knowledge

This lecture builds on the following concepts from earlier lectures. If any feel unfamiliar, review the linked notes before proceeding.

Previously Covered in This Subject

  • Continuous monitoring as part of the DevOps lifecycle — covered in Lecture 3 (Execution and Continuous Monitoring)
  • Git branching, workflows, and release tagging — covered in Lecture 7 (Git Flow vs GitHub Flow; Git Tagging) and Lecture 9 (Feature Branches and the Merge Workflow; Tags and Releases)
  • Low-risk deployment and release patterns — covered in Lecture 15 (Blue-Green Deployment; Canary Releasing)

Continuous Monitoring and the ELK Stack

16.1 What Is Monitoring?

16.1.1 Monitoring as a Process

Hook: Your application could be silently failing for hours before anyone notices. How do you find out what is actually happening inside a system you cannot watch with your own eyes?

The answer is monitoring (the process of observing and recording system state changes and data flow). The professor is deliberate about the word "process": monitoring is not a tool and not a system. A monitoring system — Nagios, Sensu, Amazon CloudWatch, the ELK stack — is the machinery you build to run this process, but the process itself is the idea you carry into any tool. Buy the best monitoring product in the world and you still have to decide what to observe, when to record, and what the recorded numbers mean. That deciding-and-observing loop is the process; the tool only executes it.

To observe and record, the process must capture two things:

  1. State changes happening to your system or application — how the system moves from one condition to another.
  2. Data flow in and out of your application, third-party applications, and your services — how data moves from one service to another.

Both are observed and recorded, and "recorded" means stored somewhere. An observation you do not store is gone the next second; you cannot compare today's behavior with last week's, and you cannot drill into an incident after it happened.

Intuition + analogy: Think of monitoring as a fitness tracker worn by your application. A fitness tracker does not just count steps (observe) — it stores a timeline of your heart rate, sleep, and activity (record) so you can spot trends: "my resting heart rate rose this week" is only visible because past data was kept. The tracker is the device; the habit of checking your vitals daily is the process. The same split exists in software: the dashboard is the device, the discipline of watching state changes and data flow is the process.

The analogy breaks where the tracking is concerned: a fitness tracker is passive, but a monitoring process actively decides what to watch and acts on what it sees — it triggers alarms and can even kick off remediation.

16.1.2 State Changes

A state change (the move of the system from one measurable condition to another) can be expressed in two ways:

  1. Direct measurement of the state — read the value now, compare with the value before.
  2. Logs recording updates that impact part of the state — an event message that says "this component changed to this value."

In plain terms, a state is some measurable description of your system at a moment in time, and a state change is when that description moves from one value to another. The professor's two examples make it concrete.

Worked example 1 — Tomcat shutting down: An application service depends on a Tomcat instance (the Java servlet container that must stay up so the application can serve requests). "Tomcat is up and running" is one state — the desired state, the state the application needs to serve requests. Now suppose that due to human error, a system conflict, or a configuration conflict, the Tomcat instance shuts down.

  • Before: state = UP (desired state — the application serves requests normally).
  • Event: Tomcat process exits.
  • After: state = DOWN (undesired state — requests now fail).

That shutdown is a state change, and it can be measured: a health check that probes the Tomcat port, or a log line written by the shutdown routine, both capture the transition from UP to DOWN.

Worked example 2 — CPU utilization crossing a threshold: The desired state is that CPU utilization should be at 80 percent. If utilization increases to 90 percent, that is again a state change in your application.

  • Before: CPU utilization = 80% (desired state).
  • Event: one service begins consuming far more compute.
  • After: CPU utilization = 90% (undesired state).

Both examples share the same skeleton: a measurable value, a desired value, and an event that moves the measured value away from the desired one. State changes are exactly what the monitoring process looks for.

16.1.3 Data Flow

Data flow (the movement of requests and responses between components and systems) is captured by logging request and response data. When end users send requests to your application and your application responds, that exchange is data flow. It happens between internal components and between your application and external systems — and both kinds must be captured and stored.

  • Internal data flow: in an e-grocery application, the search engine is your first service, and adding items to the cart is your second service. When a shopper searches for "wheat flour" and the search service hands the chosen item to the cart service, the data flowing from the search service to the cart service is internal data flow — it never leaves your application boundary.
  • External data flow: your application sends a request to a third-party tool or library (say, a payment gateway or a mapping API) and receives a response. That request-response exchange with an external system is also data that needs to be captured and stored.

Why record both? A slow checkout can have two very different causes: the internal cart service is degrading, or the external payment provider is slow. Without logged request-response records on both sides of the boundary, you cannot tell which one is guilty. That distinction is exactly what root-cause analysis depends on.

Scope — what monitoring does and does not cover: Monitoring records what happened — states, transitions, requests, responses. It does not, by itself, fix anything. Restoring the desired state (restarting Tomcat, throttling the runaway service) is the job of automation and configuration management, which the monitoring process feeds. The process also assumes you can define a desired state in the first place: an application with no measurable health criterion cannot be monitored meaningfully. And monitoring only helps if the recorded data is stored durably and read periodically — a system that records but never reviews is a log hoarder, not a monitoring system.

Visual intuition: Picture a horizontal timeline of your application's condition. The x-axis is time (hours of the day); the y-axis is a health value (for example, CPU utilization as a percentage, 0 to 100). The healthy band sits near the 80 percent line. State changes appear as step changes in this line — a vertical jump from 80 to 90, a drop to zero when Tomcat dies. Data flow adds a second track beneath it: request counts per minute, with flat stretches during quiet hours and peaks at lunchtime. The monitoring process is what keeps both tracks continuously drawn. The takeaway: monitoring is a two-track recorder — one track for condition (state), one for movement (flow) — and an incident is usually visible as a disturbance in one or both tracks before any user complains.

Pitfalls — beginner traps the professor is steering you away from:

  • "Monitoring is the tool." Buying Nagios or Kibana is not monitoring. If no one has decided what state to track and what flow to record, the tool shows empty dashboards.
  • Recording without a desired state. Logging everything tells you nothing until you can answer "compared to what?" — the desired value (Tomcat UP, CPU at 80 percent) is the reference the whole process is built on.
  • Forgetting the storage half of "observe and record." Observing is only half the process; the other half is storing what you observed. Without stored history you cannot detect degradation trends or run postmortems.
  • Monitoring only the outside. Internal data flow (search → cart) matters as much as external data flow; an outage caused by a third-party provider is invisible if you only watch your own service's logs.

16.1.4 Proactive Maintenance: Why Continuous Monitoring

In the traditional way of working, an application was maintained only after a ticket was raised by the end customer. Until the ticket arrived, nobody bothered about how the application was working. Then the team dug into the logs, found where the problem was triggered, and performed root cause analysis — after the customer had already suffered.

DevOps suggests the opposite: the maintenance part should be proactive, not reactive. The pipeline already has continuous integration, continuous code inspection, continuous testing, and continuous deployment and delivery — so why not continuous monitoring? Instead of waiting for a customer to raise something, the organization puts a rigid solution in place that automatically looks for problems and automatically resolves them. That is the mindset shift: catch the problem before the user reports it, and ideally fix it before it affects anyone.

Dimension Reactive maintenance (traditional) Proactive maintenance (DevOps)
When the problem is noticed After the customer raises a ticket Before the user reports anything
What triggers the work A ticket from the end customer Continuous monitoring data
How the cause is found Team digs into logs after the fact Monitoring catches the change as it happens
Fix timing After customer impact Before customer impact, ideally automated

The table summarizes the mindset shift: in the reactive world the ticket is the alarm; in the proactive world the monitoring system is the alarm, and the fix is often automatic by the time anyone looks.

Real-world & domain connection: in the banking domain, Kibana is most widely used as the visualization tool — we will see why later when we discuss the ELK stack, which is part of the course syllabus, free and open source.

Recap + bridge: Monitoring is a process — observe and record — with two targets: state changes (measured directly or written in logs) and data flow (request-response exchanges, internal and external). With that foundation in place, the next question is operational: what exactly should you collect? That depends on the goal you are pursuing — and the lecture answers it with the five goals of monitoring.

Real-world & domain connection: This framing is not academic — it is the backbone of modern observability practice. In the banking domain, Kibana (the visualization half of the ELK stack, which is free and open source and part of this course's syllabus) is most widely used as the visualization tool; banks use it to render exactly this kind of recorded state and flow data into dashboards that regulators, trading desks, and operations teams can read. Every DevOps monitoring tool you will meet — Nagios, Sensu, CloudWatch, ELK — is simply a different engine for running the same process of observing and recording state changes and data flow.

16.2 The Goals of Monitoring and What to Monitor

16.2.1 The Five Goals of Monitoring

Hook: The same monitoring data can be read five completely different ways — the numbers that tell you a server is dying can also tell you customers are abandoning your checkout. The goal decides what you collect, how closely you watch, and what the data means.

Monitoring has five distinct goals, and which goal you are pursuing decides what data you must collect closely. The five goals:

  1. Identifying failures and associated faults — both at runtime (the failure is happening now) and during the postmortem (after a failure has occurred, reconstructing what happened).
  2. Identifying performance problems — performance degradation of an individual system and of a collection of interactive systems: is the response time lagging? Are the services up to the mark?
  3. Categorizing workload — workload categorization for managing capacity, both short-term and long-term capacity planning, and for the billing process.
  4. Measuring end-user reaction to business offerings — how users like the features of the application.
  5. Detecting intruders — monitoring and detecting anyone attempting to break the system, which matters most where security is a priority quality attribute.

Intuition + analogy: Think of these goals as the five instruments on a car dashboard, all fed by the same engine data. The temperature gauge watches for failures (engine overheating), the speedometer for performance (am I keeping up?), the fuel gauge for capacity (how far can this tank take us?), the radio for user reaction (is anyone listening?), and the door locks for intruders (is someone breaking in?). One engine, many instruments — one system to monitor, many goals, each needing its own view of the data. The analogy breaks in one way: a car dashboard is fixed at the factory, but a monitoring process must choose its instruments per goal, because each goal needs a different source of data.

16.2.2 Where the Data Comes From

The data you collect depends on the goal. The professor's source table is the exam-relevant summary of this section:

Monitoring goal Source of data
Failure detection Application and infrastructure
Performance problem identification Application and infrastructure
Capacity planning Application and infrastructure
User reaction to business offerings Application only
Intrusion detection Application and infrastructure

When we say infrastructure, we mean the hardware-level resources: more CPU, more computational power, more hardware resources. The application side means the software stack: your services, their threads, their queues, their configuration. When we talk about software capacity planning, we might need to increase thread pools or increase the runtime allocation of a service — that is application-level capacity. So capacity planning depends on both sources — application and infrastructure.

User reaction to business offerings is the exception: its source of data is only the application. Why? Because the end user does not bother about which infrastructure the application runs on. They want a working instance of the application; whenever they want to access a service they should be able to. Where the data is stored, from where the data is routing, what hardware resources are utilized — an end user never bothers about any of it. Their reaction is shaped entirely by what the application shows them and how it behaves: page loads, search results, checkout steps, feature layout. So for this goal the source of data is only the application.

Scope — where the application-only rule holds and where it fails: The application-only source for user reaction assumes the user's experience is entirely determined by application behavior. This is true for interface-level reactions (did the search results update? is checkout smooth?). It is not true for reaction caused by delivery failure: if the infrastructure is so degraded that requests never reach the application, the user's reaction is negative but the causal data lives in the infrastructure logs. For diagnosing why the reaction is bad you need both sources; for measuring what the reaction is, the application alone suffices.

16.2.3 Fundamental Items to Monitor

When implementing the monitoring process, three fundamental items should be considered — they form the input-processing-output loop that every application exhibits:

  1. Input — what input is given by the end user. In an e-grocery application, the user clicks on the search box and types "wheat flour." That typed search is the input.
  2. Resources — once the input is given, the services of the application process it. The search engine service processes the business logic written for search: it hits particular keywords and publishes the matching inventory items on the search results page. Processing involves resources:
  • Hardware resources: CPU, memory, disk, and network — even though they are virtualized, they are still hardware resources (a virtual CPU is still consuming a physical core somewhere).
  • Software resources: queues, thread pools, and configuration specifications.
  1. Output — once the input is processed, the outcomes are returned: all the wheat flour items in the inventory get published. Output includes items such as transactions and business-oriented activities — all the outcomes.

Worked example — the e-grocery loop, item by item: A shopper opens the e-grocery application and wants wheat flour.

  • Input: the user clicks into the search box and types "wheat flour". The typed string is the input — it enters the application from the outside and becomes the first thing the monitoring process records.
  • Resources: the search engine service picks up the input. Its business logic hits the search keywords, matches them against the inventory, and prepares to publish the matching items. While this happens, the service consumes hardware resources (CPU cycles for matching, memory for the result set, disk and network for reading the inventory) and software resources (a thread from the pool, a queue slot). The search service then hands the result onward — the data flow from search service to cart service that we saw in the previous section.
  • Output: the outcomes are returned — all the wheat flour items in the inventory get published on the search results page. This is a business outcome: the shopper can now select an item, add it to the cart, and eventually transact.

The monitoring lesson: an application is a machine that turns input into output by consuming resources. Monitor all three — if the output is missing, check whether the input was captured and whether the resources were available. One of the three always explains the failure.

Visual intuition: Draw the loop as three boxes in a line — Input → Resources → Output — with arrows between them. Under each box, note what monitoring records: under Input, request counts and request sizes; under Resources, CPU, memory, disk, network, queue depth, thread-pool utilization; under Output, transaction counts and business outcomes. The five goals then attach to different parts of the loop: failure detection watches all three, performance watches Resources, user reaction watches Input and Output, workload categorization watches Input (how much work is arriving), and intrusion detection watches for abnormal Input and abnormal Output patterns. The takeaway: every monitoring goal is a way of reading this one input-resource-output loop.

Pitfalls:

  • Assuming one data source serves every goal. Four of the five goals need both application and infrastructure data. Collect only application logs and you will be blind to the hardware failure that caused them.
  • Forgetting that user reaction is the odd one out. This is the professor's favorite trap: the end user never sees your infrastructure, so their reaction can only be read from application data.
  • Monitoring output without input. If the wheat-flour page is slow, is the search request slow (input), the matching slow (resources), or the result rendering slow (output)? Monitoring only the final output cannot answer that.
  • Treating virtualized resources as "not hardware." A virtual CPU is still hardware being consumed; capacity planning that ignores virtualization still ends at the physical datacenter.

Recap + bridge: Monitoring has five goals — failures, performance, workload, user reaction, intrusion — and four of the five draw on application plus infrastructure data, while user reaction draws on the application alone. The loop to monitor is always input → resources → output. Now that the goals are set, the lecture starts working through them one by one, beginning with the most fundamental: detecting failures.

Real-world & domain connection: In industry, this goal-to-source mapping is exactly how monitoring stacks are designed: infrastructure monitoring tools (CloudWatch, Nagios) feed hardware-level data, while application performance monitoring (APM) agents feed the application-level data, and product analytics tools (web analytics, session replay) feed the user-reaction view. The exception in the professor's table is why e-commerce companies run three separate tool families — a bank or an e-grocery platform cannot infer a customer's reaction from a CPU graph, and equally cannot diagnose a slow checkout from click analytics alone.

16.3 Goal 1: Failure Detection

16.3.1 Hardware Failures: Total vs Partial

Hook: Which failure is harder to find — the machine that has completely stopped, or the machine that works just a little worse than before? The answer is the second one, and it is not close.

Failures of any element in physical infrastructure are possible. The cause can be anything — overheating, wear, loose connections, even physical damage to cabling. What matters for monitoring is not the cause but the shape of the failure, and the professor's example is the cable pin in a socket.

Intuition + analogy (the professor's cable-pin analogy): Think of an electrical cable plugged into a socket. If the pin is completely out of the socket, that is a total failure — and total failure is really easy to detect, because there will be no data flow. No data flow immediately identifies the failure: the circuit is open, the connection is dead, and any observer can see that nothing is getting through. Total failure is the loud failure — it announces itself.

Partial failures are the hard ones. If the pin is loosely fitted into the socket, sometimes you get a quick response and sometimes there is a delay — the response time changes. Power flows, but intermittently and poorly. So partial failures manifest as performance problems: the system still answers, but its answers are delayed, jittery, and degrading. Delayed, degraded performance can be caused by partial failures of components of your system, and from a monitoring perspective it is difficult to detect exactly where the problem is triggered — because nothing is dead outright, only subtly worse.

Worked example — total vs partial in the response-time trace: Consider an application service whose requests historically complete in about 100 milliseconds.

  • Total failure (pin fully out): requests receive no response at all — connection refused, timeouts. The monitoring system sees data flow drop to zero. Detection is immediate and unambiguous: no data where data used to flow.
  • Partial failure (pin loose): requests still complete, but the response time jumps between 100 ms and 1,200 ms unpredictably. Traffic does not stop, so no "no data flow" signal fires. The monitoring system sees a performance problem — but where is it? The slowness could be in the network card, the cable, the switch, the OS, or the service itself. That ambiguity is the monitoring signature of partial failure.

The sense-check: total failure is a binary on/off problem and trivial to detect; partial failure is a spectrum problem and hides behind performance numbers.

Real-world & domain connection: Nobody wants to purchase their own server and configure it anymore; everybody looks for on-demand infrastructure — third-party services. When you acquire third-party services, hardware monitoring responsibility lies with the data center provider. For example, on Amazon's AWS cloud platform, hardware monitoring is done by the cloud provider itself — AWS watches the physical hosts, network, and storage fabric, while the customer monitors what runs on top. In practice this means the partial hardware failures of the provider's fabric often surface to the customer only as mysterious application-level slowdowns — exactly the "response time changes" symptom of the loose pin, now observed across an organizational boundary.

16.3.2 Software Failures: Dependency Failure and Misconfiguration

Hardware is only half the story. Software can also fail, either totally or partially — and there are two primary reasons for software failures:

  1. Dependency software failure — the application depends on another software component, and that component fails. Example: an application service depends on Tomcat. If Tomcat is shut down, there is no response and the service will not work. The application itself never changed — its dependency died, and the application died with it.
  2. Software misconfiguration — the application is set up incorrectly. Example: the application depends on, say, JRE 7 (Java Runtime Environment version 7), and due to a manual mistake or a script mistake the JRE 7 is upgraded to 8. The result is compatibility issues or software failures due to the misconfiguration. The runtime is present and running — it is just the wrong one.

Worked example — the JRE 7 → 8 misconfiguration: An application was built and tested against Java Runtime Environment 7.

  • Intended state: JRE 7 installed; application runs normally.
  • Event: an automated provisioning script (or a hurried manual step) installs JRE 8 in place of JRE 7 — a script mistake, not a deliberate upgrade.
  • Result: the application, compiled and tuned for JRE 7, hits compatibility issues — perhaps a removed API, a changed default, or a library that refuses to load. Requests start failing or behaving incorrectly.

The critical monitoring point: no component is missing and nothing crashed visibly — a healthy runtime is running the process. Only a check against the expected configuration ("is the runtime version what the application requires?") reveals the failure. This is why configuration monitoring matters as much as health monitoring: dependency failures are visible in the response, misconfiguration failures are visible only in the comparison of actual versus desired settings.

16.3.3 Three Ways to Detect Software Failures

Detecting software failures can be done in one of three fashions:

  1. Monitoring software (external health check) — the monitoring software performs a health check on the system from an external point. The monitor stands outside the application, sends probes in, and reads the response: is the port open? Does the endpoint answer correctly?
  2. A special agent (in-system monitor) — an agent residing inside the system itself collects data and cross-verifies whether the system is in the desired state: whether dependent resources are up and active, and whether software configuration settings have changed. Because the agent lives inside, it can see what an external probe cannot — internal queues, thread pools, configuration files, dependency state.
  3. Self-detection (the system reports on itself) — the system itself detects the problem and reports it. The application catches its own errors, logs them, and notifies the monitoring system.

These are the three different ways of detecting software failure. Note how they line up with the earlier material: the external health check and the in-system agent correspond to the health-check and agent-based monitoring we will meet again in the "How to Monitor" section, and the misconfiguration example above is precisely the kind of check only the in-system agent can do well.

Scope — when each detection way works and when it fails:

  • The external health check only proves the outside is reachable. A service can pass a port probe while its internal dependencies are failing — the check cannot see past the socket.
  • The in-system agent sees internal state but must be installed and kept current on every component; if a component does not have the agent, it is blind there.
  • Self-detection is the most precise (the component knows itself best) but depends entirely on the software being written to detect and report; most failures of unmonitored legacy software are invisible to it.
  • Assumption: all three assume the detection result is recorded and reviewed — a health check whose output is never stored or read detects nothing in practice.

Visual intuition: Picture the monitored system as a house with three kinds of observers. Observer 1 stands outside the gate and knocks periodically — if the door opens, the house is "healthy" (external health check). Observer 2 lives inside the house and walks every room, checking that the boiler, the wiring, and the configuration of every appliance match the blueprint (in-system agent). Observer 3 is the house itself — a smoke detector wired to an alarm (self-detection). Total failure (the house burned down) is obvious to all three; partial failure (the boiler runs but heats poorly) is visible only to observers 2 and 3 — which is why monitoring design chooses which observers to deploy per component.

Pitfalls:

  • Treating "it still responds" as "it is healthy." That is the loose-pin trap: partial failures answer their probes. You need response-time and configuration checks, not just reachability checks.
  • Assuming the application you depend on cannot be the problem. Dependency failure (Tomcat down) and your own code failing produce identical user-facing symptoms; without monitoring the dependency itself, the two are indistinguishable.
  • Ignoring configuration drift. The JRE 7 → 8 example shows that a healthy-looking runtime can be the failure. Scripts and humans change configurations; monitoring must compare actual settings against desired settings, not just uptime.
  • Relying on one detection way only. External health check, in-system agent, and self-detection each see a different slice; a monitoring setup that uses only one has two blind spots by construction.

Recap + bridge: Goal 1 — failure detection — splits into hardware failures (total failures are loud and easy, partial failures hide as performance problems) and software failures (dependency failure and misconfiguration, detected externally, by an in-system agent, or by self-detection). The phrase "partial failures manifest as performance problems" is the bridge to the next goal: the second goal of monitoring is precisely about reading those performance numbers.

Real-world & domain connection: This total/partial distinction shapes how real sites do incident detection. Health checks and heartbeat monitors catch total failures instantly, while the "loose pin" class of problems — flaky networks, degrading disks, dying memory — is what modern SRE practice hunts for with golden-signal monitoring (latency, traffic, errors, saturation). In the cloud era the physical half of this responsibility moved to the provider: AWS, Azure, and Google Cloud monitor their own hardware fabric (the cloud provider's responsibility), while tenants monitor their applications and the configuration drift that so often breaks them.

16.4 Goal 2: Performance Degradation

Hook: The report job ran 50 times in the last hour. This hour it ran 45 times. Is that a failure, a coincidence, or a signal? Goal 2 of monitoring exists because systems do not fail like a light switch — they fade.

Intuition + analogy: Picture a highway. The first number is how long one car takes to cross it — the wait of a single driver. The second is how many cars pass the toll gate per hour — the overall traffic the road handles. The third is the share of lanes occupied at a given moment — how loaded the road is. A road can be packed yet still moving, and it can be nearly empty yet slow. No single number describes the traffic — which is exactly why the three metrics are read together. The analogy breaks in that a road's lanes are fixed, while software resources (thread pools, queues) can be resized — but the three numbers still behave the same way.

16.4.1 Detecting Degradation: Current vs Historical

Degraded performance can be observed by comparing the current performance with the historical data. Is the response intact like it was earlier, or is there a delayed response? The comparison needs history — which is why the "recorded" half of the monitoring process from Section 16.1 matters so much: without stored historical data there is nothing to compare the present against.

The professor's warning: Ideally your monitoring system should catch this performance degradation before the end customers or end users get impacted and start notifying you. Catching it before they notice is the proactive way of working. The moment you rely on users reporting slowness, you have already failed this goal — the degradation may have been running for hours, silently compounding, before the first ticket arrives.

Scope — what the current-versus-historical comparison assumes: The comparison assumes the past is a valid baseline for the present. If the workload itself changed (a new feature shipped, a marketing campaign doubled traffic, the user base grew), the historical numbers are no longer a fair reference — a "degradation" may simply be a heavier workload. This is why the worked example in this section must be read carefully: going from 50 to 45 completions of the same operation per hour is only a degradation if the demand is unchanged. Professionals couple the per-hour completion count with user counts before declaring a problem.

16.4.2 Performance Metrics: Latency, Throughput, Utilization

Several metrics help measure performance. Three form the standard performance picture:

Latency is the time from the initiation of an activity to its completion — the period from user request to satisfying that request. In the running example: you search for wheat flour; how much time did the system take to give you the results? That is the latency. It can be measured at various levels of granularity: at a coarse grain it is the period from a user request to the satisfaction of that request; at a fine grain it is the period from placing a message on a network to the receipt of that message.

where:

  • is the latency — the time the activity took, measured in time units (seconds, milliseconds).
  • is the time the activity started — the clock reading at initiation.
  • is the time the activity completed — the clock reading at completion.

The formula is a simple difference of two clock readings. It works cleanly when both readings come from the same machine; across different machines, clock synchronization makes it harder (this is why distributed tracing uses coordinated timestamps). Latency is cumulative: the latency of satisfying a user request is the sum of the latencies of all sub-activities until the request is satisfied, adjusted for parallelism — so knowing the latency of each sub-activity tells you where a slow request lost its time.

Throughput is the number of operations of a particular type in a unit of time. Example: report generation is one particular type of operation; in one unit of time, how many report generations happen? Previously the application did 50 report generations in the unit time period; currently only 45 happen. That drop is a performance degradation.

where:

  • is the throughput — operations of the particular type per unit of time.
  • is the number of operations of the particular type that completed.
  • is the duration of the observation window — the unit of time.

Throughput has a single-user cousin, latency: throughput is a system-wide measure involving all users, while latency is per request. High throughput does not imply low latency — a system can serve many requests slowly, or few requests quickly — and the relation depends on the number of users and their pattern of use.

Utilization is the relative amount of use of a resource. For hardware resources: CPU utilization, memory, disk. A useful threshold example: CPU should utilize 80 percent; if it increases beyond that, to 90 or 100 percent, you definitely see performance degradation in the application, because the computational power is being used hugely on one particular service and you are not getting the response.

where:

  • is utilization as a percentage.
  • is the amount of the resource currently in use.
  • is the total amount of the resource available.

A quick sanity check of the formula: if 80 cores are in use out of 100 available cores, — a ratio that always lands in , as a percentage must. Utilization makes sense only when usage is attributed: "the application is using 80 percent of CPU" is actionable, while "CPU is 80 percent used" without knowing what is consuming it supports no decision.

Visual intuition: Plot latency, throughput, and utilization on one dashboard against time. Latency is the line that stays flat during health and rises (with spikes) during trouble. Throughput is the line that follows demand — it breathes up and down with the business day. Utilization is the line that hugs the ceiling when a resource is saturated. The tell-tale pattern of degradation: utilization climbs toward 100 percent while latency starts rising and throughput stops climbing — the road is full, the travel time is up, and the toll-gate count has flattened. The one-sentence takeaway: no single metric tells the story; the trio together separates "heavy but healthy" from "saturated and failing."

Utilization is the third metric; latency, throughput, and utilization together give you a performance picture. Memory and disk are hardware resources measured this way; the number of queues or thread pools created are the software resources measured this way.

16.4.3 Worked Example: Report Generation Throughput Drop

Worked example — the 50 → 45 throughput drop: Given: previously 50 report generations per unit of time. Currently: 45 report generations per unit of time.

Step by step:

  1. Define the observation window: hour.
  2. Previous throughput: reports per hour.
  3. Current throughput: reports per hour.
  4. Difference: reports per hour — a drop of .
  5. Interpretation: fewer operations of that type complete in the same unit of time.

Conclusion: there is a performance degradation.

Sense-check: The drop of 5 is meaningful only under the assumption that demand stayed constant — if the number of users requesting reports also fell by 10 percent, the throughput drop is explained by demand, not by degradation. This is the professor's caution folded into the math: pair throughput with user numbers before raising the alarm.

16.4.4 Worked Example: CPU Utilization Threshold

Worked example — the 80 percent CPU threshold: Given: the threshold value for CPU utilization is 80 percent. Now utilization increases to 90 or 100 percent.

Step by step:

  1. Take a machine with 100 CPU cores, so .
  2. Normal operation: cores in use, so — at threshold, but healthy.
  3. One service begins consuming the machine: cores, so — the threshold is crossed.
  4. Worst case: , so — saturation; the scheduler queues work, requests wait.

Conclusion: because the utilization has crossed the threshold, the computational power is being consumed heavily by one particular service and responses are not coming back — performance degradation in the application.

Sense-check: The percentage arithmetic is right (90 percent of 100 cores is 90 cores), and the behavior is plausible: at 90-100 percent utilization, queuing grows and response times stretch — exactly the loose-pin symptom of the previous section, now quantified. The threshold logic here also foreshadows the alarm/alert thresholds of Section 16.10.

Visual intuition: Imagine a line chart of CPU utilization with time on the x-axis and percentage on the y-axis (0-100 percent). During normal hours the line rests near 80 percent with small jitter. When the runaway service starts, the line rises through 90 percent and pins against the 100 percent ceiling, flattening at the top — a saturated line is the classic saturation signature. The latency line above it rises in the same window. The takeaway: utilization crossing the threshold together with rising latency and flat throughput is the confirmed degradation pattern.

Pitfalls:

  • Declaring degradation from one metric alone. Throughput can drop because demand dropped; utilization can spike because a heavy but legitimate batch job is running. Always read the trio — and, where possible, the user count — together.
  • Setting utilization thresholds at the ceiling. If the alarm fires only at 100 percent, you find out about saturation when requests are already queuing; the 80 percent threshold exists precisely because it fires before saturation.
  • Reading utilization without attribution. "CPU at 90 percent" without knowing which service owns the load leaves you hunting; the same number with attribution ("the report service is at 90 percent") is a diagnosis.
  • Ignoring cumulative latency. A slow end-to-end request with no per-sub-activity breakdown hides where the time went; latency is a sum of parts, and the parts are where the answer lives.

Recap + bridge: Goal 2 — performance degradation — is detected by comparing current performance with historical data, using three metrics: latency (how long one activity takes), throughput (how many operations per unit time), and utilization (how loaded a resource is). The worked examples — the 50 → 45 report generation drop and the 80 → 90-100 percent CPU crossing — are the exam-style applications of these formulas. The next goal turns from measuring the present to predicting the future: capacity planning uses monitored workload data to decide how much infrastructure to buy.

Real-world & domain connection: These three metrics are exactly the golden signals that site reliability engineering teams monitor in production — latency, traffic (throughput), errors, and saturation (utilization). The Platformer.com case in the reference text shows them in action: a customer's servers ran at a normal CPU utilization of about 5 percent, then spiked to around 17 percent over two days — a pattern suspicious enough to look like an intruder, but which turned out to be the customer's opening-night event. That case illustrates both the power of threshold-free, baseline-relative reading of utilization and the cost of missing application-level context. In banking, the same trio powers service-level agreements: a payment gateway contract specifies latency (p99 response under 500 ms), throughput (thousands of transactions per second), and utilization ceilings for capacity review.

16.5 Goal 3: Capacity Planning

Hook: A startup's application is a hit — 600 users registered in 15 days against a plan of 400. That is good news that can destroy the business: the infrastructure was sized for 1,000 users. When do you buy more?

Intuition + analogy: Think of capacity planning as sizing a restaurant kitchen before a festival season. The owner's job is the weeks-and-months view: watch how many customers arrive, project the holiday rush, and decide whether to buy a bigger stove — a decision made by people, over days and months. The head chef's job is the minutes-and-hours view: at 8 p.m. open the second pass line and the extra prep stations; at 11 p.m. close them again — no owner needed, driven by the queue out front. The analogy breaks in that a restaurant's equipment is bought once and physically fixed, while cloud capacity can be ordered and released on demand — which is precisely what makes the fast, hands-free mode possible.

16.5.1 Long-Term Capacity Planning

There are two types of capacity planning: long-term and short-term.

Long-term capacity planning needs human involvement — even though the monitoring is continuous, a human is needed here — and works on a time frame of days, weeks, months, or even years. It is intended to match the hardware needs, whether real or virtualized, with the workload requirement: what workload are you observing on your application, and based on that, how much infrastructure should the organization increase?

The long-term planning flow — the professor's chain, worth remembering end to end:

  1. Monitoring data — the monitoring system continuously categorizes the current workload (how many users register, how many access the application).
  2. Workload categorization — that raw data is turned into a picture: current usage, growth rate, capacity consumed.
  3. Human decision — a person combines the workload picture with business considerations (planned campaigns, funding, strategy) and projects the future workload.
  4. Capacity increase — the organization decides on the additional infrastructure and funds it.

In a physical data center, long-term planning involves ordering new hardware. In a virtual public data center — which is what almost everybody uses now — it involves deciding how many new virtual machines to request, based on how many users are registered and accessing the virtual resources. The categorization of the current workload comes from the monitoring data: how many users are getting registered and accessing your application. From that current workload plus the business consideration, you project the future workload, and the organization decides whether to increase capacity.

16.5.2 Worked Example: The Online Paper Distribution Startup

Worked example — XYZ's paper distribution application:

Context: XYZ is a startup organization that wants to implement an online paper distribution application: users can see which paper they would like to opt for, subscribe, unsubscribe, and schedule the time frame of delivering the newspaper.

The starting position: Since it is a startup, it does not have a good amount of funds for infrastructure. Strategic management decided to opt for infrastructure that supports 1,000 users' registration, with 1,000 users able to access the application at a time.

The business plan: in the next 15 days, reach at least 400 subscriptions/registrations; in 30 days, increase by 500; and in two months' time, reach 100,000 users. (The 100,000-user figure is the spoken target — ambitious for a funded startup, but the point of the example is the planning process, not the exact forecast.)

What monitoring observes: The monitoring system monitors both application-level and infrastructure-level data. It captures that in 15 days, 600 users registered — the target was 400, and the observed output is 600.

The arithmetic of the catch-up: The observed registrations beat the target by users, i.e., of the plan — 50 percent ahead. At the launch rate of users per day, the remaining capacity gap to the 1,000-user ceiling is users. Growth rarely stays at launch fever pitch, so with the business consideration factored in (growth settling to roughly half the launch rate, ~20 users per day), the remaining 400 registrations need about 20 more days — the organization foresees hitting the 1,000-user ceiling in about one and a half months. The application is getting used in good shape.

The human decision: Based on that projection, long-term capacity planning happens: after about one and a half months, order more infrastructure so the application can support 1,500 users at a time.

The flow, restated: monitoring data (600 registered) → workload categorization (1.5× target, ~40 users/day) → human decision (project 1,000-user ceiling in ~1.5 months) → capacity increase (order support for 1,500 users).

Sense-check: The example is coherent: the ceiling is hit around the time the plan promised growth, the decision is made before users are locked out, and the 50 percent margin over the observed load gives room for continued growth. Waiting until users actually hit the 1,000 ceiling would be reactive capacity planning — the failure mode this goal exists to prevent.

16.5.3 Short-Term Capacity Planning

Short-term capacity planning is done automatically — there is no human interaction — and the time frame is in minutes, hours, or within that day. It depends completely on the cloud platform context: third-party vendors, on-demand infrastructure.

In short-term capacity planning, capacity decisions happen like creating new virtual machines or shutting down existing virtual machines, in terms of meeting the billing purpose — optimizing the cost. Monitoring the usage of current VM instances is an important part of this. The idea exists because charging for use (pay per use) is an essential characteristic of any cloud provider, a term defined by NIST — the U.S. national body for science and technology standards, known by the acronym NIST. The question is: how much optimized a way can we use the cost and infrastructure? Because every running VM is metered and billed, a VM that serves no users is not a safety cushion — it is a cost line.

Scope — what each planning mode assumes and where it breaks:

  • Long-term planning assumes human judgment is available and affordable. If the business cannot fund the order, monitoring data decides nothing — the projection stays on the slide. It also assumes the projection from current workload is roughly valid; a launch that never repeats its first month makes the projection stale quickly.
  • Short-term planning assumes a cloud platform with on-demand pricing. On physical, owned infrastructure there is nothing to "shut down" and no per-hour bill — the mechanism does not exist. It also assumes the automatic rules are correct: a bad rule (shutting VMs during a real peak) optimizes cost by destroying the service. NIST's pay-per-use characteristic is what makes the whole mechanism possible — without metered billing, there is no cost to optimize.

16.5.4 Worked Example: Amazon's VM Shutdown at Night

Worked example — Amazon in the India region, 1 a.m. to 5 a.m.:

Observed data: Consider the Amazon application (ordering and delivery of groceries and items), in the India region. The monitoring system has captured that users actively use the application during the day, but from 1 a.m. to 5 a.m. there is no huge access — not many users hit the website in that window.

The automatic decision: Based on that observed, collected data: instead of keeping 100 VMs running during that period, why not shut down 50 VMs and run the application on 50 percent of capacity?

The cost arithmetic: The application normally runs on 100 VMs. During the quiet window it runs on VMs — half the fleet. If every VM bills the same per-hour rate, the bill for the window is halved: the company saves 50 percent of the cost during 1 a.m.–5 a.m. Over a month, that is VM-hours not billed.

Second scenario — the weekend rule: Monday through Thursday are days where end users are not accessing the application widely; Saturday and Sunday are the days where customers access it widely. Set the configuration in the monitoring system: if the day is Saturday or Sunday and within a certain timeline, this number of VMs should be up and running. The monitoring system gives this information to the configuration management tool, and the configuration management tool makes sure to activate the VMs.

The flow: monitored usage pattern (day/night, weekday/weekend) → configuration rule in the monitoring system → instruction to the configuration management tool → automatic VM activation or shutdown.

Sense-check: 50 of 100 VMs shut down is a 50 percent cost saving — the arithmetic is direct and the risk is contained because the window is genuinely quiet. The weekend rule scales the same mechanism from hours to days of the week. Short-term capacity planning again — automatic, cost-optimized, driven by monitoring data.

Visual intuition: Plot the number of active VMs and the number of concurrent users on the same chart, with time of day on the x-axis. The user curve has a mountain during the day and a valley at 1–5 a.m. The VM line follows it: 100 during the day, stepping down to 50 in the valley, stepping back up at dawn. On the weekend, the whole profile lifts. The takeaway: capacity follows demand like a shadow — automatically in short-term planning, after a human decision in long-term planning.

Pitfalls:

  • Confusing the two planning modes in an exam answer. Long-term = human involvement, days to years, ordering hardware/VMs. Short-term = automatic, minutes to hours, create/shutdown VMs for cost. The presence or absence of human interaction is the cleanest discriminator.
  • Reading "throughput drop" as capacity need without demand context. A capacity decision based on raw traffic without user counts can both over-buy (users fell) and under-buy (per-user usage rose).
  • Treating short-term planning as a purely technical game. The weekend rule exists to serve business demand; a rule that optimizes cost while Saturday customers wait is a business failure wearing a technical hat.
  • Assuming automatic decisions are safe. The monitoring system's rules are only as good as the configuration; forgetting to update them after a workload change silently re-breaks capacity.

Recap + bridge: Goal 3 — capacity planning — comes in two flavors: long-term (human, days-to-years horizon, monitoring data → workload categorization → human decision → capacity increase, as in the XYZ example) and short-term (automatic, minutes-to-hours, create and shut down VMs for cost under cloud pay-per-use, as in the Amazon 100 → 50 VM example). Both are fed by the same monitoring data. The next goal moves from the system's behavior to the user's behavior — goal 4 watches how users interact with the application.

Real-world & domain connection: This is how every major cloud consumer runs cost and capacity. Amazon's own e-commerce platform and thousands of organizations use autoscaling rules driven by monitoring to shrink fleets at night and grow them for weekend peaks; NIST's pay-per-use definition is literally the legal and economic foundation of cloud billing (metering usage is how AWS, Azure, and Google Cloud can charge by the hour and by the GB). Capacity projections built from monitored workload data also feed budget cycles — the "order more infrastructure" decision in the XYZ example is a quarterly business process in real companies.

16.6 Goal 4: User Interaction Monitoring

Hook: Your system reports healthy, your CPU is fine, your queues are empty — and customers are leaving. Goal 4 exists because the only person who truly experiences the application is the end user, and their experience is not captured by any infrastructure metric.

Intuition + analogy: Think of user interaction monitoring as a restaurant manager standing in the dining room rather than in the kitchen. The kitchen dashboard (infrastructure metrics) says the ovens are fine and the cooks are busy; the manager in the dining room watches the actual diners — how long they wait for their food, whether their order arrives correctly, whether the menu page (UI) updated. The two viewpoints see different problems: a kitchen that is fast but whose waiters misread orders is invisible to the ovens' temperature gauge. The analogy breaks in that a restaurant manager cannot observe 100,000 diners personally — software monitoring can, which is exactly what real user monitoring does.

16.6.1 What to Observe

The fourth goal is to observe how users interact with the application. Three things need observation:

  1. Latency of user requests — how long each user request takes. Users expect decent response times, and the impact of delay is measurable: even a few hundred extra milliseconds changes how much users use a service.
  2. Reliability of the system — if you increase the number of users accessing a particular service, does the system respond correctly or does it get trashed (degraded)? Reliability is watched under load: the question is not "does it work?" but "does it keep working as the crowd grows?"
  3. User interface modification — when the user clicks on the search engine and types wheat flour, does the next pane update with the published wheat flour items? The UI must actually change as the user interacts — the pane updating with the search results is the visible proof that the request-response loop reached the user's screen.

All of this is the user monitoring goal. Note the echo of the earlier metrics: the first item is the latency formula of Section 16.4 applied at the user level — , with the start being the user's click and the end being the user's screen update.

Scope — what the three observations can and cannot tell you:

  • The three observations measure the user's experience of the interface, not the business value of it. A fast, reliable, correctly updating search pane still does not tell you whether users like the feature or whether they buy more — that is the territory of the organization's own business metrics (conversion, click-through, repeat visits), which complement this goal.
  • Assumption: UI modification observation assumes the interface is the application's front end; for API-only or headless services, the "pane update" is the API response, and this item reduces to response correctness.
  • Assumption: reliability under increasing users assumes the load test reflects real usage patterns; artificial loads that do not resemble real behavior give false confidence.

16.6.2 Real User Monitoring vs Synthetic Monitoring

There are two ways of doing user interaction monitoring:

  1. Real user monitoring — real end users are accessing the application, and you monitor the data flow from the end user. Every actual user interaction is captured: every click, every request, every response time. Because the data comes from genuine users, it reflects the real service level users experience — including their real network conditions, browsers, and locations. Real user monitoring is usually passive: it watches without injecting load or changing the server-side application.
  2. Synthetic monitoring — generally performed by the organization for capacity testing and user acceptance testing. A script runs and creates multiple instances of the same service in your application, creating artificial users with the help of the script; the script hits the particular services of your application to see whether the application is responding in time and whether performance degrades. Because the script drives the same scenario every time, results are systematic and repeatable — it does not matter what real users happen to be doing right now.

Real users on one side, artificial script-driven users on the other. The two approaches differ on exactly the dimension that matters:

Dimension Real user monitoring Synthetic monitoring
Who generates the traffic Real end users Scripts creating artificial users
When it runs Continuously, whenever users are active On a schedule or on demand (capacity tests, UAT)
Typical purpose Assess the real service level users experience; catch issues in production Capacity testing, user acceptance testing, pre-release verification
Repeatability Not controllable — depends on user behavior Fully repeatable — same scenario every run
Blind spots Quiet hours when no users are online Synthetic behavior that may not match real users

When to pick which: use synthetic monitoring to verify behavior systematically (before releases, during capacity tests), and real user monitoring to learn what users actually experience in production — most organizations run both, because each covers the other's blind spots.

Visual intuition: Picture two monitors side by side. Left screen: a stream of dots, each dot one real user session, appearing at random moments with different speeds and paths — noisy, real, alive (real user monitoring). Right screen: a metronome — identical probes firing every five minutes on a fixed route through the application, each exactly like the last (synthetic monitoring). The metronome finds regressions the moment they happen (it always runs), while the stream shows the truth about real conditions (it always reflects reality). The takeaway: one gives you a heartbeat you control; the other gives you the pulse you did not ask for.

Pitfalls:

  • Testing only with synthetic traffic. Scripts exercise the happy path; real users click the weird things — and only real user monitoring sees that.
  • Believing synthetic results imply production readiness. A passing capacity test says "the scripted scenario passed," not "real users will be happy"; user acceptance testing must still run against real workflows.
  • Reducing user monitoring to latency alone. The professor's three items — latency, reliability under load, UI modification — are three different failure classes; a system can score well on request speed and still break the UI update that the user actually sees.
  • Ignoring the passive nature of real user monitoring. RUM watches but does not exercise; a feature no real user has touched yet is invisible to it until synthetic or real usage arrives.

Recap + bridge: Goal 4 — user interaction monitoring — observes latency of user requests, reliability under increasing user numbers, and user interface modifications, and it can be done two ways: real user monitoring (real traffic, passive, continuous) or synthetic monitoring (script-driven artificial users, systematic, used for capacity testing and user acceptance testing). The lecture now completes the five goals with the one that matters most where security is a priority: detecting intruders.

Real-world & domain connection: This goal is a core practice of e-commerce and banking sites: real user monitoring feeds the dashboards that show p95 and p99 page-load times, and synthetic monitors ("synthetic checkers") probe critical journeys — login, search, checkout — around the clock from multiple locations. The stakes are documented: delaying a search results page by even 100–400 ms measurably reduces how many searches users perform. In banking, user interaction monitoring on the customer portal pairs with the intrusion-detection goal of the next section — the same user sessions that tell you the experience is smooth can also reveal sessions that do not match the user's normal behavior.

16.7 Goal 5: Intrusion Detection

Hook: The admin generates a report at 5 p.m., every day, for months. One afternoon the monitoring system sees that same account generate the report 100 times at 3 p.m. The system did not need a single blacklist to know something was wrong — it only needed to know what "normal" looks like.

Intuition + analogy: Think of a neighborhood watch built on habit, not suspicion: the watch knows the postman comes at 10 a.m., the baker's van at 11, and the neighbor's dog walks at 6 p.m. Anything outside that pattern — a stranger at the door at 3 a.m., a car circling the block eight times — is flagged, not because it is on a "criminals" list, but because it does not match the neighborhood's normal. Intrusion detection works the same way: the system learns the baseline (what this user, this network, this application normally does) and flags deviations from it. The analogy breaks in that people's habits are fuzzy, while a monitoring system can enforce precise rules — and also generates false alarms when legitimate behavior changes (a real user traveling abroad trips the same pattern the intruder detector is built to catch).

16.7.1 Role-Based Activity Monitoring

Intruders can break into a system either by disturbing an application by providing incorrect authorization. With this goal, the application monitors users and their activities to determine whether those activities are in line with the user's role in the organization.

Role-based monitoring works by pairing two things:

  1. The role — the set of activities the organization has assigned to a user (admin, operator, customer support, reader).
  2. The observed activity — what that user's account actually does.

When the observed activity departs from the role's expected pattern, the deviation itself is the alarm trigger — no signature of a known attack is needed.

Worked example — the admin who generated 100 reports at 3 p.m.:

Baseline: a user has the admin role. The admin has access to report generation and usually generates the report at the end of the day, by 5 p.m. One report, once a day, at closing time — that is the role's normal activity pattern.

Observed deviation: now the monitoring system observes that the admin user is generating the report 100 times, and that too during the 3 p.m. timeline.

Analysis: two dimensions are off pattern at once — the count (100 generations against a usual one) and the timing (3 p.m. against the usual end-of-day 5 p.m.). Either alone would be suspicious; together they are a strong anomaly signal: the account is doing something the legitimate admin never does.

Conclusion: that is a problem — a scenario not in line with the desired activity of that role. Whether the account is compromised or misused, the monitoring system has caught it without knowing the attacker's identity.

Sense-check: The example is coherent because the baseline is crisp (once, at 5 p.m.) and the deviation is extreme (100 times, at 3 p.m.) — the farther an activity sits from the baseline, the louder the anomaly, and real detectors tune that distance into an alarm threshold.

16.7.2 Network Traffic Monitoring

An intrusion detector is a software application that monitors network traffic by looking for abnormalities. The abnormal can be caused by attempts to compromise the system, or by violations of the organization's security policies — it does not need to wait for a successful break-in.

Worked example — the Pune user logging in from Amsterdam:

Baseline: the location of a particular person is known to be Pune; using their credentials, the application is normally accessed from Pune.

Observed deviation: the application is accessed from another region — from Amsterdam or Japan.

Analysis: a login from a geographically distant region, under credentials that always come from Pune, is an abnormality — the account may be stolen, the session hijacked, or the user genuinely traveling.

The intelligent reaction: instead of just closing it out, the intelligence system sends a message to the customer: the application got accessed from such-and-such region; if this activity was not authenticated or was performed abnormally — not in line with your activity pattern — report back so that we can do the needful. The system does not lock the account blindly (the user might really be traveling); it converts the anomaly into a verification step with the account owner.

Sense-check: This is the textbook trade-off of intrusion detection: an aggressive detector blocks the legitimate traveling user; a passive one lets the intruder through. The message-and-verify approach keeps both risks small.

16.7.3 Technologies Intrusion Detectors Use

Intrusion detectors use a variety of technologies to identify attacks:

  1. Historical data from the organization's network, to understand what is normal. The application must first understand what exactly the normal is — the baseline (Pune location, 5 p.m. report, usual traffic volumes) comes from recorded history.
  2. Libraries containing network traffic patterns observed during various attacks, so the system can understand what an attack can look like — the known-attack signatures that a pattern-matching engine can recognize.

These two knowledge sources are compared against current traffic to make the detection decision.

Scope — how the two technologies interact and where they fail:

  • Historical data is only as good as the history. A new service with a week of traffic has no meaningful baseline; a baseline built during an abnormal period (a launch, a crisis) makes normal behavior look anomalous afterward.
  • Attack libraries cover known attacks. Novel or modified attacks may not match any stored pattern — which is exactly why the baseline-comparison half matters as much as the signature half.
  • Assumption: both techniques produce probabilistic judgments, not proofs. There will be false positives (legitimate travel flagged as intrusion) and false negatives (real intrusions that match the baseline). Tuning the thresholds is part of the job — this goal inherits the false positive / false negative problem from the alarm discussion of Section 16.10.

Visual intuition: Picture a time series of network traffic volume — the x-axis is time of day, the y-axis is packets or requests per minute. The normal band is a gentle curve that breathes with the business day. An intrusion in progress appears as a spike breaking out of the band, or a plateau where there should be a valley, or steady traffic from a location that never contributes to the curve. The detector draws the normal band from historical data, checks the current point against it, and rings the alarm when the point escapes the band — while the attack library cross-checks the shape of the escape against known attack silhouettes. The takeaway: detection is a comparison — current against historical normal, current against known attack patterns.

Pitfalls:

  • Detecting without a baseline. "Current traffic increased" means nothing until "expected traffic" is defined from history — the professor's own order (understand the normal first) is the correct sequence.
  • Locking accounts on first anomaly. The Pune-to-Amsterdam example shows the mature reaction: verify with the account owner instead of nuking the account. Draconian auto-locks produce angry customers and bypassed controls.
  • Ignoring passive intruders. Traffic that is unusual but does no damage yet can be a passive intruder doing traffic analysis — reconnaissance before an active attack. Flagging the increase early is how the fifth goal earns its keep.
  • Relying on signatures alone. A detector with only attack-pattern libraries is blind to new attacks; a detector with only baseline history trips on every legitimate change. The two technologies are complementary, not alternatives.

Recap + bridge: Goal 5 — intrusion detection — watches users and network traffic against two references: role-expected activity (admin's 100 reports at 3 p.m.) and location/behavior baselines (Pune credentials from Amsterdam), using historical data plus attack-pattern libraries, and treating unusual traffic as possible passive intruders on the way to becoming active. With all five goals mapped, the lecture turns from what to monitor to how: the mechanisms of actually monitoring an application — health checks, agents, and the partnership with configuration management.

Real-world & domain connection: This goal is the essence of modern security operations: user and entity behavior analytics flag accounts that deviate from their own baselines, and network intrusion detection systems (IDS) compare live traffic against attack-signature libraries. Banks and payment providers run exactly the Pune-Amsterdam play: logins from unexpected geographies trigger step-up verification or customer messaging rather than hard locks, and authentication platforms add device fingerprints and behavioral scoring. The role-based half maps to privilege monitoring — an admin account suddenly running bulk export jobs at 3 p.m. is a classic exfiltration tell in insider-threat programs.

16.8 How to Monitor an Application

Hook: You know the five goals — now the mechanical question: how does a monitoring system actually reach into an application and pull out its condition? Three mechanisms exist, and each trades away something different: the health check is simple but shallow, the agent sees deep but must be installed, and monitoring without any agent leaves you dependent on what the system already exposes.

Intuition + analogy: The three ways to monitor an application are like the three ways a landlord checks on a rented flat. The first is ringing the doorbell and listening for footsteps — a quick signal that someone is alive in there. The second is hiring a caretaker who lives inside the flat, reads the meters daily, and reports every detail — the most information, at the cost of someone permanently inside. The third is reading the electricity meter from outside through the window — no one needs to be inside, but you only see what the flat chooses to display. The analogy breaks in that software caretakers are invisible, can read data a human caretaker would not understand, and can be installed remotely by automation.

16.8.1 Health Checks and Heartbeats

A health check uses a heartbeat signal: you send a heartbeat signal to a particular service or resource of your application and see the response back — whether it is a bit 1 or bit 0. If it is 1, that means healthy; if 0, unhealthy — or vice versa, depending on your convention.

where:

  • is the health indicator — a single binary bit returned by the heartbeat probe.
  • means the service is healthy (the response came back as expected).
  • means the service is unhealthy (the response was missing or wrong).
  • The convention is a matter of choice — some systems use 0 for healthy and 1 for unhealthy — but the meaning is fixed by definition, not by the wire format, so consistency matters more than which way round the bits go.

The health check is deliberately coarse: one bit answers "is it alive and answering?" — it does not tell you how healthy, which is what the performance metrics of Section 16.4 are for. A spot check of the formula's behavior: send a probe to the Tomcat instance from Section 16.1 — port open and responding means (healthy); no response within the timeout means (unhealthy).

Health checks happen within a timeline: you send the heartbeat signal and in that particular time frame you get the result back. If even the time frame gets delayed, you can see there is a degradation in performance — the heartbeat itself becomes a latency probe. A service that answers every time but answers late is telling you something: it is alive, but it is struggling.

16.8.2 Agent-Less vs Agent-Based

Before choosing a mechanism, recall what monitoring must do as a whole: monitoring is collect the data, store the data in a particular format, and when you want to visualize, the monitoring system should help you visualize the data. Collection, storage, visualization — the agent question is about the collection step.

  • Agent-less means you do not need a particular agent residing inside the application; the monitoring system performs the monitoring without installing any agent inside your software application. The system is observed from outside — through protocols it already exposes (a metrics endpoint, an operating system service, a management protocol). Nothing new is installed; you use what is already there.
  • Agent-based means you need to install an agent into your software system. The system includes the application, the middleware, the OS, and all the hardware resources; the agent is installed on top of all the components of your system. The agent lives inside, reads internal state directly, and ships it to the monitoring system — it sees what external probes cannot.

Q: Will we discuss when to opt for agent-based and when to opt for agent-less? A: Yes — the scenarios for choosing agent-based versus agent-less will be covered in the upcoming session, where we will see exactly when to opt for each. (For orientation: the choice typically turns on what the monitored component already exposes, how much deployment and maintenance effort the organization accepts, and how much internal visibility the goal requires — the details of the decision criteria are the upcoming session's material.)

16.8.3 Monitoring and Configuration Management Work Hand in Hand

Monitoring and configuration management are two halves of one loop. If there is a state change, you want the state to redirect back to the desired state — that is what automation wants to achieve. To do that you need a configuration management tool, and that is where the monitoring tool and the configuration management tool work hand in hand: the monitoring tool detects the departure from the desired state, and the configuration management tool restores it.

A monitoring system provides:

  • Visualization — store monitoring data on different platforms like big data or traditional BI, and visualize it nicely.
  • Intrusion detection support — the stored historical data can be compared with the current data.
  • Business decisions — monitoring data is sometimes used to take business decisions and launch new features that can hit the market.
  • User tracking — capture operation logs and store them.
  • Configuration management support — the configuration management system helps push the system back to the desired state if there is any state change.
  • Alarm evaluation — set threshold values: if CPU utilization hits 80 percent, send alerts; if it increases to 85 percent, send alarms to the operators. Automated alarms and alerts are triggered to the operators and other systems, and this happens with automation supported by the monitoring system.

Broadly, the three main features of a monitoring system are: visualization, triggering alarms and alerts, and storing the monitoring data in a particular format — everything else on the list is a use of these three.

Scope — what each mechanism assumes and where it breaks:

  • The health check assumes the probe reaches the component. A service behind a firewall or inside a container network may answer or refuse probes differently than a user would experience; the heartbeat proves reachability, not health-in-depth.
  • Agent-based monitoring assumes the agent can be installed everywhere. Components you cannot touch (network equipment, third-party closed systems) are invisible to an agent — for those, agent-less protocols like SNMP are the only option.
  • Agent-less monitoring assumes the component exposes what you need. A component that does not publish the metric you want cannot be monitored agent-lessly; the external view is also less secure when the collection repository sits outside your network, because more ports and firewall rules are needed to carry the data out.
  • The configuration-management loop assumes the desired state is defined and reachable. Monitoring can report "state = DOWN" forever, but nothing restores the state unless a configuration management tool has the definition and the permission to enforce it.

Visual intuition: Draw the detect-restore loop as a circle: on the left, the monitoring system probes the application (health check bit , metrics, logs); on the right, the configuration management tool pushes the application back to the desired state; at the bottom, the stored monitoring data feeds visualization dashboards and alarm evaluation; at the top, the alarms reach the operators and other systems. The arrows run one way from the application into monitoring (collect), one way from monitoring to visualization and alarms (present), and one way from configuration management back into the application (restore). The loop only closes when all three arrows exist — the professor's point that the two tools "work hand in hand."

Pitfalls:

  • Using only health checks. One bit per probe tells you "alive," not "well" — the loose-pin partial failures of Section 16.3 sail through a pure heartbeat setup.
  • Installing agents where they are not allowed or needed. Closed network equipment cannot host an agent, and forcing agents onto every component is the deployment-and-maintenance burden that pushes teams toward agent-less collection.
  • Confusing the monitoring system's role with configuration management's role. Monitoring detects and reports; configuration management restores. A monitoring system that detects a state change but has no partner tool to revert it is only half of the automation loop.
  • Forgetting the storage half of the three main features. Visualization with no stored data is a live view with no history; alarms with no stored data produce alarms nobody can diagnose.

Recap + bridge: How to monitor: health checks send a heartbeat and read a single bit (, 1 healthy, 0 unhealthy, convention up to you); collection is agent-based (agent installed inside) or agent-less (no agent inside), with the selection scenarios deferred to the next session; and the monitoring system pairs with configuration management — detect the state change, restore the desired state — built on three main features: visualization, alarms and alerts, and data storage. The next section asks why all of this earns its keep: the benefits of continuous monitoring.

Real-world & domain connection: These mechanisms are exactly what runs in production today: load balancers and orchestration platforms (Kubernetes) fire liveness and readiness probes — the heartbeat bit of this section — at every container, while agents (like CloudWatch agents or APM agents) are installed on servers for deep metrics, and agent-less collection uses protocols such as SNMP for network gear. The monitoring-configuration-management loop is the standard automation pairing: the monitoring tool detects drift or failure, and the configuration management tool (Chef, Puppet, Ansible — met in Section 16.10) converges the system back to the desired state, giving banks and e-commerce platforms self-healing fleets instead of overnight pager duty.

16.9 Why Continuous Monitoring

Hook: A monitoring system's dashboards look great when everything is green — but its real value shows up the day something breaks. What does continuous monitoring actually buy you at that moment? Two things: the ability to know what went wrong, and the ability to decide what to do about it.

Intuition + analogy: Think of continuous monitoring as the flight data recorder of a plane — except the recording never stops, and it is readable live. When a plane has an incident, the recorder lets investigators reconstruct exactly what happened (error diagnosis and root cause analysis). But a monitoring system is better than a recorder: while the problem is still unfolding, the crew can watch the instruments live and choose the reaction — reduce altitude, divert, or abort. The analogy breaks in that a flight recorder is written once and read after a crash, while monitoring data is queried continuously, during and after the incident, by operators, automation, and analysts alike.

16.9.1 Error Diagnosis and Root Cause Analysis

A monitoring system allows operators to drill down into detailed monitoring data and logs. The first benefit is error diagnosis: you can easily diagnose the error and perform root cause analysis using all this data. "Drill down" is the key phrase — the operator starts at the top-level symptom (the alarm on the dashboard) and descends through layers of data: which service failed first, which request was in flight, what the logs say at that exact moment, which resource crossed its threshold. Because the data was stored continuously (recall the record half of the monitoring process), the timeline of the incident is complete — nothing has to be reconstructed from memory, and the postmortem can replay what happened rather than guess at it.

16.9.2 Deciding the Best Reaction

The second benefit is deciding the best reaction to the problem. Do we need to ignore the problem? Do we need to solve the problem? Do we need to give a hot fix, or do we need more time to fix the problem with proper process? All of this is supported by the drill-down into monitoring data.

The reaction decision depends on severity — and severity depends on data:

  • Ignore: the anomaly is below the alarm threshold, or it is a false positive (a legitimate event that looked unusual). Only the data can tell you this is safe.
  • Solve now: the incident is active and customer-impacting — a hot fix or immediate remediation is justified.
  • Fix with proper process: the problem is contained or non-urgent — a root cause analysis, a tested fix, and a normal release cycle.

Scope — what continuous monitoring does not do: It does not make the reaction decision for you — it supports it. The judgment (ignore / solve / hot fix / proper process) is made by operators, and sometimes by escalation procedures where the reaction has business consequences. Monitoring also only supports diagnosis if the data was collected and stored before the incident — a system that starts logging only after the alarm fires has no baseline, no timeline, and therefore no root cause analysis. Assumption: the drill-down data must cover the layers where the failure could live (application, infrastructure, logs); a monitoring setup that stores only one layer diagnoses only that layer.

Visual intuition: Picture the drill-down as a funnel. At the top, one alarm: "CPU utilization above 85 percent." One level down, the service list: the report generation service is the consumer. Next level, the request traces: a batch of requests waiting on a database query. Bottom level, the logs: a slow disk on one node. Each level narrows the suspect set, and the funnel is only as deep as the data that was stored. The takeaway: monitoring data converts a single alarming number into a path from symptom to cause.

Pitfalls:

  • Skipping the drill-down and reacting to the alarm text. "CPU above 85 percent" is a symptom, not a cause; the reaction decision without the drill-down is a guess with a pager attached.
  • Diagnosing from partial data. If the storage step was skipped (no history), the root cause analysis has nothing to replay — the incident becomes anecdote, not evidence.
  • Fixing everything with a hot fix. Not every problem deserves an emergency change; the data may show the problem is contained and better served by a proper process — deciding which is the second benefit in action.
  • Ignoring the ignore decision. Deciding to ignore a threshold breach is a legitimate reaction when the data supports it; ignoring by default, without the drill-down, is negligence.

Recap + bridge: Why continuous monitoring: it enables error diagnosis and root cause analysis through drill-down into stored data, and it supports deciding the best reaction — ignore, solve, hot fix, or fix with proper process. With the why answered, the lecture moves to the operational layer: monitoring operation activities — how configurations, data collection, logs, graphs, and alarms are actually managed.

Real-world & domain connection: This is the post-incident discipline of every serious engineering organization: incident postmortems are built on stored monitoring data, dashboards and logs (the same ELK stack that appears later in this lecture), and the ignore/solve/process distinction is formalized in severity classification systems — Sev 1 (customer impact, fix now) through Sev 3 (fix in a normal release). The Platformer.com case from the reference material is a live example: what looked like an intruder spike turned out to be a customer's opening night — and only application-level data, added to the CPU-level data, could resolve the false alarm and choose the right reaction.

16.10 Monitoring Operation Activities

Hook: A developer opens a ticket from operations: "CPU at 92 percent, customers complaining." The developer has never thought about alarms, alerts, and thresholds — yet the whole troubleshooting session will be guided by them. This section is the operations manual for the monitoring process itself.

Intuition + analogy: Think of the monitoring operation as a building's safety system plus its janitorial schedule. The janitor walks the building each night checking that every room is set up as the floor plan says — lights, locks, settings — and reorders anything that drifted. The safety system is graded: the soft beep is the inform signal (a condition is developing — tell someone, nobody has to run), and the siren is the act signal (a reaction is mandatory now — someone must act). And the record book at the door captures every event so the sequence of an incident can be reconstructed afterward. The analogy breaks in that a real building cannot auto-fix a drifted room, while configuration management tools can — the janitor gets an upgrade in software.

16.10.1 Monitoring Configurations and the Desired State

Operation tools monitor the resources, like your configuration settings, to determine whether they conform to the desired state or desired setting. They also monitor resource specification files to identify if there are any changes. Both types of monitoring are best done by agents that periodically sample the actual values and the files that specify those values — the periodic sampling is what turns "the configuration changed at some point" into "the configuration changed at 03:12, between these two known-good snapshots."

The configuration management tools: Chef, Puppet, and SaltStack are agent-based configuration management tools, whereas Ansible is the agent-less configuration management tool. These tools help find out whether there is a change in the desired state, and if there is, the configuration management tool brings the system back to the correct state — closing the detect-restore loop opened in Section 16.8, now with named tools.

Scope — the agent split in configuration management: The agent-based tools (Chef, Puppet, SaltStack) need a small program installed on every managed machine, which polls the central server and converges local settings; the agent-less tool (Ansible) connects to machines on demand over SSH and applies the desired state without a permanent resident. The choice is the same trade-off as in Section 16.8: agent-based tools see deeper and work offline-friendly, agent-less tools are easier to deploy and maintain but need reachable machines and open channels. Assumption: all of them presuppose the desired state is written down as infrastructure-as-code — a configuration management tool without a declared desired state has nothing to converge to.

16.10.2 Collection and Storing of Data

The core of monitoring is to record and analyze time series data (a sequence of timestamped data points — when the request was seen, what the process ID was for that activity). All of this has to be stored. There are three key challenges in collection and storing of data:

  1. Collecting related items by time — your system may be a distributed system where the components are not consistent; identifying the related services by time becomes difficult. Clocks on different machines drift (microseconds within a cluster, far more across clusters), so deciding that two events are "at the same time" — or even which came first — is problematic.
  2. Collecting related items by context — if there is any parallel process for the same operation, it becomes difficult to reconstruct the sequence of those events. Example: report generation is the operation that has a problem; your monitoring activities generated logs, but there are two parallel report generation activities and only one has the problem. It becomes challenging to reconstruct the sequence of events to diagnose what went wrong — without a request ID tying each log line to its specific report generation, the two parallel sequences are indistinguishable.
  3. Handling the volume of monitoring data — you get a lot of data. Storage systems like big data and Hadoop can help handle the large volume of monitoring data, with retention policies to keep fine-grained recent data and coarser aggregates of older data.

The great solution to all three: change your monitoring configuration over time. Your application is changing very frequently, so you need to change your monitoring configurations as well, in line with the change happening to your code base — finer sampling during risky windows (upgrades, deployments), coarser sampling once things settle, and re-set thresholds when the system's normal changes.

16.10.3 Logs: Sources, Uses, and Best Practices

Logs are generally generated with the help of your software — wherever you write down some information to store it.

Sources of logs: your application, the web servers you use, database systems, all tools and technology used in your application, the DevOps pipeline itself, operational tools, upgrade tools, migration tools, and the configuration management tool. All of these generate logs — every actor in the ecosystem writes a record of what it did.

When do we use these logs?

  • During operation, to detect and diagnose the problem — if an alarm, alert, or any issue got triggered, you have to diagnose from where it was triggered, detect the issue, and resolve it, using the stored logs.
  • During debugging, to detect the errors.
  • During the postmortem / problem forensic, to understand the sequence that led to the particular problem.

The four best practices for writing logs — the professor's standardization rules, applicable to every log-producing component:

  1. Consistent format — even if it is any application or third-party application, you need to inform them what format you are using, and the same format should be used throughout. The same layout, same field order, same timestamp convention everywhere makes logs queryable and comparable.
  2. An explanation for why the log message was produced — if it is a log related to report generation, it should specify that the report generation service triggered this log, with proper naming conventions, so the explanation is understandable. A log line must say what triggered it, not just that something happened.
  3. Context information — such as what is the process ID, what is the request ID, what are the VM IDs being used for this context. Context is what makes the "collecting related items by context" challenge solvable: the request ID is the thread that sews the parallel report generations back into two distinct sequences.
  4. Screening information — whether it is a severity level or an alert level. Severity and alert levels let operators filter the firehose: search first for the ERROR lines, then deepen.

The professor's closing argument for the rules: if we have best practices for writing code and best practices for writing test scripts, why can't we have best practices for writing logs? Logs are code — they deserve the same discipline.

16.10.4 Graphing and Displaying Data

The next operation activity is to graph and display the data with nice visualization. It is useful to visualize all the relevant data collected by the monitoring system.

Real-world & domain connection: this is a great help in the banking domain to understand the stock market — how the stock is getting exchanged, the state change in the stock. Visualization also helps you understand how much capacity is getting used — the utilization of your application. It helps display this information broadly to higher authorities in terms of finalizing the upcoming business offerings. Since you have a great amount of data, why not visualize it in a graphical view and take appropriate decisions? The graph is the decision surface: patterns that are invisible in raw numbers (spikes, trends, saturation plateaus, cyclic variation) become readable at a glance, and an experienced operator reads the shape of a graph the way a doctor reads an ECG.

16.10.5 Alarms and Alerts

The monitoring system should auto-generate alarms and alerts.

Alerts are raised for the purpose of informing — it is just an inform. Alerts are raised in advance of an alarm, and every alarm will have an alert. Alarms require action by the operator or by another system.

Worked example — temperature rising versus fire: The data center temperature is rising — that is an alert: it informs someone that a condition is developing, and no one has to drop everything yet. However, fire in the data center — that becomes an alarm, because a reaction is expected from the operator: you need to call the fire brigade. The same escalation ladder appears at the resource level: alerts and alarms can be triggered by events (a particular physical machine not responding), by values crossing a threshold (the response time for a particular disk is greater than an acceptable value), or by sophisticated combinations of values and trends. The sense-check: ask one question of any notification — "is someone expected to act now?" If yes, it is an alarm; if it is merely being informed, it is an alert.

The threshold pattern — the exam-relevant formula. With the CPU utilization as a percentage:

  • is the CPU utilization, measured as a percentage.
  • At or above 80 percent: an alert is raised — informing the operators that the resource is climbing toward danger.
  • Strictly above 85 percent: an alarm fires — the threshold for required action has been crossed.

The boundary convention is a configuration choice; what matters is the ladder: the alert threshold is set below the alarm threshold so that operators are informed first and ordered to act second. Once the alarm is there, the operator has to deep-dive and look into the problem to minimize the CPU utilization, to bring the value back to normal.

Worked example — sophisticated threshold combinations (the Saturday/Friday rule): Thresholds can combine values and context. Suppose percentage monitoring of a file system is combined with CPU utilization on a peak day.

  • If it is Saturday (the peak day) and CPU utilization is more than 80 percent — trigger the alarm: on the busiest day, the 80 percent line is already the action line, because headroom is scarce.
  • If it is Friday and CPU utilization is 80 percent — just trigger the alert: on an ordinary day, 80 percent is the inform level, not yet the act level.

The sense-check: the same measured value (80 percent CPU) produces different notifications on different days — which is exactly why the lecture says thresholds are set for particular resources and in context, and why the monitoring configuration must be revisited as the application changes.

Q: As a developer or tester, how do alarms and alerts relate to the issues we already know, like tickets? A: Whenever there is an issue, you get a ticket from your internal operation team or from your end customer — that ticket is nothing but the issue for you. Every alarm represents an issue, or you can say every issue triggers an alarm. And when you have this alarm, the alarm will have the alerts. The alarm will convert from the alert itself if the particular resource value or configuration increased based on the threshold value. We use these alerts whenever there is an issue and you find the alarm for that issue: you need the subsequent alerts to diagnose the issue and as guidance for the remediation. The alert helps us understand from where this particular issue was triggered, and then we have a proper sequence of incidents that happened with this particular issue; then you can find out the root cause, get a proper remediation, and say the issue is resolved by doing subsequent actions.

Why the question comes up: infrastructure-background people know these terms well, but developers and testers who never get an opportunity to look at the monitoring part are not aware of what is an alarm, what is an alert, what is an issue, what is a problem. The professor's mental model to carry away: ticket = issue → every issue triggers an alarm → the alarm carries the alerts → the alerts are the diagnostic trail → the trail leads to root cause → remediation → resolution. The developer's familiar ticket is the same object as the operator's alarm — one concept, two vocabularies.

Pitfalls:

  • Using "alert" and "alarm" interchangeably. They are on a ladder, not synonyms: alert = informing (temperature rising), alarm = action required (fire). The professor's rule: every alarm has its alert; alerts come first.
  • Setting the alarm threshold at or below the alert threshold. The ladder collapses — either every alert instantly escalates to an alarm (operator burnout) or the alarm threshold is meaningless. The 80/85 pattern is the healthy separation.
  • Writing logs without context. A log line with no request ID or process ID cannot be tied back to its specific operation — the parallel report generations of the context challenge stay indistinguishable forever.
  • Ignoring the configuration-over-time rule. Thresholds tuned to last month's system fire false alarms after this month's release; monitoring configuration must change with the code base.

Visual intuition: Picture a two-tier threshold line on the CPU utilization graph: a lower dotted line at 80 percent and a higher solid line at 85 percent. As the utilization curve climbs, it first crosses the dotted line — the alert fires, an inform — and if it keeps climbing through the solid line, the alarm fires, and the operator's phone rings. On the Saturday curve, the same 80 percent crossing rings the phone directly because the context rule lowered the action line for the peak day. The takeaway: the graph shows values; the thresholds show intent.

Recap + bridge: Monitoring operation activities: configuration monitoring keeps systems at the desired state (Chef, Puppet, SaltStack agent-based; Ansible agent-less); collection and storage of time series data faces three challenges (by time, by context, by volume); logs follow four best practices (consistent format, explanation, context, screening); graphing turns data into decisions; and alarms versus alerts form the escalation ladder with the ticket = issue = alarm mapping for developers. The next section looks at why all of this gets hard under DevOps: the four challenges of monitoring in a continuous-change world.

Real-world & domain connection: These exact patterns run in every serious operation. Chef, Puppet, and SaltStack converge node configurations and monitor drift, while Ansible pushes the same policies agent-less; time series databases (Prometheus, InfluxDB) and big data stores (Hadoop) absorb monitoring volume; structured logging with request IDs is the industry standard that makes distributed debugging possible; and banking dashboards built on Kibana (the ELK visualization tool of Section 16.12) render stock movements, utilization, and business metrics for decision-makers. The ticket-to-alarm mapping is how ITIL-based ticketing systems and modern incident tools (PagerDuty-style alerting) reconcile with a developer's world: the ticket you fix is the alarm the monitoring system raised, and the alerts are the evidence trail for your root cause analysis.

16.11 Challenges of Monitoring with DevOps

Hook: DevOps's greatest strength — everything changes, constantly — is also its hardest monitoring problem. The same pipeline that deploys a new feature three times a day also invalidates every threshold and baseline your monitoring was tuned against. How do you monitor a system that never stands still?

Intuition + analogy: Think of monitoring under DevOps as a goalkeeper whose goal is being moved while the match plays on. Traditional monitoring is like defending a fixed goal: you learn the normal shots, set your position, and react to deviations. DevOps moves the goal — new servers appear, old ones vanish, services split, traffic patterns change — so the goalkeeper must reposition continuously, ideally with an assistant who moves the goal automatically whenever the pitch changes. The analogy breaks in that a goalkeeper can still save some shots through pure reaction; a monitoring system with stale thresholds fires alarms at everything or nothing — both are useless.

16.11.1 Monitoring Under Continuous Change

The first challenge: monitoring under continuous change. DevOps is nothing but continuous change — continuous integration means even a small change to the code base triggers the whole pipeline and the code resides in the production environment. How can we monitor under continuous change?

The solution: automate the configurations of alarms, alerts, and thresholds as much as possible. The DevOps process is already automated — code is pushed continuously — so why not automate the monitoring process activities that used to happen manually, like configuring alarms and alerts? The monitoring configuration process is just another DevOps process.

Worked example — automatic registration and deregistration: if you provision a new server (capacity planning says the system needs a new server), the part of the job of registering this new server into the monitoring system should happen automatically — no manual work, because this is continuous change. And even when the server is terminated, the deregistration process should happen automatically. Write a script: wherever you see a change in infrastructure, resources, or the application, define what kind of changes should happen in the monitoring system. A manual registration step would go stale the moment the fleet changed — and in a continuous pipeline, the fleet changes constantly.

Second example — learned baselines: the monitoring results during candidate testing for a small set of servers can become the new baseline for the full system, populated automatically. Instead of a human re-reading the dashboards after every release, the system measures a small candidate group, learns the new normal from it, and propagates that baseline to the full fleet — thresholds that keep up with the change instead of fighting it.

16.11.2 Bottom-Up or Top-Down Approach

The second challenge: do we follow the bottom-up approach or the top-down approach in monitoring?

  • Bottom-up: data is collected from all the levels — application component, operating system, physical component (hardware resources), and application resources — but the close observation happens at the physical component, the hardware level. The watchful eyes are at the bottom of the stack.
  • Top-down: data is also collected from all levels, but the close observation of the monitoring system happens towards the application component. The watchful eyes are at the top, at the user-visible layer.
Dimension Bottom-up Top-down
Where close observation happens Physical component / hardware level Application component level
Data collection All levels All levels
Fits which cloud model IaaS (you manage infrastructure) SaaS / PaaS (infrastructure is opaque to you)
Early detection of hardware faults Yes — caught at the source No — surface only when they reach the application
Main risk More to monitor at low levels Hardware faults missed until user impact

When to pick which: With DevOps, everybody is moving to a cloud platform. If it is SaaS or PaaS, you are not aware about the infrastructure and hardware very well. So does it make sense to follow the bottom-up approach? No — because you are not really bothered about the hardware resources; you need to think of a top-down approach. But if you have IaaS — infrastructure as a service — you are dealing with the configurations of the infrastructure as well, so you can think of both bottom-up and top-down.

The professor's warning — the risk of top-down: generally, most of the scenarios, the issue happens at the hardware level and slowly, steadily the problem rises up to the application level. If you are performing bottom-up monitoring, you can easily resolve it before it reaches the application level. But if you are doing top-down monitoring, you have the risk that a failure at the hardware level will not be identified until it reaches the application; then you have to rework and deep-dive into the physical component to find the failure and fix it. The failure that started at the hardware is only felt at the application — by which time users are impacted and the operator must descend the stack to find a cause that has been degrading all along.

Scope — there is no single right answer: There is no hard baseline or hard suggestion that you should do top-down or bottom-up — there is no easy solution. Bottom-up and top-down monitoring have their own benefits and both are important; they should be combined in practice. When it is IaaS, you can have a timeline as well — for example, after 30-40 minutes, observe the application data closely; think of configuration settings that help you opt for both solutions, bottom-up and top-down.

16.11.3 Monitoring a Microservice Architecture

The third challenge: monitoring into a microservice architecture. Microservice means your application itself is decoupled — you have multiple services in your application that are loosely coupled. A request is processed by each and every service of your application. If there is a problem in one particular service, it becomes challenging to identify from where the problem has been triggered in a microservice architecture: the same slow response can be produced by a slow service, a slow dependency, a slow network hop, or a saturated queue anywhere along the chain.

The solution: you can have an intelligent monitoring system. Whatever tools and technology we have in the market, they all support monitoring at the microservice level as well. The modern tooling traces a request through every service it touches, so the operator can follow the path the request actually took — which is the only reliable way to say which of the dozen services was the one that failed.

16.11.4 Dealing with Large Volumes of Data

The fourth challenge: dealing with the large amount of data. We already discussed Hadoop and big data systems for storage. But every time, the full data is not useful — there could be data which is just dumb, just collected. Can we minimize the collection of data?

Yes. The cadence solution — make the collection interval fit the situation:

Worked example — the 10-minute to 30-minute cadence: During an upgrade — you know the upgrade is happening — the data collection during the upgrade can be done with finer grain: the time interval of collecting data will be finer, like collecting every 10 minutes during the upgrade and post-upgrade, during the period where end users are using the application. Once everything gets settled down — after 15 days — you can increase the time frame: instead of every 10 minutes, collect the data after every 30 minutes. You will have a lesser amount of data getting stored.

The arithmetic of the saving: if the system samples every 10 minutes, it stores samples per day; at 30-minute intervals it stores — roughly a third of the volume for the same metric. During the risky window you keep the sharp picture (every 10 minutes); once stable, you keep the coarse picture (every 30 minutes) — and the saved storage and processing cost is real, at scale, across thousands of metrics.

Sense-check: the pattern matches the risk profile: dense sampling when things are changing (upgrade, users hammering the app), sparse sampling when things are settled — the same "change your monitoring configuration over time" principle from Section 16.10, applied to collection cadence.

Visual intuition: Picture the sampling grid as a timeline with tick marks. During the upgrade window, the ticks crowd together (10-minute spacing) — dense data, every blip visible. After 15 days, the ticks spread out (30-minute spacing) — sparse data, trends still visible, blips smoothed over. Two graphs of the same metric: the first jagged and detailed, the second smooth and calm. The takeaway: collection cadence is a knob you turn — dense when the risk is high, sparse when the risk is low.

Pitfalls:

  • Letting thresholds go stale under continuous change. A threshold set for last month's system fires false alarms after this month's release — the automation of alarm and alert configurations is the fix, not an option.
  • Picking one monitoring direction as doctrine. Bottom-up misses nothing at the hardware level but buries you in low-level noise; top-down is clean but late. The professor's answer is combination, not religion — and for SaaS/PaaS, top-down is the only realistic option.
  • Trying to locate a microservice failure without request traces. In a loosely coupled chain, "the response is slow" is a symptom with a dozen suspects; the request's own path through the services is the only reliable map.
  • Storing everything at fine grain forever. The full data is not always useful — there could be data which is just dumb, just collected. Coarsening the cadence after stability is a deliberate, sanctioned way to cut volume.

Recap + bridge: The four DevOps monitoring challenges: continuous change (automate alarm/alert/threshold configurations; auto-register and deregister servers; learn baselines from candidate testing), bottom-up versus top-down (hardware failures rise to the application — bottom-up resolves them early; combine both in practice), microservice architecture (loosely coupled services hide the failing service; intelligent tracing-based monitoring finds it), and large data volumes (finer 10-minute collection during upgrades, 30-minute cadence after 15 days). With the challenges mapped, the lecture arrives at the syllabus finale: the tools — the ELK stack.

Real-world & domain connection: These four challenges are the research agenda of modern monitoring vendors and the daily reality of platform teams. Autoscaling and infrastructure-as-code make automatic server registration standard practice; SaaS/PaaS customers live top-down whether they choose it or not, while IaaS operators combine both; microservice tracing (distributed tracing with request IDs, as championed by tools like Jaeger and Zipkin, and baked into Kubernetes observability) is the accepted answer to the third challenge; and variable collection cadence is how large fleets control their telemetry bill — the exact economics the professor motivates with the 10-minute-to-30-minute example. ELK, the next section's topic, is the storage-and-visualization backbone that most organizations pair with these practices.

16.12 Monitoring Tools and the ELK Architecture

Hook: Every monitoring problem in this lecture ends in the same place: data must be collected, stored, searched, and visualized. The syllabus's final topic — ELK — is the free, open source answer that organizations (especially banks) actually run to do all four.

Intuition + analogy: Think of the ELK stack as a restaurant's kitchen-to-table pipeline. Logstash is the kitchen porter: it takes ingredients from any supplier (logs from any device), cleans and pre-processes them (parses, transforms), and plates them into a consistent format. Elasticsearch is the pantry where everything is stored and indexed — a searchable store where you can find any dish (any log line) in milliseconds. Kibana is the dining room display: charts, graphs, and dashboards that present the stored dishes to the people who decide. The analogy breaks in that a pantry stores food in fixed shelves, while Elasticsearch indexes any data — structured, unstructured, geometric — on the fly, and searches it by content.

16.12.1 The Tooling Landscape

There are a lot of tools and technologies in the market; the diagram of tools and technology in the DevOps environment includes Sensu, Nagios, Amazon CloudWatch (referred to as "Cloud Wars" in the discussion), Logstash, Kibana, and more. Each occupies a different niche: Nagios is a classic alerting-focused monitor with a large plug-in pool; Sensu is its more scalable, cloud-friendly successor; Amazon CloudWatch is the monitoring service that AWS provides inside its own cloud, collecting hundreds of metrics at a fixed interval; and Logstash and Kibana belong to the ELK family that the lecture now focuses on.

The last topic of the syllabus: ELK. ELK is the acronym for three open source tools: Elasticsearch, Logstash, and Kibana. These three different tools are clubbed together into one solid solution, and all are free and open source — which is why they are part of the course handout. The ELK architecture is very commonly used by multiple organizations, and in the banking domain Kibana is most widely used as the visualization tool.

16.12.2 Elasticsearch

Elasticsearch is a search engine: open source, distributed, and it works with a RESTful API. It is a JSON-based key-value pair search engine. With this search engine you can search any type of data — structured, unstructured, geometric — any kind of data can be searched with Elasticsearch. Under the hood it is a NoSQL database that is based on the Lucene search engine — Lucene is the Java search library that provides the inverted-index machinery, and Elasticsearch wraps it in a distributed, RESTful, JSON-friendly layer.

Elasticsearch, the storage-and-search half of ELK:

  • Input: any data you store — logs, metrics, documents, any JSON-formatted content from any source.
  • Capabilities: search across that data (any type), plus aggregation — Elasticsearch aggregation lets you zoom out to explore the trends and patterns in your data: once you search the data, you can explore the trends and patterns by zooming out on a particular aggregation. Search finds the needles; aggregation shows the shape of the haystack.
  • Output: search hits and aggregation results, delivered through the RESTful API to anything that speaks HTTP — including Kibana.

16.12.3 Logstash

Logstash is again open source, a server-side data processing pipeline that collects the data, pre-processes it, transforms it to a particular format, and sends it to the stash — from where you can search the data. It can collect data from any device: routers, web servers, network routers, any device in your application.

Logstash, the collection-and-transformation half of ELK:

  • Input: data from any device: routers, web servers, databases, log files, metrics, Windows events.
  • The three stages — collection, reprocessing, and dispatching:
  1. Collection — pull (or receive) logs and events from all sources.
  2. Reprocessing — clean, parse, and transform the raw data into a consistent, usable format; drop noise and minimize size.
  3. Dispatching — send the transformed data to the stash.
  • Output: transformed data delivered to the stash. In the ELK stack, the stash is Elasticsearch, but the stash can be anything else other than Elasticsearch — the same pipeline can feed other stores.

16.12.4 Kibana

Kibana helps with the visualization of charts and graphs — it visualizes your Elasticsearch data and navigates Elasticsearch. Kibana gives you the freedom to select the way you give shape to your data. Kibana core ships with the classic histograms, line graphs, pie charts, sunburst, and many more ways of visualizing your data.

Kibana, the visualization half of ELK:

  • Input: Elasticsearch data — search results and aggregations, delivered through the RESTful API.
  • Capabilities: choose the shape of your data (histograms, line graphs, pie charts, sunburst, and more); build dashboards that combine several visualizations; navigate and query the underlying Elasticsearch data.
  • Output: interactive dashboards and charts — the decision surface described in Section 16.10.4, now in the tool that banks use most.

16.12.5 The ELK Architecture: How the Pieces Connect

The architecture: Logstash can collect data from any kind of device — wire data, log files, metrics, Windows events — and those are passed and transformed to Elasticsearch. You can even think of shipping data to Elasticsearch without Logstash; Elasticsearch can search all these kinds of data. But to give a proper shape to your data, transform it, pre-process it, and minimize the data size, people use Logstash to transform the data into a particular format and then store it into the stash.

Quick review of the flow: logs — whether from wired data, routers, databases, or any other files — are collected by Logstash, pre-processed, and stored in one particular format into Elasticsearch. By using Elasticsearch you can search for particular data, and that data can be visualized with Kibana. That is how ELK works.

Visual intuition: Picture a three-stage pipeline as a horizontal flow. On the left, a cluster of sources — a web server, a router, a database, an application — each emitting raw log lines of different shapes. The arrows converge into Logstash (a box labeled "collect → reprocess → dispatch"), where the ragged lines are straightened into a single consistent format. From Logstash the clean stream flows into Elasticsearch (a grid of nodes, an index), where it becomes searchable. From Elasticsearch an arrow rises to Kibana, where the same data renders as histograms, line graphs, and dashboards. The takeaway: source → Logstash (shape the data) → Elasticsearch (store and search the data) → Kibana (show the data) — one direction, three responsibilities.

16.12.6 Features and Benefits of ELK

  • Security: protect your Elasticsearch data in a robust and granular way.
  • Automated alerting: get notifications about the changes in your data.
  • Monitoring: maintain a pulse on your Elastic stack — keep it firing on all cylinders — to make sure everything is working in line.
  • Reporting engine: create and share reports of your Kibana charts and dashboards.
  • Graphical visualization: have meaningful relations in your data.
  • Machine learning support: since you store and visualize a lot of data, ELK helps you implement machine learning like automated anomaly detection — bringing intelligence into your system to automatically detect anomalies. Even upcoming business trendy features can be decided from the ELK data.

Real-world: since you store those data and visualize them, a lot of data is available — that helps to implement machine-learning-based automated anomaly detection. The stored history becomes the training ground: the same historical data that supports baseline comparisons for alarms also trains models that detect anomalies the thresholds would miss.

Q: Is Kafka also used for monitoring? A: Yes — Kafka is getting used for monitoring events in many organizations. Kafka was launched as a pre-processing tool — collecting the data and pre-processing it, like the Elasticsearch and Logstash combination discussed today. But nowadays even Kafka supports monitoring: it has launched a few services that are getting used, though not entirely the same services that other monitoring tools provide. So if there is a requirement of basic monitoring — not in-depth monitoring — an organization can simply opt for Kafka to collect and perform the basic monitoring, without a deep dive. It does not support each and every service of a strong monitoring system.

Why this answer makes sense: Kafka (developed at LinkedIn) is a high-performance distributed messaging system built for log aggregation and monitoring data collection — it decouples the incoming data stream from its processing. That makes it a natural collector for monitoring events. The professor's boundary is the takeaway: Kafka is a basic monitoring option — collection-grade, not a full monitoring system; for in-depth monitoring you still need the full-featured stack like ELK.

Scope — where the ELK architecture fits and where it does not:

  • ELK covers the store-search-visualize backbone, not the whole monitoring world: alerting, security, and anomaly detection exist as features on top of the stack, but health probing, agent deployment, and configuration convergence are the jobs of the other tools in the landscape (Nagios, Sensu, CloudWatch, and the configuration management tools of Section 16.10).
  • Logstash is optional in the pipeline — data can go straight to Elasticsearch — but then the transformation, noise reduction, and size minimization it performs must happen elsewhere; the lecture's flow keeps Logstash because shaping the data before storage is what makes the stash usable.
  • Assumption: the free-and-open-source reason for ELK's place in the syllabus — the stack's full feature set (security, reporting, ML) lives in its commercial and open distributions; the architecture-level knowledge is what the course asks for.

Pitfalls:

  • Confusing the three ELK roles in an exam answer. Elasticsearch stores and searches (NoSQL on Lucene, RESTful, JSON, aggregation); Logstash collects, reprocesses, and dispatches; Kibana visualizes (histograms, line graphs, pie charts, sunburst). Mixing the pantry with the porter with the display is the classic slip.
  • Forgetting the direction of the flow. It is always source → Logstash → Elasticsearch → Kibana; data never flows "from Kibana into Elasticsearch" — Kibana only reads what Elasticsearch serves.
  • Assuming Logstash is mandatory. Elasticsearch can index data shipped directly; Logstash's value is the transformation and pre-processing — without it the stash fills with unshaped noise.
  • Overbuying Kafka for in-depth monitoring. Kafka handles basic event monitoring well; it does not support each and every service of a strong monitoring system — the professor's own boundary.

Recap + bridge: The ELK stack — Elasticsearch (open source, distributed, RESTful, JSON-based NoSQL search engine on Lucene, with aggregation), Logstash (server-side pipeline: collection, reprocessing, dispatching), and Kibana (visualization: histograms, line graphs, pie charts, sunburst) — flows logs from any device through Logstash into Elasticsearch and onto Kibana dashboards, with features from security and automated alerting to machine-learning anomaly detection, and Kafka as the basic-monitoring alternative. This closes the syllabus topic; the lecture ends with a knowledge check and a practical walkthrough of git branching.

Real-world & domain connection: ELK (now part of the Elastic stack, including Beats shippers and Elasticsearch's own alerting) is the most common open source log-and-observability pipeline in industry. Banks use Kibana to visualize stock movements, capacity utilization, and transaction patterns — the professor's stated reason Kibana is the most widely used visualization tool in the banking domain. The same pipeline powering infrastructure monitoring also feeds business dashboards for executives deciding upcoming offerings, and its stored data is the raw material for automated anomaly detection — machine learning applied to the very monitoring data this lecture has been describing all along.

16.13 Knowledge Check

16.13.1 Question 1: What Makes DevOps a Successful Methodology?

Q: Which one of the following techniques makes DevOps a successful methodology to develop and deliver software? A: DevOps enables you to organize your teams around your organizational mission. B: DevOps enables you to create your software with built-in quality and monitoring. C: DevOps enables you to quickly identify, fix, and learn from errors. D: All of the above. A: All of the above. Most of the class chose correctly. DevOps succeeds because it combines organizing teams around the organizational mission, building quality and monitoring into the software, and the fast identify-fix-learn loop from errors. None of the three works alone: the mission-focused team supplies the direction, built-in quality and monitoring supplies the safety net (the subject of this whole lecture), and the identify-fix-learn loop supplies the speed — DevOps is the combination, not any single technique.

16.13.2 Question 2: What Does Not Contribute to the Value Stream?

Q: In a DevOps organization, which one of the following elements does not directly contribute to your value stream? A: DevOps team. B: Stakeholders of downstream work centers. C: Errors, incidents, and fixes. D: Clients. A: Errors, incidents, and fixes. The value stream means converting the idea into a working application — the flow of how you will work to implement that idea. The DevOps team contributes, because they are the ones who implement this idea. Stakeholders of downstream work centers contribute, because they have a stake in the application. Clients contribute, because clients are the ones giving you the idea and the requirements — how that idea should work, what the exact requirement of the application is, is collected from the client. But errors, incidents, and fixes happen post-implementation: after the implementation is done, the maintenance part comes into the picture, where you see the errors, incidents, and fixes. So they do not directly contribute to the value stream.

The professor flagged this as the tricky question — "I was sure that there would be a confusion for this." The trap: it seems like clients might not contribute, but clients are the source of requirements, which are directly part of the value stream. The honest confusion point is the opposite direction: errors, incidents, and fixes feel like work (they consume effort), but they happen post-implementation, in maintenance, not in the idea-to-application flow.

Exam note: be careful with the distinction between value-stream activities (which create the application) and post-implementation maintenance activities (errors, incidents, fixes).

16.13.3 Question 3: Which Release Pattern Does Not Enable Low-Risk Deployments?

Q: Which one of the following release patterns does not enable you to do low-risk DevOps code deployments in your production system? A: Canary development pattern, also called the dark launch. B: Blue-green deployment pattern. C: Cluster and human system release pattern (a rolling-upgrade kind of release). D: Big bang code deployments of fully tested and validated releases. A: Big bang code deployments of fully tested and validated releases. The canary (dark launch) and blue-green patterns, and the rolling-upgrade-style cluster pattern, all enable low-risk deployments; big bang deployment is the one that does not enable low-risk DevOps code deployments in production.

The reasoning is structural: canary, blue-green, and rolling releases all keep an escape hatch — a fraction of traffic on the new version while the old version remains available (canary), a full second environment to flip back to (blue-green), or a wave-by-wave upgrade of instances (rolling). Big bang swaps the whole system at once: there is no residual capacity to fall back on, so any defect in the new release is instantly production-wide.

16.13.4 Question 4: What Is Required for Using Jenkins?

Q: What is the requirement for using Jenkins? A: A source code repository which is accessible, for instance a Git repository. B: A working build script, for example a Maven script, checked into the repository. C: Both. D: None of this. A: Both. You need the accessible source code repository (e.g., a Git repository) and a working build script (e.g., a Maven script) checked into the repository.

Jenkins is a CI/CD automation server: it does not hold your code, and it does not write your build — it executes builds against code it can reach. The repository gives Jenkins something to check out; the build script (Maven, Gradle, or any similar tooling) gives Jenkins the exact commands to compile, test, and package. Without the repository, there is nothing to build; without the script, Jenkins does not know how to build it.

16.13.5 Question 5: Which Is Not One of the Three Monitoring Layers?

Q: Within the monitoring framework, data should be collected from three layers. Which one is not one of those three layers? A: Application. B: Business logic. C: Business metrics. D: Operating system. A: Business metrics. The three layers are application, business logic, and operating system; business metrics is the one that is not among them. (The answer was confirmed as the odd one out.)

The three monitoring layers track the runtime stack: the operating system at the base, the application on top of it, and the business logic inside the application that implements the workflows. Business metrics — conversion rates, revenue, user counts — are derived from monitoring data and business data after collection; they are an output of analysis, not a layer to collect from.

Visual intuition (the five-question sweep): think of the knowledge check as a quick review map of the course's spine. Question 1 restates the DevOps mission (teams + quality/monitoring + identify-fix-learn); Question 2 draws the boundary of the value stream (create vs maintain); Question 3 tests the release-risk ladder (canary, blue-green, rolling are low-risk; big bang is not); Question 4 checks the CI/CD prerequisites (repository + build script); Question 5 re-checks the monitoring layers (application, business logic, operating system — not business metrics). The takeaway: each question compresses one core theme of the course into one decision.

Recap + bridge: Knowledge check takeaways: (1) DevOps succeeds through all three — mission-organized teams, built-in quality and monitoring, and the identify-fix-learn loop; (2) errors, incidents, and fixes happen post-implementation and do not directly contribute to the value stream; (3) big bang deployments do not enable low-risk releases, unlike canary, blue-green, and rolling patterns; (4) Jenkins needs both an accessible source repository and a working build script checked in; (5) the three monitoring layers are application, business logic, and operating system — business metrics is the odd one out. The lecture closes with a practical walkthrough: the GitHub branching and release-tagging scenario for the assignment.

16.14 Git Branching and Release Tagging

Hook: A question about the GitHub assignment — "do we really create a production release branch and a working branch and merge them?" — turned into a walkthrough of the branching strategy every team uses: one protected line of releases, many working branches, and a tag that pins every release.

Intuition + analogy: Think of the master branch as the trunk of a tree and the working branches as the limbs growing out of it. All the leaves grow on the limbs (work happens on branches); when a limb is finished it is grafted back onto the trunk (merge); and each release is a permanent mark cut into the trunk where that version lives (tag). Nobody grows leaves directly on the trunk — that would disturb the trunk for everyone. The analogy breaks in that a real trunk is one continuous thing, while git branches are cheap labels — creating a new branch costs nothing, which is why teams make one per feature.

16.14.1 The GitHub Assignment Scenario

A question about an assignment involving GitHub led to a useful walkthrough of a common branching strategy. The goal of that assignment: create branches — one production release branch (the master branch) plus subsequent branches where the team works, then push and merge the completed changes into the master branch.

Q: For the assignment, do we create a production release branch and a separate working branch, then merge the work into the main branch? A: Yes. One branch is your production release branch, which is nothing but your master branch. Then you have subsequent branches where the team is working. Once the work is done, you push those changes to the master branch — that means merging those changes into the master branch. When the code is on the master branch and we say it is in production, that means the code is finalized and it becomes the next version of your application; you want to tag it so that it becomes the baseline for other upcoming changes.

This is the scenario of creating multiple branches and pushing changes to a particular branch — the essence of a git flow with a production/master branch, working branches, merging, and release tagging.

The procedure, step by step:

  • Purpose: keep the production line stable while development proceeds in parallel — nobody works directly on the release line, so the master branch always represents known-good code.
  • Inputs: a repository with a master branch; team members with working branches (feature branches or team branches); completed, committed changes.
  • Steps:
  1. Create the production release branch — this is the master branch; it is the baseline that goes to production.
  2. Create working branches — each team or feature gets its own branch off master, where the actual changes happen.
  3. Work and commit — develop on the working branch, committing locally.
  4. Push and merge — when the work is done, push the changes to the master branch; pushing to master means merging those changes into master.
  5. Finalize — code on master, announced as in production, is the finalized next version of the application.
  6. Tag the release — tag the finalized commit so it becomes the baseline for other upcoming changes: a named, permanent reference to this exact release.
  • Output: a master branch holding the merged production code, plus a tag marking the released version.

Worked example — a two-team release, traced commit by commit:

  1. The repository starts with master at commit M0 — the current production state, tagged v1.0.
  2. Team A creates branch feature/login from M0; Team B creates feature/payment from M0.
  3. Team A commits A1 (login UI) and A2 (login backend) on feature/login. Team B commits B1 (payment form) on feature/payment. Master is untouched — production keeps running on v1.0.
  4. Team A finishes first: git push and merge feature/login into master. Master now points at a commit containing M0 + A1 + A2. Team B's branch is still independent — no conflicts with Team A's work.
  5. Team B merges feature/payment into master. Master now holds all four changes.
  6. The finalized master is verified, announced as production code, and tagged v1.1. From now on, any new working branch starts from v1.1 — the tag is the baseline for upcoming changes.

Sense-check: the trace shows the three professor points in action — master as the single production line, working branches holding parallel work, and the tag turning a commit into a stable baseline. If a bug appears in production, the team can always check out the exact tagged commit v1.1 and compare it against any working branch.

Visual intuition: Picture the commit graph: a straight horizontal line (master) with two branches arcing above it — one branch rejoins the line, then the other. At the point where the first branch rejoins, a small label hangs on the line: v1.1. The graph is the story of the release: the horizontal line is the history that went to production; the arcs are the parallel work; the label is the moment the world's baseline changed.

Pitfalls:

  • Working directly on master. If every team commits straight to the production branch, the release line is never stable — the whole point of the master/working-branch split is that master only changes through merges.
  • Pushing without merging intent. "Push the changes to the master branch" means merging them in — a push that is not a merge (or a merge that is not pushed) leaves the team's work invisible to everyone else.
  • Forgetting the tag. The final step is not cosmetic: without a tag, "production" is a moving commit, and there is no baseline to start the next feature from or to roll back to.
  • Tagging before the code is finalized. Tagging a half-merged state makes the baseline lie; the professor's order is explicit — code finalized and in production, then tag.

Recap + bridge: The GitHub assignment scenario is the essence of git flow: one production release branch (the master branch), subsequent branches where the team works, merging completed work into master, and tagging the finalized production code so the tag becomes the baseline for upcoming changes. This closes the lecture — the full arc from monitoring as a process, through the five goals, the how, the operations, the challenges, and the ELK stack, wrapped up by the knowledge check and the git walkthrough.

Real-world & domain connection: This master/working-branch + tag pattern is the foundation of professional release management: GitHub's release mechanism, trunk-based development with short-lived feature branches, and versioning schemes (semantic versioning tags like v1.1.0) all build on it. In CI/CD pipelines — the practical side of this course — every pipeline stage checks out a tagged commit or a merged branch, and rollbacks pick the previous tag. The Jenkins prerequisites from the knowledge check connect here: the repository and the build script both live in this branch structure, and the release tags are what deployment automation deploys.

Exam Guidance Summary

  • Continuous monitoring mindset: understand proactive vs reactive maintenance — monitoring should catch problems before the end user notices them (the ticket-then-debug workflow is the traditional reactive way). This is the single mindset the whole lecture is built on.
  • Definition questions: monitoring is a process (not a tool or system) to observe and record state changes and data flow; state change via direct measurement or logs; data flow captured by logging request and response data, internal and external. Know the two ways to express a state change and the two kinds of data flow.
  • Five goals of monitoring: failure detection, performance problems, workload categorization/capacity planning, user reaction to business offerings, intrusion detection. Know the data-source table: all goals take application + infrastructure data except user reaction, which is application-only — the one-row exception is a favorite trap.
  • Fundamental items: input, resources (hardware: CPU/memory/disk/network; software: queues, thread pools, configuration specifications), output (transactions, business outcomes). The input → resources → output loop.
  • Failure detection: total vs partial failure (cable pin example — total = no data flow, easy; partial = changing response times, hard), dependency software failure (Tomcat) vs software misconfiguration (JRE 7 → 8), and the three detection ways (external monitoring software health check, in-system special agent, self-detection).
  • Performance metrics: latency (time from initiation to completion, from user request to satisfying the request — ), throughput (operations of a type per unit of time — , the 50 → 45 report generation example), utilization (relative use of a resource — , the 80 percent threshold, degradation at 90-100 percent).
  • Capacity planning: long-term (human involvement, days/weeks/months/years, XYZ paper-distribution example: 400 target vs 600 observed in 15 days → 1,500-user capacity order) vs short-term (automatic, minutes/hours, VM creation/shutdown for cost, Amazon 100 → 50 VMs at night saving 50 percent cost; pay-per-use defined by NIST). The presence or absence of human interaction distinguishes the two.
  • User interaction monitoring: real user monitoring vs synthetic monitoring (script-driven artificial users for capacity testing and UAT). Three observations: request latency, reliability under load, UI modification.
  • Intrusion detection: role-based activity monitoring (admin report 100 times at 3 p.m.), network traffic anomaly detection (Pune vs Amsterdam/Japan — verify rather than lock), historical data + attack-pattern libraries, passive vs active intruders.
  • How to monitor: health checks/heartbeats (bit 1 healthy, 0 unhealthy — or vice versa by convention), agent-based vs agent-less (decision scenarios covered in the upcoming session), monitoring + configuration management working hand in hand; three main features: visualization, alarms/alerts, data storage.
  • Operation activities: configuration conformance to desired state (Chef, Puppet, SaltStack agent-based; Ansible agent-less), time-series collection with the three challenges (by time, by context, volume), logs (sources, uses, the four log-writing best practices: consistent format, explanation, context, screening), graphing/displaying, alarms and alerts (alert = informs, alarm = requires action; 80 percent alert / 85 percent alarm; temperature rise = alert, fire = alarm; issue → ticket → alarm → alerts → diagnosis → remediation).
  • DevOps challenges: continuous change (automate alarm/alert/threshold configs, auto-register/deregister servers), bottom-up vs top-down (hardware failures rise to the application level — bottom-up resolves earlier; combine both), microservices (loosely coupled services — intelligent monitoring system), large data volumes (finer 10-minute collection during upgrades, 30-minute after 15 days).
  • ELK: Elasticsearch (search engine, NoSQL on Lucene, RESTful, JSON key-value, aggregation), Logstash (server-side pipeline: collection, reprocessing, dispatching), Kibana (visualization: histograms, line graphs, pie charts, sunburst), architecture flow (logs → Logstash → pre-process → Elasticsearch → search → Kibana), features (security, automated alerting, monitoring, reporting engine, ML anomaly detection). ELK is on the syllabus at the architecture level.
  • Knowledge check style questions: DevOps success factors (all of the above), value stream (errors/incidents/fixes do not contribute — they are post-implementation), release patterns (big bang does not enable low-risk deployments; canary, blue-green, rolling do), Jenkins requirements (both: Git repo + build script), monitoring layers (business metrics is not one of the three: application, business logic, operating system).
  • Practical/exam logistics: the upcoming quiz follows the tutorial session; quiz 4 syllabus was published on the learning portal. ELK and configuration management are not part of the practical sessions — the practical is CI/CD and deployment, including containerized deployment with Docker and Kubernetes. An ELK getting-started document will be shared for self-study.

Key Industry Applications

  • ELK stack (Elasticsearch, Logstash, Kibana): the most common open source monitoring/logging solution in industry; Kibana is the most widely used visualization tool in the banking domain — banks use its dashboards for stock movements, capacity utilization, and business reporting.
  • Amazon AWS: on-demand infrastructure where hardware monitoring is the cloud provider's responsibility (the total/partial hardware failure burden moves to the data center provider); Amazon CloudWatch as the monitoring service inside the cloud.
  • Amazon e-commerce (India region): short-term capacity planning in practice — shutting down 50 of 100 VMs during 1 a.m.–5 a.m. saves 50 percent of the cost, driven by monitored usage patterns and configuration management activation rules.
  • Configuration management tools: Chef, Puppet, and SaltStack (agent-based) and Ansible (agent-less) keep systems at the desired state, detecting drift and converging configurations.
  • Hadoop / big data: storage platforms for the large volume of monitoring data — the answer to the volume challenge of time series collection.
  • Kafka: also used by many organizations to collect and monitor events — suitable for basic monitoring, though not every service of a strong monitoring system (discussed in closing Q&A).
  • Sensu, Nagios: other monitoring tools in the DevOps tooling landscape — Nagios for its plug-in pool and alerting, Sensu for cloud-scale extensibility.
  • Tomcat, JRE: concrete dependency examples used for software failure scenarios — Tomcat for dependency failure, the JRE 7 → 8 upgrade for misconfiguration.
  • Docker and Kubernetes: upcoming tutorial/practical topic — deploying microservices on a container platform, where the health-check heartbeat bit of this lecture is how orchestration probes containers.
  • Jenkins with Git and Maven: the practical CI/CD combination (source repository + build script checked in) — the two prerequisites the knowledge check tested.

ITD Lecture 16 notes · Continuous Monitoring and the ELK Stack

Introduction to Devops· postgraduate· 2026-08-14

Sections Breakdown

1What Is Monitoring?

Monitoring as a process of observing and recording state changes and data flow, with proactive maintenance replacing reactive ticket-driven work.

2The Goals of Monitoring and What to Monitor

The five goals of monitoring, the data-source table (user reaction is application-only), and the input-resources-output loop of fundamental items to monitor.

3Goal 1: Failure Detection

Total versus partial hardware failures, dependency failure and misconfiguration, and the three ways to detect software failures.

4Goal 2: Performance Degradation

Detecting degradation by comparing current with historical performance, and the latency, throughput, and utilization metrics with worked examples.

5Goal 3: Capacity Planning

Long-term (human) and short-term (automatic) capacity planning with the XYZ startup and Amazon VM shutdown worked examples.

6Goal 4: User Interaction Monitoring

Observing request latency, reliability under load, and UI updates; real user monitoring versus synthetic monitoring.

7Goal 5: Intrusion Detection

Role-based activity monitoring and network traffic anomalies against baselines, using historical data and attack-pattern libraries.

8How to Monitor an Application

Health checks and heartbeat bits, agent-based versus agent-less collection, and monitoring paired with configuration management.

9Why Continuous Monitoring

Error diagnosis and root cause analysis through drill-down, and deciding the best reaction: ignore, solve, hot fix, or proper process.

10Monitoring Operation Activities

Configuration conformance, time series collection challenges, log best practices, graphing, and the alarms-versus-alerts threshold ladder.

11Challenges of Monitoring with DevOps

Continuous change, bottom-up versus top-down, microservice architectures, and large data volumes.

12Monitoring Tools and the ELK Architecture

Elasticsearch, Logstash, and Kibana: roles, the data flow, features, and Kafka as the basic-monitoring alternative.

13Knowledge Check

Five interactive review questions: DevOps success factors, the value stream, release patterns, Jenkins requirements, and the three monitoring layers.

14Git Branching and Release Tagging

The production release branch, working branches, merging into master, and tagging the finalized release as the next baseline.

Postgraduate students of software engineering and delivery

Exam Revision Notes

Below is the distilled, exam-ready core. Every entry comes from the full explanation above. Use this section for rapid review; return to the main notes when a point needs more context.

What Is Monitoring?

Must-know: Monitoring is a process of observing and recording state changes and data flow; a state change is expressed by direct measurement or by logs; data flow is captured by logging requests and responses, both internal and external.

⚠️ Top pitfall: Confusing the monitoring system (the tool) with the monitoring process (the discipline); also recording observations without storing them makes trend detection and postmortems impossible.

Self-check: Name the two things the monitoring process must capture, and the two ways a state change can be expressed.

Connects to: 16.2, 16.12

The Goals of Monitoring and What to Monitor

Must-know: Five goals of monitoring and the data-source table: failure, performance, capacity, and intrusion use application + infrastructure; user reaction to business offerings is application-only because the end user never sees the infrastructure.

⚠️ Top pitfall: Assuming one data source serves every goal, or forgetting that user reaction is the application-only exception.

Self-check: Which monitoring goal draws data from the application only, and why?

Connects to: 16.1, 16.3, 16.4

Goal 1: Failure Detection

Must-know: Total failure is easy to detect (no data flow); partial failure manifests as performance problems. Software failures have two causes: dependency failure (Tomcat down) and misconfiguration (JRE 7 upgraded to 8). Three detection ways: external monitoring health check, in-system special agent, self-detection.

⚠️ Top pitfall: Treating 'it still responds' as 'it is healthy' — the loose-pin partial failure answers its probes; you need response-time and configuration checks, not just reachability.

Self-check: Why is a loosely fitted cable pin harder to detect than a fully disconnected one, and which monitoring signature does it produce?

Connects to: 16.4, 16.8

Goal 2: Performance Degradation

Must-know: Latency L = t_end - t_start (time from activity initiation to completion); throughput T = N_ops / Delta t (operations of a type per unit time); utilization U = (r_used / r_total) x 100%. The 50-to-45 report generation drop and the CPU threshold crossing 80 to 90-100 percent both signal degradation; monitoring should catch degradation before users notice.

⚠️ Top pitfall: Declaring degradation from one metric alone: throughput can drop because demand dropped, and utilization can spike for legitimate batch work; read the trio together and pair throughput with user counts.

Self-check: CPU utilization rose from 80 to 90 percent on a 100-core machine: compute U and state the degradation conclusion.

Connects to: 16.3, 16.5, 16.10

Goal 3: Capacity Planning

Must-know: Long-term capacity planning: human involvement, days/weeks/months/years, XYZ example (400 target, 600 observed in 15 days, capacity raised to 1,500 users). Short-term: automatic, minutes/hours, VM creation/shutdown for cost, Amazon example (100 VMs reduced to 50 at night saves 50 percent cost); pay-per-use is a NIST-defined essential cloud characteristic.

⚠️ Top pitfall: Confusing the two planning modes: long-term needs human involvement, short-term is fully automatic; also, automatic rules that optimize cost while customers wait are business failures.

Self-check: A monitoring system sees low traffic 1 a.m.-5 a.m. and shuts down 50 of 100 VMs. Which planning mode is this, and what cost saving results?

Connects to: 16.4, 16.8, 16.10

Goal 4: User Interaction Monitoring

Must-know: The three observations of user interaction monitoring: latency of user requests, reliability under increasing users, and UI modification (does the pane update). Two modes: real user monitoring (real end-user traffic, passive) and synthetic monitoring (scripts creating artificial users, used for capacity testing and UAT).

⚠️ Top pitfall: Testing only with synthetic traffic — scripts exercise the happy path, while real user monitoring is the only way to see what real users actually experience.

Self-check: Which monitoring mode is used for user acceptance testing, and who generates the traffic in it?

Connects to: 16.4, 16.7

Goal 5: Intrusion Detection

Must-know: Role-based activity monitoring flags activity not in line with the user's role (admin's 100 report generations at 3 p.m. vs usual one at 5 p.m.); network traffic monitoring flags abnormalities such as Pune credentials accessed from Amsterdam or Japan, reacting by messaging the customer to verify; detectors use historical data (what is normal) plus libraries of attack traffic patterns; unusual increased traffic may indicate passive intruders about to become active.

⚠️ Top pitfall: Detecting without a baseline — 'current traffic increased' means nothing until the expected normal is defined from historical data.

Self-check: A user always logs in from Pune and the system sees a login from Japan. What should the intelligence system do instead of locking the account outright?

Connects to: 16.6, 16.10

How to Monitor an Application

Must-know: Health check: heartbeat signal, response bit h in {0,1}, h=1 healthy, h=0 unhealthy (or vice versa by convention); delay in the time frame signals degradation. Agent-based requires an agent installed in the system; agent-less requires none. Monitoring and configuration management work hand in hand to restore the desired state; the three main monitoring features are visualization, triggering alarms and alerts, and storing data.

⚠️ Top pitfall: Using only health checks: one bit proves the component is alive, not well — partial failures pass pure heartbeat setups.

Self-check: A heartbeat probe returns a bit after twice its normal time frame. What does the delay itself indicate?

Connects to: 16.1, 16.3, 16.10

Why Continuous Monitoring

Must-know: The two benefits of continuous monitoring: (1) error diagnosis and root cause analysis by drilling down into monitoring data and logs; (2) deciding the best reaction — ignore, solve, hot fix, or fix with proper process — supported by the drill-down.

⚠️ Top pitfall: Diagnosing from partial data: if monitoring data was not stored before the incident, root cause analysis has nothing to replay.

Self-check: An alarm fires for CPU above 85 percent. Name the four candidate reactions an operator can choose from, and what supports the choice.

Connects to: 16.1, 16.10

Monitoring Operation Activities

Must-know: Alerts inform (temperature rising), alarms require action (fire). Threshold ladder: u >= 80 percent alert, u > 85 percent alarm. Every alarm has an alert; the alert escalates to an alarm when the threshold is crossed. Ticket = issue; every issue triggers an alarm; alerts provide the diagnostic trail to root cause, remediation, and resolution. Chef/Puppet/SaltStack are agent-based configuration management tools; Ansible is agent-less.

⚠️ Top pitfall: Using alert and alarm interchangeably: alerts are raised for informing in advance, alarms require action by the operator or another system.

Self-check: The data center temperature is rising, and later a fire breaks out. Which is the alert, which is the alarm, and what distinguishes them?

Connects to: 16.4, 16.8, 16.11

Challenges of Monitoring with DevOps

Must-know: Four challenges: (1) continuous change — automate alarm/alert/threshold configuration, auto-register/deregister servers, candidate-testing baselines; (2) bottom-up vs top-down — bottom-up watches the hardware level and resolves hardware-rooted failures early, top-down watches the application and risks missing hardware failures until they reach the application; combine both in practice; (3) microservices — hard to locate the failing service, intelligent monitoring helps; (4) data volume — collect every 10 minutes during upgrades, every 30 minutes after 15 days.

⚠️ Top pitfall: Picking one monitoring direction as doctrine: bottom-up buries you in low-level noise, top-down misses hardware failures until they reach the application; the professor's answer is to combine both.

Self-check: A failure originates in hardware. Which monitoring approach detects it earliest, and what is the risk of the alternative?

Connects to: 16.10, 16.12

Monitoring Tools and the ELK Architecture

Must-know: ELK = Elasticsearch (search engine, NoSQL on Lucene, RESTful, JSON key-value, aggregation to explore trends), Logstash (server-side pipeline: collection, reprocessing, dispatching; stash can be anything), Kibana (visualization: histograms, line graphs, pie charts, sunburst). Flow: logs from any device → Logstash pre-processes → Elasticsearch stores and searches → Kibana visualizes. Kafka suits basic monitoring of events but does not support every service of a strong monitoring system.

⚠️ Top pitfall: Confusing the three ELK roles: Elasticsearch stores and searches, Logstash collects-reprocesses-dispatches, Kibana visualizes; the flow direction is always source → Logstash → Elasticsearch → Kibana.

Self-check: A log line from a web server must be stored and searched. Name the ELK component that transforms it and the component that stores it.

Connects to: 16.1, 16.10

Knowledge Check

Must-know: Value stream = converting the idea into a working application; errors, incidents, and fixes are post-implementation maintenance and do not directly contribute. Low-risk release patterns: canary (dark launch), blue-green, rolling upgrade; big bang is not low-risk. Jenkins needs a source repository plus a checked-in build script. Monitoring layers: application, business logic, operating system (not business metrics).

⚠️ Top pitfall: On the value stream question, clients seem like the odd one out but they are the source of requirements; errors, incidents, and fixes feel like work but happen post-implementation.

Self-check: Which of the three monitoring layers is missing from this list: application, business logic, business metrics, operating system?

Connects to: 16.1, 16.14

Git Branching and Release Tagging

Must-know: The production release branch is the master branch; teams work on subsequent branches and merge completed changes into master; code on master that is finalized and in production becomes the next version and must be tagged so the tag is the baseline for upcoming changes.

⚠️ Top pitfall: Forgetting the tag: without tagging, production is a moving commit and there is no baseline for the next feature or rollback.

Self-check: In the assignment scenario, what does it mean to 'push the changes to the master branch', and what must happen once the code is finalized in production?

Connects to: 16.13

Was this lecture useful?

Loading comments…
🤖

BitsNotes AI Assistant

Subject Notes Assistant

Configure AI Chat

Choose how to access the chatbot
Have your own API key?

Switch to "Bring Your Own Key" tab above for unlimited access with any OpenAI-compatible provider.

🔑 Enter API key above to fetch live models from provider, or enter model name manually.
OpenAI-Compatible API Support

Choose any provider preset (Gemini, DeepSeek, Kimi, GLM, MiniMax, Qwen, OpenAI, Groq, Ollama, etc.) or enter a custom endpoint URL.

Security & Privacy First

Your API key is sent directly from your browser to your specified provider. BitsNotes servers never store or see your key.