Cloud Resource Monitoring and Cost Optimization

Chapter 1
Foundations of Cloud Monitoring and Cost Management

Diploma in Cloud Computing
Cloud Resource Monitoring and Cost Optimization   •   Diploma

Foundations of Cloud Monitoring and Cost Management

Introduction

Cloud computing changes the way organisations acquire, operate, and pay for information technology. Instead of purchasing fixed quantities of servers, storage, and network equipment, an organisation can obtain computing capabilities from a provider through programmable interfaces and usage-based commercial models. This flexibility creates significant benefits, but it also creates management responsibilities. Resources can be created in minutes, replicated across regions, scaled automatically, and forgotten after their business purpose has ended. Consequently, technical performance and financial control must be managed together.

Cloud monitoring is the systematic collection, analysis, and interpretation of information about cloud resources, applications, users, and services. Cost management is the discipline of understanding, controlling, forecasting, and optimising expenditure while preserving required business outcomes. These disciplines are closely related: excessive resource consumption increases cost, while inadequate capacity may reduce performance and availability. Effective cloud professionals therefore treat monitoring and cost optimisation as continuous operational activities rather than occasional administrative tasks.

Learning Objectives

After studying this chapter, you should be able to:

  • distinguish cloud service and deployment models;
  • explain the shared responsibility model;
  • describe elasticity, scalability, availability, performance, and resilience;
  • analyse the lifecycle of a cloud resource;
  • use common monitoring and financial terminology accurately;
  • explain major cloud pricing principles;
  • relate usage, performance, availability, and cost;
  • identify practical governance and optimisation actions.

Cloud Computing Service Models

A service model describes the level of abstraction delivered by a cloud provider and the responsibilities retained by the customer.

ModelProvider commonly managesCustomer commonly managesTypical use
Infrastructure as a Service (IaaS)Physical facilities, hardware, and virtualisationOperating system, applications, data, and much configurationVirtual machines and custom networks
Platform as a Service (PaaS)Infrastructure, operating system, runtime, and often scaling mechanismsApplication code, data, and application configurationManaged application platforms
Software as a Service (SaaS)Application, platform, infrastructure, and service operationUsers, data, access settings, and appropriate configurationEmail, collaboration, and business applications
Functions as a Service (FaaS)Servers, runtime, and execution infrastructureFunction code, triggers, permissions, and dataEvent-driven processing

These boundaries are not absolute. A managed database, for example, removes much of the operating-system responsibility but does not remove responsibility for data classification, access control, backup requirements, or query efficiency. The practical question is not merely “Who operates the server?” but “Which party is accountable for each control and outcome?”

Cloud Deployment Models

A deployment model describes where cloud capabilities are hosted and who may use them.

  • Public cloud: Infrastructure is operated by a provider and made available to multiple customers through logically isolated accounts or tenants. It offers broad elasticity and a large catalogue of services.
  • Private cloud: Cloud technologies are dedicated to one organisation. It may be operated internally or by a third party and is often selected for control, regulatory, or specialised operational requirements.
  • Hybrid cloud: Public and private environments are integrated so that workloads, data, or management processes can operate across both.
  • Community cloud: Infrastructure is shared by organisations with common requirements, such as a regulatory or mission-oriented community.
  • Multi-cloud: An organisation uses services from two or more public cloud providers. Multi-cloud may improve supplier resilience or provide access to specialised capabilities, but it also increases operational and financial complexity.

Deployment models should be selected according to workload characteristics, data sensitivity, compliance obligations, latency, skills, and total cost—not according to fashion.

The Shared Responsibility Model

Cloud security and operations are shared between the provider and customer. The provider is generally responsible for security of the cloud: facilities, physical hardware, core networking, and the managed service infrastructure. The customer is generally responsible for security in the cloud: identities, data, permissions, configurations, and workloads. The exact division varies by service model.

For an IaaS virtual machine, the customer normally patches the guest operating system and configures host-based controls. For a SaaS product, the provider operates the application platform, but the customer still controls user accounts, permissions, data retention, and acceptable use. Misconfigured storage, excessive privileges, and unmonitored credentials remain customer risks even when the underlying service is highly managed.

Shared responsibility also has a financial dimension. The provider supplies pricing information, billing records, quotas, and service controls; the customer must select appropriate services, set budgets, apply tags, remove obsolete resources, and investigate abnormal consumption. A provider cannot determine whether a running development server still has business value.

Elasticity, Scalability, Availability, and Performance

These terms are related but not interchangeable.

Scalability is the ability of a system to accommodate increased or decreased demand by adding or removing capacity. Vertical scaling changes the size of a resource, such as increasing memory on a virtual machine. Horizontal scaling adds or removes resource instances, such as application servers.

Elasticity is the ability to adjust capacity dynamically, often automatically, as demand changes. A system may be scalable but not elastic if changes require manual intervention. Elasticity is valuable because it can align capacity with workload demand, although poor scaling rules can cause instability or unexpected cost.

Availability is the proportion of time a service is usable according to an agreed definition. A simple availability estimate is:

Availability = (Agreed service time − Unavailable time) ÷ Agreed service time × 100%

The time quantities must use the same unit, such as minutes per month. This formula assumes that service availability is measured consistently and that exclusions in the service-level agreement (SLA) are applied correctly. For example, if agreed service time is 43,200 minutes and unavailable time is 43.2 minutes, availability is 99.9%.

Performance concerns how effectively a system responds. Important measures include latency, throughput, error rate, queue depth, and resource utilisation. A service can be available but slow; it can also be fast for a small number of users but unavailable under peak load.

Resilience is the ability to withstand and recover from faults. Redundancy, backups, failover, geographic distribution, and tested recovery procedures contribute to resilience. Resilience controls may increase cost, but the appropriate comparison is between their cost and the business impact of failure.

Monitoring should examine these properties together. High CPU utilisation may indicate efficient use, insufficient capacity, or an application defect. Low utilisation may indicate over-provisioning, but it may also represent deliberately reserved capacity for sudden demand or failover.

Resource Lifecycles and Operational States

A cloud resource has a lifecycle that should be visible to both technical and financial controls.

  1. Request: A business or technical need is identified, with an owner, purpose, environment, and expected duration.
  2. Design and approval: Architecture, security, compliance, budget, and capacity requirements are reviewed.
  3. Provisioning: The resource is created through a console, template, infrastructure-as-code pipeline, or managed service interface.
  4. Configuration: Networking, identity, monitoring, backup, encryption, and tags are applied.
  5. Operation: Usage, health, performance, incidents, and cost are observed.
  6. Change or scale: Capacity, software, topology, or configuration is modified as demand and risk change.
  7. Suspension or retirement: The resource is stopped, archived, deleted, or transferred when its purpose ends.
  8. Verification: Logs, data retention, billing, and dependencies are checked to ensure that retirement is complete.

Common operational states include running, stopped, suspended, failed, degraded, scheduled, and terminated. Stopping a resource does not always eliminate all charges. Persistent disks, reserved public addresses, snapshots, licenses, load balancers, and retained backups may continue to incur costs. Lifecycle automation must therefore address dependent resources, not only the primary compute instance.

Useful lifecycle metadata includes owner, department, application, environment, data classification, creation date, expiry date, cost centre, and recovery priority. Tags or labels are not a substitute for governance, but without them cost allocation and ownership investigations become difficult.

Monitoring Terminology and Measurement

A metric is a numerical observation recorded over time, such as CPU percentage or request latency. A log is a timestamped record of an event or message. A trace follows a request through multiple services and helps identify where time or errors arise. Telemetry is the collective term for metrics, logs, traces, and related operational data.

A dashboard presents selected measurements for human interpretation. An alert is a notification generated when a condition or pattern requires attention. A threshold is a fixed boundary, while anomaly detection identifies behaviour that deviates from an expected baseline. A Service Level Indicator (SLI) measures an aspect of service performance, such as successful requests. A Service Level Objective (SLO) states the target, such as 99.9% successful availability. An SLA is a formal agreement that may include commitments, exclusions, and remedies.

Monitoring should be designed around decisions. A dashboard with hundreds of unused charts is less valuable than a small set of reliable indicators linked to runbooks. Each alert should have an owner, severity, response expectation, and action. Excessive alerts create fatigue; insufficient alerts delay detection.

For a measured interval, a basic utilisation ratio can be expressed as:

Utilisation = Actual resource use ÷ Available resource capacity × 100%

Both quantities must describe the same resource and interval. Utilisation is not automatically a target to maximise. A database operating at 95% storage capacity may be efficient today but operationally risky because little growth or recovery space remains.

Principles of Cloud Pricing

Cloud prices differ by provider and service, but several principles recur.

Consumption-based pricing charges according to measured use, such as virtual-machine hours, requests, gigabytes stored, or data transferred. It supports experimentation and elasticity but can produce unpredictable bills.

Provisioned-capacity pricing charges for allocated capacity, whether or not it is fully used. It can provide predictable performance but creates waste when capacity is oversized.

Subscription or commitment pricing provides a discount in exchange for a time commitment or spending commitment. It may be economical for stable workloads but creates risk if demand, architecture, or provider changes.

Tiered pricing changes the unit price at usage bands. The billing method may be marginal—each band has its own rate—or volume-based, where reaching a tier changes the rate applied to all usage. The provider’s billing documentation must be consulted rather than assuming one method.

Other price components include data storage, operations or requests, data transfer, licence fees, support plans, regional differences, taxes, reserved capacity, and minimum charges. Free tiers and credits may be limited by duration, region, account, or service and should not be treated as permanent economics.

A simple cost model for a period is:

Total cost = Σ (Quantityᵢ × Unit priceᵢ) + Fixed charges − Credits

Here, i identifies each billable component; quantity and unit price must use compatible units; fixed charges include items such as support or reserved commitments; and credits include applicable discounts. Taxes may need to be added separately depending on the billing context. This is a model for estimation, not a replacement for the provider invoice.

For example, 3 virtual machines used for 10 hours at $0.20 per machine-hour cost:

3 × 10 × $0.20 = $6.00

If storage and transfer are also billed, they must be added as separate components. The example assumes no discounts, taxes, minimums, or additional charges.

The Relationship Among Usage, Performance, Availability, and Cost

Cloud management involves trade-offs rather than a single optimisation target. Increasing capacity may reduce latency and improve availability, but it usually increases cost. Reducing capacity may lower cost, but may increase queueing, errors, or outage risk. The objective is to achieve required business outcomes at an economically justified level of expenditure.

A useful analysis asks four questions:

  1. What was consumed? Compute time, storage, requests, network transfer, licences, and managed-service units.
  2. What outcome was produced? Successful transactions, response time, availability, completed jobs, or user satisfaction.
  3. What risk was accepted? Failure probability, recovery time, data loss exposure, or performance degradation.
  4. Who owns the decision? A technical team may control configuration, while a product or finance team determines business value and budget.

Cost per business unit can be more informative than total cost. For example:

Cost per transaction = Total service cost ÷ Number of successful transactions

The denominator must represent the same period and service boundary as the numerator. Failed or duplicate transactions should be treated consistently. A lower cost per transaction is not automatically better if it results from degraded security, unacceptable latency, or loss of availability.

Cost Management Framework

A practical cost-management cycle contains five connected activities:

  • Visibility: Collect billing data, usage measurements, tags, account structures, and ownership information.
  • Allocation: Assign expenditure to departments, products, environments, or customers using accounts, tags, chargeback, or showback.
  • Control: Apply budgets, quotas, approval workflows, policy rules, and alerts.
  • Optimisation: Remove waste, right-size resources, select appropriate pricing commitments, improve architecture, and automate schedules.
  • Forecasting: Use historical trends, planned projects, seasonality, and commitment changes to estimate future expenditure.

Showback reports costs to a responsible group without directly charging its budget. Chargeback transfers costs to that group. Both require reliable allocation rules. Shared services, untagged resources, and changing ownership are common sources of disagreement.

The FinOps discipline extends this cycle by bringing engineering, finance, procurement, and business teams into joint decisions. Its central principle is accountability for the value generated by cloud consumption, not merely reduction of the invoice.

Illustrative Case: An Online Learning Platform

Background. A fictional online learning provider hosts video lessons, examinations, and student records in a public cloud. Its monthly bill has increased by 42% in six months, while students report slow access during evening examinations.

Problem. A preliminary review finds that development virtual machines run continuously, storage contains multiple unclassified copies of videos, and the production database reaches high CPU utilisation during examination periods. The organisation initially proposes a blanket 20% reduction in capacity.

Analysis. Monitoring shows that development machines are used mainly from 08:00 to 18:00 on weekdays. They can be scheduled outside those hours. Video delivery generates substantial outbound data transfer, but compressing frequently accessed content would affect quality unless tested. Database latency rises when CPU exceeds approximately 80%, so indiscriminate downsizing would create unacceptable performance risk. Cost data also lacks environment and owner tags.

Approach. The team first establishes tagging standards and separates production, test, and development accounts. Development machines are automatically stopped outside working hours, while persistent disks are reviewed separately. Old video copies are classified under a retention policy and deleted only after academic owners approve. The database is monitored with latency, error rate, CPU, and transaction throughput; it is scaled for examination peaks and reviewed for query optimisation. A budget alert is configured at 80% of the monthly forecast, with a human approval process for exceptional growth.

Outcome. The organisation reduces non-production compute waste without changing production capacity. It improves cost attribution and identifies storage-retention decisions as governance issues rather than purely technical clean-up. Most importantly, the team avoids a dangerous capacity cut and links expenditure to student-facing performance.

Learning points. Optimisation should begin with measurement and ownership. Stopping compute does not necessarily stop all charges. Data deletion requires authorisation and retention controls. Cost reduction must be evaluated alongside availability, latency, security, and educational service quality.

Governance, Ethics, and Contemporary Practice

Cloud monitoring may collect user identifiers, IP addresses, application content, and behavioural information. Organisations should apply data minimisation, access controls, retention limits, encryption, and appropriate privacy notices. Logs should not expose credentials, payment data, or unnecessary personal information. Monitoring access must itself be audited because operational data can reveal sensitive business activity.

Governance should define budget authority, resource ownership, approved regions, data residency requirements, retention rules, and emergency procedures. Regulatory obligations may affect where data is stored, how long logs are retained, and who may access them. Automated deletion and scaling require safeguards, testing, and exception handling.

Contemporary cloud operations increasingly use machine learning to detect anomalies, forecast demand, recommend rightsizing, and identify unusual spending. Such recommendations are probabilistic and should be validated against workload context. An AI system may interpret a predictable seasonal peak as waste or recommend removal of capacity reserved for disaster recovery. Human accountability, explainability, and change approval remain necessary.

Best practice is to establish monitoring and cost controls during design, use infrastructure as code, apply least privilege, standardise tags, review idle resources, test scaling policies, and conduct regular architecture and financial reviews. Optimisation is a continuous feedback loop, not a one-time clean-up campaign.

Chapter Summary

Cloud computing provides services through varying responsibility boundaries, from IaaS to SaaS and event-driven platforms. Deployment models include public, private, hybrid, community, and multi-cloud environments. The shared responsibility model assigns physical and service infrastructure duties to the provider while leaving customers accountable for data, identity, configuration, workload operation, and appropriate consumption.

Scalability concerns the ability to increase capacity; elasticity concerns dynamic adjustment; availability concerns usable service time; performance concerns responsiveness and throughput; and resilience concerns resistance to and recovery from failure. Cloud resources pass through request, provisioning, operation, change, and retirement stages, and each stage has technical and financial consequences.

Monitoring uses metrics, logs, traces, dashboards, alerts, SLIs, SLOs, and SLAs to support decisions. Cloud pricing may be consumption-based, provisioned, subscription-based, committed, or tiered. Total cost depends on quantities, unit prices, fixed charges, discounts, and billing conditions. Effective cost management combines visibility, allocation, control, optimisation, and forecasting. The best decision balances cost with availability, performance, security, resilience, compliance, and business value.

Key Terms

Cloud monitoring: Systematic observation and analysis of cloud resources, services, and workloads.

Cost management: Planning, measuring, controlling, and optimising technology expenditure.

IaaS: A service model providing configurable infrastructure such as virtual machines and networks.

PaaS: A managed platform for deploying applications without managing most underlying infrastructure.

SaaS: A complete software application delivered and operated by a provider.

Public cloud: Provider-operated infrastructure shared by multiple customers through logical isolation.

Private cloud: Cloud infrastructure dedicated to one organisation.

Hybrid cloud: An integrated combination of private and public cloud environments.

Shared responsibility: Allocation of security and operational duties between provider and customer.

Scalability: Ability to accommodate changing demand by changing capacity.

Elasticity: Ability to adjust capacity dynamically in response to demand.

Availability: Proportion of agreed service time during which a service is usable.

Performance: Measured behaviour such as latency, throughput, and error rate.

Resilience: Ability to withstand faults and recover from disruption.

Metric: Numerical measurement recorded over time.

Log: Timestamped record of an event or message.

Trace: Record of a request’s path through distributed components.

SLO: Target level for a measured service objective.

Showback: Reporting costs to a responsible group without direct budget transfer.

Chargeback: Assigning costs directly to a responsible group or budget.

Review Questions

Short Answer Questions

  1. What is the principal difference between scalability and elasticity?
  2. Name two responsibilities that normally remain with a SaaS customer.
  3. Why may stopping a virtual machine fail to eliminate all charges?
  4. Define a Service Level Indicator.
  5. What is the purpose of resource tagging?

Long Answer Questions

  1. Compare IaaS, PaaS, SaaS, and FaaS in terms of responsibility and appropriate use.
  2. Explain the shared responsibility model and discuss why it applies to cost as well as security.
  3. Describe the lifecycle of a cloud resource and identify controls appropriate at each stage.
  4. Explain how monitoring supports both performance management and cost optimisation.
  5. Discuss the advantages and limitations of consumption-based and commitment-based pricing.

Analytical / Application Questions

  1. A company wants to reduce cloud expenditure by shutting down all servers every evening. Analyse the technical, financial, and availability risks and propose a safer decision process.
  2. A service has 99.9% availability but unacceptable response times during peak demand. Explain how this is possible and identify measurements that should be investigated.
  3. Design a governance approach for allocating shared cloud costs among development, testing, and production teams. Include metadata, reporting, ownership, and exception controls.

Multiple Choice Questions with Answers

Question 1

Which cloud service model generally leaves the customer responsible for the guest operating system?

A. Infrastructure as a Service (IaaS)

B. Software as a Service (SaaS)

C. Platform as a Service (PaaS)

D. Community cloud

Correct Answer: A. Infrastructure as a Service (IaaS)

Question 2

What best describes elasticity?

A. Using only private infrastructure

B. Dynamically adjusting capacity as demand changes

C. Guaranteeing zero service failures

D. Encrypting all stored data

Correct Answer: B. Dynamically adjusting capacity as demand changes

Question 3

A service has 43,200 agreed minutes and 43.2 unavailable minutes. What is its availability?

A. 98.0%

B. 99.0%

C. 99.9%

D. 99.99%

Correct Answer: C. 99.9%

Question 4

Which item is normally a customer responsibility in the shared responsibility model?

A. Physical security of the provider’s data centre

B. Manufacture of provider hardware

C. Power supply for the provider’s facility

D. Configuration of customer identities and permissions

Correct Answer: D. Configuration of customer identities and permissions

Question 5

Which measurement most directly represents application responsiveness?

A. Latency

B. Storage capacity

C. Number of tags

D. Monthly commitment term

Correct Answer: A. Latency

Question 6

Three virtual machines run for 10 hours at $0.20 per machine-hour. Ignoring other charges, what is the cost?

A. $0.60

B. $2.00

C. $6.00

D. $60.00

Correct Answer: C. $6.00

Question 7

What is showback?

A. Deleting all unused resources automatically

B. Reporting costs to a responsible group without directly charging its budget

C. Encrypting billing records

D. Buying a long-term capacity commitment

Correct Answer: B. Reporting costs to a responsible group without directly charging its budget

Question 8

Why is a blanket reduction in resource capacity potentially dangerous?

A. It always increases storage costs

B. It may reduce performance or availability during demand peaks

C. It prevents all tagging

D. It converts IaaS into SaaS

Correct Answer: B. It may reduce performance or availability during demand peaks

Question 9

Which telemetry type follows a request across distributed services?

A. Trace

B. Budget

C. Quota

D. Invoice

Correct Answer: A. Trace

Question 10

Which practice most directly improves cost allocation?

A. Removing all monitoring alerts

B. Disabling identity controls

C. Applying consistent owner and environment tags

D. Maximising CPU utilisation regardless of risk

Correct Answer: C. Applying consistent owner and environment tags

Cloud Resource Monitoring and Cost Optimization
Chapter 1 of 14