A constructive and inclusive social network for software developers.

请复制 RSS 到你的阅读器,或快速订阅到 :

The Practical Developer的 RSS 预览

Scraping German marketplaces with one API in Python (Kleinanzeigen, OBI, reichelt) 2026-12-03

German e-commerce is a world of its own. Kleinanzeigen (formerly eBay Kleinanzeigen) is where Germans sell used
bikes, sofas and cars. OBI and HORNBACH are the big DIY chains, and reichelt is a go-to shop for electronics parts
like the Raspberry Pi. None of them offers a public API for this data.

If you want to watch prices or collect listings, the usual route is a scraper per site: parse the HTML, deal with
cookie banners, bot protection and layout changes, and keep it running. In this post we'll do the same jobs with
everydata.io, a realtime web data API: one key, one requests.get, JSON back. You'll build
three small scripts:

  1. a Kleinanzeigen search for ads in a price range around a city,
  2. a daily price check for an OBI drill and a Raspberry Pi at reichelt that writes a CSV,
  3. a tiny "alert" that tells you when a price drops.

Setup

You need Python 3.9+ and requests:

pip install requests
export EVERYDATA_API_KEY="ds_your_key"   # free key: https://everydata.io/login

Every call is a GET to https://api.everydata.io with the key in the x-api-key header. A small helper keeps the
scripts short:

import os
import requests

BASE_URL = "https://api.everydata.io"

def get(path, **params):
    r = requests.get(
        BASE_URL + path,
        params={k: v for k, v in params.items() if v is not None},
        headers={"x-api-key": os.environ["EVERYDATA_API_KEY"]},
        timeout=60,
    )
    r.raise_for_status()
    return r.json()

Every response starts with responseStatus and responseMessage, followed by the data.

1. Search Kleinanzeigen ads around a city

The search endpoint is /kla/kleinanzeigen-search-by-keyword. It takes a keyword, an optional location (a city
or zip code) with a radius in km, a price range (minPrice, maxPrice in EUR) and sortBy (newest,
price-asc, price-desc). Each page holds 25 ads (plus up to two promoted ones), and you can go up to page 50.

r = get(
    "/kla/kleinanzeigen-search-by-keyword",
    keyword="fahrrad", location="Berlin", radius=20,
    minPrice=100, maxPrice=500, sortBy="newest",
)
print(r["resultCount"], "ads, page", r["currentPage"], "of", r["lastPage"])
for ad in r["searchProductDetails"]:
    print(f"{ad['priceText']:>10}  {ad['productDescription'][:50]:50}  {ad['zip']} {ad['location']}")

A run on November 1, 2026 printed lines like these:

  199 € VB  Boulder Mountainbike Fahrrad 27,5 Zoll – Dark Grey   13053 Hohenschönhausen
     160 €  Vintage Rennrad Tour de Suisse                       10997 Kreuzberg

priceText keeps the seller's wording, with "VB" (Verhandlungsbasis, open to offers) or "Festpreis" (fixed
price). The parsed values are in price and priceType. Every ad also has dpUrl (the ad's URL), imgUrl,
categoryId and adType. To get the next page, pass page=r["nextPage"]. On the last page nextPage is null.

One detail that matters if you store this data: the API returns no seller names, only the seller type (and the
company name for commercial sellers). You get the market data without collecting personal data.

2. Monitor OBI and reichelt prices in a CSV

Product pages work the same way for both shops. You pass an article number as productId or a product url, and
you get the same field names back: productTitle, price, currency, available, soldBy and, where the shop
shows it, deliveryMessage.

import csv
import datetime as dt

WATCHLIST = [
    ("/obi/obi-lookup-product", "1183516"),   # Worx WX100 cordless drill
    ("/rch/reichelt-lookup-product", "359846"),  # Raspberry Pi 5 B, 8 GB
]

with open("prices.csv", "a", newline="") as f:
    w = csv.writer(f)
    for path, product_id in WATCHLIST:
        p = get(path, productId=product_id)
        w.writerow([dt.date.today().isoformat(), p["soldBy"], p["productId"],
                    p["productTitle"], p["price"], p["currency"], p["available"],
                    p.get("deliveryMessage")])

Output on November 1, 2026:

2026-11-01 | OBI E-Commerce GmbH | 1183516 | Worx 20 V Akku-Bohrschrauber WX100 inkl. 2 Ah Akku mit Tasche | 59.99 | EUR | True | None
2026-11-01 | reichelt elektronik | 359846 | Raspberry Pi 5 B, 4x 2,4 GHz, 8 GB RAM, WLAN/ BT | 189.99 | EUR | True | ab Lager, Lieferzeit: 1 - 2 Werktage

reichelt prices include VAT. reichelt also returns availabilityStatus (for example InStock) next to the boolean
available, and the delivery line exactly as the shop shows it.

Run the script once a day with cron and the CSV becomes your price history:

0 7 * * * cd /path/to/script && /usr/bin/python3 prices.py

Don't know the article number? Both shops have a search endpoint (/obi/obi-search-by-keyword,
/rch/reichelt-search-by-keyword) that returns productId, price and available for every hit. reichelt's
search can also be sorted by price.

3. A minimal price-drop alert

With the history in a CSV, an alert is a few lines: compare today's price with the lowest price seen before.

import csv
from collections import defaultdict

rows = defaultdict(list)
with open("prices.csv") as f:
    for date, shop, pid, title, price, currency, available, delivery in csv.reader(f):
        rows[(shop, pid)].append((date, float(price), title))

for (shop, pid), history in rows.items():
    *before, (date, price, title) = sorted(history)
    if before and price < min(p for _, p, _ in before):
        print(f"Price drop at {shop}: {title[:40]} now {price:.2f} EUR")

Send that line to Slack, Telegram or e-mail, and you have a working price monitor for German shops in under 60
lines.

Errors and costs

  • A 5xx means the shop couldn't be loaded right now, for example because it was in maintenance or blocked the request. These calls are not charged; retry later.
  • 401 means the key is missing or wrong, 429 means you're over your plan's rate limit, and 403 means the monthly quota is used up.
  • Each response carries an X-Quota-Weight header that shows how much the call counted.

Same data inside an AI assistant

If you'd rather ask "What does the Raspberry Pi 5 cost at reichelt right now?" in Claude or ChatGPT, everydata.io
also runs a hosted MCP server at https://api.everydata.io/mcp. Add it as a custom connector and sign in. The
call_endpoint tool reaches the same endpoints used above.

Wrap-up

  • Kleinanzeigen: /kla/kleinanzeigen-search-by-keyword, with location, radius, price range and sorting
  • OBI: /obi/obi-lookup-product, /obi/obi-search-by-keyword
  • reichelt: /rch/reichelt-lookup-product, /rch/reichelt-search-by-keyword

The full scripts are in the examples repo, and every endpoint and field is listed in the
docs. More on the use cases:
reichelt price monitoring and the
Kleinanzeigen API.

Disclosure: this post is written by the team behind everydata.io.

Claude's 5-minute prompt cache: what a coffee break costs an agent 2026-12-03

If you run a coding agent or a long-lived chat agent on Claude, one number in your bill deserves a second look: how often the prompt cache has expired by the time the next turn arrives. Requesty, an LLM gateway vendor, published an analysis of 30 days of coding-agent traffic and claims that 23.1% of the Claude bill went into rebuilding caches that expired while the developer was away. The mechanism is documented by Anthropic, so the interesting part is what to do about it.

What changed

Nothing in the API changed this week. What is new is a measurement. Requesty looked at traffic from Claude Code, OpenCode, Codex, Pi and Kilo between October 24 and November 22, 2026, using token and billing counters only. Their main findings:

  • Pauses between 5 and 10 minutes alone account for 8.0% of the Claude bill, more than all breaks over an hour combined (5.3%).
  • Breaks longer than 30 minutes cost Claude and GPT users roughly the same share, because both caches are gone by then.
  • The gap comes from the default time to live (TTL): 5 minutes on Claude, 30 minutes on the GPT model they compare against.

This is one vendor's data set, and I could not verify the numbers independently. The pricing mechanics behind them, however, match Anthropic's documentation.

Why it matters in production

Anthropic's docs state that the cache has a 5-minute lifetime by default and is refreshed at no extra cost each time the cached content is used. A cache read on Opus 5.5 is billed at 0.05x the input price, a 5-minute write at 1.25x, and a 1-hour write at 2x.

For a 200,000 token conversation prefix on Opus 5.5, that is $0.04 for a read and $1.00 for a rewrite. One pause of eight minutes turns a 4 cent turn into a one dollar turn, a factor of 25. While the agent loops on its own, requests arrive every few seconds and the cache stays warm. The expensive moment is when a human reads a diff, or when a scheduled agent waits on a slow external system for more than five minutes.

That second case matters for operators. Cron jobs, webhook-triggered agents and long tool calls (browser sessions, builds, approvals) do not behave like a human, but they can have the same gaps.

What to do now

First, measure your own pause bill. The Requesty post suggests counting continuing turns more than 300 seconds after the previous one where cache_read_input_tokens is near zero and cache_creation_input_tokens is close to the full prompt size. Both fields are part of the usage block that Anthropic documents.

Second, check how your harness sets the TTL. In Hermes Agent, the prompt_caching.cache_ttl setting accepts 5m, 1h or auto. In the v0.23.5 source I read, auto resolves to 1h for sessions a person types into and 5m for machine-paced sources such as cron, subagents, webhooks and batch runs. The code comment gives the same reasoning as the pricing page: 1h writes cost 2x instead of 1.25x and only pay off when turns are more than five minutes apart. Our own config still pins 5m, so auto for the interactive profile is the next thing I plan to try.

# ~/.hermes/config.yaml
prompt_caching:
  cache_ttl: auto   # 1h for human-paced sessions, 5m for cron and subagents

Third, if you build your own harness, Anthropic documents a pre-warm request with max_tokens: 0. It writes the cache at your breakpoints and returns an empty response without output tokens. Requesty reports that re-sending the last request body this way after about 4.5 minutes of idle time saved around 8% to 9% net in their replay. The break-even for one ping is read price divided by (write price minus read price), which is 4.2% on Opus 5.5, meaning the user has to come back with at least that probability.

Caveats

  • The 23.1% figure is an average across tools and teams. Your share depends on how many sessions run longer than an hour and how often people pause. Short single-shot agent runs lose almost nothing.
  • Switching to the 1-hour TTL from the first turn means every write costs 2x. Requesty reports that this made 87% to 89% of sessions more expensive. Their live test also found that on the Anthropic API a warm 5-minute entry is not upgraded in place; the request rewrote the whole prompt. Treat that as their observation, not documented behavior.
  • Anthropic documents that max_tokens: 0 is rejected with stream: true, extended thinking, structured outputs, forced tool choice and inside Message Batches. A keep-alive ping needs a stored copy of the last request and the same thinking and effort settings as the real call.
  • Mixing TTLs in one request works only if the 1-hour entries come first.
  • Requesty sells a gateway, so read the comparison with GPT as a vendor view. The Claude-side mechanics are the part I could check against first-party docs.

Sources

Field Notes is a short series by MadeByBrain about what changes in the AI agent tooling we run in production every day. Researched and drafted with AI assistance (Hermes Agent), fact-checked against the linked sources and reviewed by Steffen Hartmann.

Why I Built AegisLLM: An Open-Source LLM Firewall, PII Redactor &amp; Cost Control Proxy in Python 2026-12-03

By **Aman Kumar (@aman179102)* — aman179102.netlify.app · GitHub*

When teams move an LLM feature from a weekend prototype to production, three operational problems show up almost immediately:

  1. Data leakage in prompts. Support agents, internal tools, and end users paste API keys, JWTs, customer emails, credit card numbers, and national IDs straight into chat inputs — and your backend forwards them verbatim to an external inference provider.
  2. Prompt injection & jailbreaks. User-controlled text (or retrieved tool/RAG content) overrides system instructions, smuggles role delimiters (<|im_start|>, [INST]), or tries to exfiltrate system prompts and environment variables.
  3. Unbounded, unattributed token spend. A single tenant or runaway retry loop can burn through your monthly OpenAI/Gemini budget before anyone notices.

You can bolt on a closed-source SaaS AI gateway, but routing unredacted sensitive prompts through yet another third-party cloud defeats the purpose for many security-conscious teams.

That's why I built AegisLLM — an MIT-licensed, self-hosted OpenAI-compatible reverse proxy, CLI scanner, and live observability dashboard written in Python.

Drop-In Integration: One base_url Change

AegisLLM implements POST /v1/chat/completions and GET /v1/models, so any codebase using the official OpenAI Python/JS SDK can adopt it by changing a single base_url and passing an optional X-Aegis-Tenant header:

from openai import OpenAI

client = OpenAI(
    base_url="http://127.0.0.1:8080/v1",
    api_key="any-placeholder-if-server-holds-key",
    default_headers={"X-Aegis-Tenant": "payments-team"},
)

resp = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "Summarize ticket for [email protected]"}],
)
print(resp.choices[0].message.content)

Because it speaks the OpenAI Chat Completions wire format, it sits cleanly in front of OpenAI, Gemini (OpenAI-compatible endpoint), Groq, Together, Ollama, or vLLM.

Inside the 4-Stage Request Pipeline

Every POST /v1/chat/completions request in aegis_llm/app.py passes through four deterministic stages before returning a response:

Client Request (X-Aegis-Tenant)
   │
   ▼
[1. Per-Tenant Budget Gate] ──(spent >= budget)──▶ 429 aegis_budget_exceeded
   │
   ▼
[2. Prompt-Injection Firewall] ──(flagged & mode=block)──▶ 403 aegis_prompt_injection
   │
   ▼
[3. PII & Secret Redactor] ──(replaces with <REDACTED_*_N>)
   │
   ▼
[4. Upstream Dispatch + SQLite Audit & Cost Ledger] ──▶ 200 + X-Aegis-* headers

1. Per-Tenant Token & USD Budget Caps (aegis_llm/ledger.py)

AegisLLM tracks cumulative USD spend per X-Aegis-Tenant header (defaulting to "default" and $25.00 via AEGIS_DEFAULT_BUDGET_USD) in a thread-safe SQLite database (aegis_ledger.db, guarded by threading.Lock()).

Before a request ever touches the firewall or upstream LLM, db.get_budget_status(tenant) checks spent_usd >= budget_usd. If exceeded, AegisLLM logs a blocked_budget event and immediately returns HTTP 429 with code: "aegis_budget_exceeded".

Budgets can be updated dynamically at runtime via the REST API:

curl -X POST http://127.0.0.1:8080/api/tenants/payments-team/budget \
  -H "Content-Type: application/json" \
  -d '{"budget_usd": 50.0}'

2. Prompt-Injection & Jailbreak Firewall (aegis_llm/firewall.py)

inspect_messages() scans user and tool messages (explicitly skipping trusted role == "system" messages) against five deterministic rules:

Rule ID Severity What It Catches
INJ-001 90 Instruction override attempts (ignore previous instructions, override system policies)
INJ-002 95 System prompt exfiltration (reveal system prompt, dump developer message)
INJ-003 85 Jailbreak / unrestricted persona framing (you are now DAN, developer mode enabled)
INJ-004 80 Role / delimiter smuggling (`<\
{% raw %}INJ-005 85 Credential or environment exfiltration (dump /etc/passwd, process.env, os.environ, .env)

Controlled via AEGIS_INJECTION_MODE:

  • block (default): returns HTTP 403 (aegis_prompt_injection) with X-Aegis-Risk-Score and matched_rules.
  • flag: logs the risk score and matched rules to the audit trail while allowing the request through.
  • off: bypasses firewall enforcement.

3. Deterministic PII & Secret Redaction (aegis_llm/redactor.py)

If AEGIS_REDACT_PII=1 (default), redact_messages() sanitizes both plain-string content and multimodal list-of-parts {"type": "text", "text": ...} blocks before the payload leaves your network.

It covers 13 high-signal categories:

  • Secrets & Keys: PEM PRIVATE_KEY blocks, OPENAI_KEY (sk- / sk-proj- / sk-svcacct- / sk-admin-), GITHUB_TOKEN (ghp_, gho_, ghu_, ghs_, ghr_, github_pat_), AWS_ACCESS_KEY (AKIA / ASIA), GOOGLE_API_KEY (AIza...), SLACK_TOKEN (xox[baprs]-...), and JWT tokens.
  • PII & Financial / National IDs: EMAIL, PHONE (Indian +91 and international formats), SSN_US, PAN_IN (Indian PAN), AADHAAR_IN (Indian Aadhaar), and CREDIT_CARD.

To avoid corrupting legitimate 13–19 digit order or tracking IDs, credit card candidates are validated with a Luhn checksum (_luhn_valid) before redaction. Matched values are replaced with indexed, deduplicated placeholders like <REDACTED_EMAIL_1> or <REDACTED_OPENAI_KEY_1>.

4. Upstream Dispatch, Cost Estimation & Live Dashboard

After sanitization, AegisLLM forwards the payload via httpx.AsyncClient to AEGIS_UPSTREAM_URL (or generates a deterministic local response in --mock mode).

Token usage from the upstream response (with a character-length fallback estimator if usage is omitted) is priced against DEFAULT_MODEL_PRICING in aegis_llm/config.py (supporting gpt-4o, gpt-4o-mini, gpt-4.1, gpt-4.1-mini, gemini-2.5-flash, gemini-2.5-pro, claude-3-7-sonnet, llama-3.3-70b, and aegis-mock, with a fallback rate).

Every response includes observability headers:

  • X-Aegis-Tenant
  • X-Aegis-Action (allowed, redacted_allowed, flagged_allowed, blocked_injection, blocked_budget)
  • X-Aegis-Redactions
  • X-Aegis-Cost-USD
  • X-Aegis-Latency-Ms

And at GET /, AegisLLM serves a self-contained dark-mode dashboard polling /api/stats, /api/tenants, and /api/logs every 4 seconds.

CLI Scanner & Local Mock Mode

You can test AegisLLM locally with zero API keys:

pip install -e .
aegis-llm serve --mock --port 8080

Or run the built-in CLI scanner directly against any string (exits with status code 2 if an injection is flagged, making it easy to wire into CI/CD or pre-commit checks):

aegis-llm scan "Email [email protected] with key sk-proj-abc12345678901234567890"

Docker Compose is also included (docker compose up --build).

Why Deterministic Rules + SQLite Instead of Heavy ML?

A deliberate architectural choice in AegisLLM v0.1.0 is keeping the dependency footprint minimal: FastAPI, Uvicorn, httpx, Pydantic, and Python's standard library.

  • Zero GPU / model-weight overhead: No downloading 500MB NER models or running a sidecar classifier just to redact an AWS key or email address.
  • Zero external infra required: SQLite gives you persistent budgets and audit trails out of the box in a single container.
  • Honest trade-off: Deterministic regex + Luhn validation catches structured secrets, PII, and known injection patterns reliably, but it won't catch subtle semantic jailbreaks or unstructured PII. For many teams, having a fast, zero-dependency first line of defense in front of every LLM call is the 80/20 win they were missing.

Check out the code on GitHub: github.com/aman179102/aegis-llm, or learn more about my work at aman179102.netlify.app.

Building an End-to-End Cloud-Native Microservice Observability Platform: My Platform Engineering Capstone 2 2026-12-03

Introduction

As part of my platform engineering learning journey, I recently completed my second capstone project: building a cloud-native microservices observability platform.

This project was an opportunity to bring together several technologies and engineering practices that are essential in modern cloud-native environments.

Rather than focusing only on deploying an application, I wanted to build a platform that could support the application throughout its lifecycle: from containerization and orchestration to monitoring, centralized logging, distributed tracing, alerting, automation, security scanning, and operational troubleshooting.

The central question behind the project was:

How can we deploy a microservices application on Kubernetes and build the observability and operational capabilities needed to understand, monitor, troubleshoot, and maintain it?

To answer that question, I designed and implemented a three-service application and integrated it with a complete observability stack.

The project brought together:

  • Docker and Docker Compose
  • Kubernetes and Minikube
  • Helm
  • GitHub
  • Jenkins
  • Argo CD
  • Prometheus
  • Grafana
  • Grafana Loki
  • Grafana Alloy
  • Grafana Tempo
  • OpenTelemetry
  • Alertmanager
  • Ansible
  • Trivy
  • Python and FastAPI

This article documents the project from the initial design through implementation, integration, testing, and validation.

It also explains some of the challenges I encountered, the decisions I made, and what I learned along the way.

1. Understanding the Project Objectives

The first step was to establish what the platform needed to achieve.

A microservices application can be running successfully while still having operational problems that are difficult to identify.

For example:

  • A service may respond slowly.
  • An API may return HTTP errors.
  • A Kubernetes node may become unavailable.
  • Application logs may be scattered across different containers.
  • A request may fail somewhere between multiple services.
  • A container image may contain vulnerable operating-system packages.
  • An engineer may not receive an alert when something goes wrong.

These are operational problems that cannot be addressed through application deployment alone.

I therefore divided the project into several objectives.

Application objectives

  • Build a microservices application.
  • Containerize each service.
  • Expose health-check endpoints.
  • Enable communication between services.

Kubernetes objectives

  • Deploy the services to Kubernetes.
  • Configure Kubernetes Services and Deployments.
  • Apply resource requests and limits.
  • Implement container security controls.
  • Configure readiness and liveness probes.

Observability objectives

  • Collect application and infrastructure metrics.
  • Build Grafana dashboards.
  • Centralize application logs.
  • Implement distributed tracing.
  • Configure operational alerts.
  • Test notification delivery.

Automation and security objectives

  • Create a Jenkins CI pipeline.
  • Validate application images with Ansible.
  • Scan container images with Trivy.
  • Integrate GitOps deployment management.
  • Maintain operational runbooks.

The goal was to bring these capabilities together into one working platform.

[SCREENSHOT 1: Insert a screenshot of your project directory or overall project architecture here.]

2. Designing the Application Architecture

Before implementing the platform, I designed the application around three independent microservices.

The services were:

  1. API Gateway
  2. Order Service
  3. Payment Service

Each service was developed using Python and FastAPI.

2.1 API Gateway

The API Gateway acts as the entry point for incoming application requests.

Instead of allowing an external client to communicate directly with every internal service, requests enter through the API Gateway.

Its responsibilities include:

  • Receiving HTTP requests.
  • Exposing the application API.
  • Coordinating order requests.
  • Communicating with the Order Service.
  • Returning responses to the client.
  • Exposing health and metrics endpoints.

The API Gateway listens on port 8000.

2.2 Order Service

The Order Service handles order creation.

When a client submits an order through the API Gateway, the request is forwarded to the Order Service.

It handles the order-processing operation and communicates with the Payment Service.

The Order Service listens on port 8001.

2.3 Payment Service

The Payment Service handles the payment-processing portion of the workflow.

For this project, payment approval was simulated rather than integrated with a real payment provider.

This allowed me to demonstrate service-to-service communication and end-to-end request tracing without introducing an external payment dependency.

The Payment Service listens on port 8002.

2.4 Understanding the request flow

The application workflow is:

Client
  |
  v
API Gateway
  |
  v
Order Service
  |
  v
Payment Service
  |
  v
Response returned to Client

A client submits an order request to the API Gateway.

The API Gateway communicates with the Order Service, which processes the order and calls the Payment Service.

The Payment Service returns a simulated payment result, and the response travels back through the services.

This simple workflow provides a useful foundation for demonstrating distributed application behaviour.

[SCREENSHOT 2: Insert your application architecture diagram showing API Gateway, Order Service, and Payment Service.]

3. Developing the Microservices with FastAPI

I used FastAPI to implement the three application services.

FastAPI provides a lightweight framework for building HTTP APIs in Python.

Each service has its own application code, dependencies, Dockerfile, and container image.

The services also expose health-check endpoints.

For example:

GET /health

A successful response indicates that the service is available.

The health endpoints are useful for:

  • Docker health checks.
  • Kubernetes readiness probes.
  • Kubernetes liveness probes.
  • CI smoke tests.
  • Operational troubleshooting.

I also introduced application metrics and structured logging so that the services could produce telemetry for the observability platform.

3.1 Application metrics

The services expose Prometheus-compatible metrics.

Some of the application metrics include:

http_requests_total
http_request_duration_seconds
orders_created_total
orders_failed_total
payments_approved_total
payments_declined_total

These metrics provide information about application activity.

For example:

  • http_requests_total tracks HTTP requests.
  • http_request_duration_seconds records request duration.
  • orders_created_total tracks successful order creation.
  • orders_failed_total tracks failed orders.
  • payments_approved_total tracks approved simulated payments.
  • payments_declined_total tracks declined simulated payments.

The metrics are exposed through the /metrics endpoint.

This makes it possible for Prometheus to scrape the application services.

3.2 Structured application logging

I implemented structured JSON logging.

Instead of producing only unstructured text messages, the application logs include fields such as:

{
  "timestamp": "2026-12-02T20:28:37.750873+00:00",
  "level": "INFO",
  "service": "api-gateway",
  "message": "HTTP request completed",
  "method": "GET",
  "route": "/health",
  "status_code": 200,
  "duration_seconds": 0.000741
}

Structured logs are useful because individual fields can be extracted and queried.

For example, an engineer can filter logs by:

  • Service name
  • Log level
  • Timestamp
  • HTTP route
  • Status code
  • Message

This becomes especially valuable when several microservices are running inside Kubernetes.

[SCREENSHOT 3: Insert a screenshot of the application source code showing the health endpoint, metrics instrumentation, or structured JSON logging.]

4. Containerizing the Application with Docker

After developing the services, the next step was containerization.

Docker provides a consistent way to package an application together with its runtime dependencies.

I created an individual Dockerfile for each service:

app/
├── api-gateway/
│   ├── Dockerfile
│   ├── requirements.txt
│   └── app/
├── order-service/
│   ├── Dockerfile
│   ├── requirements.txt
│   └── app/
└── payment-service/
    ├── Dockerfile
    ├── requirements.txt
    └── app/

Each service can therefore be built and managed independently.

4.1 Building the Docker images

The application images were built locally.

The image naming convention was:

observability-api-gateway:1.1
observability-order-service:1.1
observability-payment-service:1.1

Example:

docker build \
  -t observability-api-gateway:1.1 \
  ./app/api-gateway

Repeat the process for the other two services:

docker build \
  -t observability-order-service:1.1 \
  ./app/order-service

docker build \
  -t observability-payment-service:1.1 \
  ./app/payment-service

To inspect the images:

docker images

4.2 Docker image security improvements

I paid attention to container security while building the images.

The application images use a pinned Python 3.12 slim base image.

The Dockerfiles were also updated to perform operating-system package updates and clean up package metadata.

The containers run using a non-root application user rather than running the application as root.

This is important because container security should be considered during image construction, not only after deployment.

4.3 Testing with Docker Compose

Before moving to Kubernetes, I used Docker Compose to validate the application in a containerized environment.

Docker Compose made it possible to start the three services together and verify their communication.

The application containers started successfully and passed their configured health checks.

I also tested the end-to-end order workflow.

A successful request returned HTTP 200, and the payment service returned a simulated approval.

This provided an early validation of the application before introducing Kubernetes.

[SCREENSHOT 4: Insert a terminal screenshot showing docker compose ps with the three application services healthy.]

Useful commands:

docker compose -f docker/docker-compose.yml up -d
docker compose -f docker/docker-compose.yml ps
docker compose -f docker/docker-compose.yml logs

5. Deploying the Application to Kubernetes with Minikube

Once the application was working in Docker, I moved to Kubernetes.

Kubernetes provides orchestration capabilities for containerized applications.

It manages application workloads, service discovery, networking, health checks, and resource allocation.

For this project, I used Minikube to run a local Kubernetes cluster.

Minikube provides a practical environment for learning and validating Kubernetes deployments without requiring a production cloud cluster.

5.1 Creating the namespaces

I separated the application workloads from the observability components using Kubernetes namespaces.

The two main namespaces are:

microservices
observability

The microservices namespace contains:

  • API Gateway
  • Order Service
  • Payment Service

The observability namespace contains the monitoring and telemetry components.

Separating workloads into namespaces makes it easier to organize resources and apply namespace-specific configurations.

5.2 Kubernetes Deployments

I created Kubernetes Deployment manifests for the three services.

Each service was configured with one replica during the project validation.

The deployments define:

  • Container image
  • Container port
  • Environment configuration
  • Resource requests
  • Resource limits
  • Readiness probes
  • Liveness probes
  • Container security context

5.3 Kubernetes Services

I also created Kubernetes Services using the ClusterIP service type.

The services expose the application internally within the cluster.

The ports are:

Service Port
API Gateway 8000
Order Service 8001
Payment Service 8002

The services communicate through Kubernetes internal DNS.

For example, the API Gateway can reach the Order Service through its Kubernetes Service name rather than depending on a hardcoded pod IP address.

This is important because pod IP addresses can change when workloads are recreated.

5.4 Kubernetes health checks

I configured readiness and liveness probes using the application health endpoints.

A readiness probe determines whether a container is ready to receive traffic.

A liveness probe helps Kubernetes determine whether a container should be restarted.

These checks improve workload management and help Kubernetes respond to application health problems.

5.5 Resource requests and limits

I configured CPU and memory requests and limits for the application containers.

The application container configuration included:

resources:
  requests:
    cpu: 100m
    memory: 64Mi
  limits:
    cpu: 500m
    memory: 128Mi

Requests define the resources Kubernetes should account for when scheduling a pod.

Limits define the maximum resource consumption allowed by the container configuration.

I also configured ResourceQuota objects for the application and observability namespaces.

This helps prevent workloads from consuming unlimited cluster resources.

5.6 Kubernetes container security

Security was another important part of the Kubernetes deployment.

The application containers were configured with:

  • Non-root UID/GID 999
  • Read-only root filesystem
  • Privilege escalation disabled
  • All Linux capabilities dropped
  • RuntimeDefault seccomp profile

An example of the container security configuration is:

securityContext:
  runAsNonRoot: true
  runAsUser: 999
  runAsGroup: 999
  allowPrivilegeEscalation: false
  readOnlyRootFilesystem: true
  capabilities:
    drop:
      - ALL

The pod security configuration also uses:

seccompProfile:
  type: RuntimeDefault

These settings reduce the privileges available to application containers.

They are not a replacement for a complete security assessment, but they establish important container-hardening controls.

5.7 Validating the Kubernetes deployment

After applying the manifests, I checked the deployments and pods.

kubectl get namespaces
kubectl get deployments -n microservices
kubectl get pods -n microservices
kubectl get services -n microservices

The three application deployments reached their expected ready state.

I also validated the application health endpoints and tested the order workflow through the Kubernetes services.

The complete request successfully traversed the API Gateway, Order Service, and Payment Service.

[SCREENSHOT 5: Insert kubectl get pods -n microservices showing all three application pods running and ready.]

[SCREENSHOT 6: Insert kubectl get services -n microservices showing the three ClusterIP services.]

6. Introducing Helm for Observability Deployment

The observability stack contains multiple components.

Managing all these components manually would make installation and configuration more difficult.

I therefore used Helm.

Helm is a Kubernetes package manager that helps install and manage applications through charts and configurable values files.

For this project, I used Helm to deploy and configure the kube-prometheus-stack and the logging and tracing components.

The kube-prometheus-stack chart provides an integrated monitoring stack that includes components such as:

  • Prometheus
  • Grafana
  • Alertmanager
  • Prometheus Operator
  • Kubernetes monitoring resources

The project also uses Helm configuration for Loki, Alloy, and Tempo.

This allowed me to maintain configuration in version-controlled YAML files instead of relying entirely on manual changes through the Kubernetes dashboard or terminal.

[SCREENSHOT 7: Insert a screenshot of helm list -n observability showing the installed observability releases.]

Useful command:

helm list -n observability

7. Implementing Metrics Collection with Prometheus

Prometheus is the metrics collection and monitoring system used in this project.

Its main responsibility is to collect time-series metrics from the application and Kubernetes environment.

A time-series metric is a measurement associated with a timestamp.

Examples include:

  • CPU usage
  • Memory usage
  • HTTP request counts
  • Request latency
  • Filesystem capacity
  • Pod availability

7.1 Application metrics collection

The three microservices expose Prometheus metrics through their /metrics endpoints.

I configured a Prometheus ServiceMonitor to discover and scrape the application services.

The ServiceMonitor uses the appropriate service labels and selects the application workloads.

The scrape configuration includes:

endpoints:
  - port: http
    path: /metrics
    interval: 15s

The ServiceMonitor selects the application services through their labels.

This allows Prometheus to discover the endpoints through Kubernetes service discovery.

7.2 Verifying metrics collection

I used Prometheus to check whether the application targets were being scraped successfully.

One useful query is:

up{namespace="microservices"}

A value of 1 indicates that Prometheus successfully scraped the target.

During validation, all three application services returned healthy scrape results.

I also checked the application request metrics and histogram metrics.

For example:

http_requests_total

This metric helps track the number of HTTP requests processed by the services.

[SCREENSHOT 8: Insert a Prometheus screenshot showing all three microservice targets as UP.]

[SCREENSHOT 9: Insert a Prometheus query screenshot showing up{namespace="microservices"} returning 1 for all three services.]

8. Building Grafana Dashboards

Prometheus provides metrics, but engineers need a clear way to understand those metrics.

Grafana provides visualization and dashboarding capabilities.

I used Grafana to build three dashboards containing ten panels.

The dashboards cover infrastructure monitoring, service-level performance, and application logs.

8.1 Dashboard 1 — Infrastructure

The Infrastructure dashboard provides visibility into the underlying Kubernetes environment.

It is intended to help an engineer understand the health and resource usage of the cluster.

Infrastructure monitoring is important because application performance can be affected by problems in the environment where the application runs.

For example:

  • High CPU usage can affect application performance.
  • Memory pressure can cause pod instability.
  • Disk exhaustion can affect workloads.
  • Node availability affects scheduling and application availability.

[SCREENSHOT 10: Insert the Infrastructure dashboard showing its panels.]

8.2 Dashboard 2 — Service Overview (RED metrics)

The second dashboard focuses on application service health.

I used the RED monitoring approach.

RED stands for:

  • Rate
  • Errors
  • Duration

These three measurements provide a useful overview of application service behaviour.

Rate

Rate measures how many requests a service processes over time.

Errors

Errors measure the number or proportion of failed requests.

Duration

Duration measures how long requests take to complete.

For request latency, I used a PromQL histogram query to calculate the 99th percentile.

histogram_quantile(
  0.99,
  sum by (le, service) (
    rate(http_request_duration_seconds_bucket[5m])
  )
)

This query calculates the p99 request duration grouped by service.

The p99 is useful because it helps identify slower requests that may not be obvious from average latency.

During validation, the query returned values for the application services.

[SCREENSHOT 11: Insert the Service Overview dashboard showing request rate, error rate, and p99 latency panels.]

8.3 Dashboard 3 — Application Logs

The third dashboard focuses on application logging.

It contains panels for:

  • Application Log Volume
  • Application Error Count
  • Recent Application Errors

The Application Log Volume panel was validated and displayed logs from:

  • API Gateway
  • Order Service
  • Payment Service

The error-related panels were configured, but no matching ERROR events were available in the final selected time range.

This is an important distinction: a configured query is not the same as a query that has been validated against matching data.

I recorded this limitation rather than presenting the error panels as fully validated.

[SCREENSHOT 12: Insert the Application Logs dashboard showing application log volume and the three services.]

9. Centralized Logging with Grafana Loki and Grafana Alloy

One of the major objectives of this project was to centralize application logs.

In a microservices environment, each service produces its own logs.

If an engineer needs to troubleshoot an issue, manually connecting to individual containers or pods becomes inconvenient.

A centralized logging platform makes it possible to search logs from multiple services in one place.

For this project, I used:

  • Grafana Alloy
  • Grafana Loki
  • Grafana

9.1 What is Grafana Alloy?

Grafana Alloy is an observability collector.

It can collect and process telemetry before forwarding it to a backend.

In this project, Alloy collects Kubernetes pod logs and forwards them to Loki.

9.2 What is Grafana Loki?

Loki is the centralized log aggregation system.

It stores log streams and indexes their labels so that engineers can search and filter logs efficiently.

Unlike traditional full-text indexing approaches, Loki is designed around labels and log streams.

9.3 Understanding the logging pipeline

The logging flow is:

API Gateway ───────┐
                   |
Order Service ─────┼──> Kubernetes Pod Logs
                   |             |
Payment Service ───┘             v
                            Grafana Alloy
                                 |
                                 v
                              Grafana Loki
                                 |
                                 v
                               Grafana

Each application writes logs to its container output.

Kubernetes makes these logs available through its pod log files.

Alloy discovers and reads the pod logs, processes the entries, and forwards them to Loki.

Grafana then queries Loki to display the logs.

9.4 Processing structured logs

I configured the Alloy pipeline to process container logs and extract structured JSON fields.

The pipeline includes stages for:

  • Container log processing
  • JSON field extraction
  • Label creation
  • Timestamp processing
  • Forwarding to Loki

The key processing configuration includes:

loki.process "pod_logs" {
  stage.docker {}

  stage.json {
    expressions = {
      timestamp = "timestamp",
      level     = "level",
      service   = "service",
    }
  }

  stage.labels {
    values = {
      level   = "level",
      service = "service",
    }
  }

  stage.timestamp {
    source            = "timestamp"
    format            = "RFC3339Nano"
    action_on_failure = "skip"
  }

  forward_to = [loki.write.default.receiver]
}

This configuration extracts useful information from the JSON logs.

The service and level fields are particularly useful when filtering logs.

9.5 A logging pipeline issue I encountered

During validation, I discovered that the container log processing stage needed to match the actual log format.

The initial pipeline used:

stage.cri {}

I changed the processing stage to:

stage.docker {}

and added explicit JSON parsing.

This was an important troubleshooting exercise because log collection depends on understanding the format of the actual container log files.

After correcting the pipeline and validating the Alloy configuration, logs from the application services were available in Loki.

9.6 Querying logs in Grafana

I used LogQL to query Loki.

A basic query for application logs is:

{namespace="microservices"}

To filter logs by service:

{namespace="microservices", service="api-gateway"}

To filter by log level:

{namespace="microservices"} | json | level="ERROR"

To count ERROR entries by service over a five-minute window:

sum by (service) (
  count_over_time(
    {namespace="microservices"} | json | level="ERROR" [5m]
  )
)

These queries demonstrate how centralized logs can be explored and aggregated.

During the final validation, the general application log query returned entries from the API Gateway, confirming that Loki was receiving and displaying application logs.

The ERROR query returned no matching entries in the selected time range. Therefore, the error panels were recorded as configured but not fully validated against an actual error event.

[SCREENSHOT 13: Insert a Grafana Explore screenshot showing application logs returned by Loki.]

[SCREENSHOT 14: Insert an Alloy configuration screenshot showing the log-processing pipeline.]

10. Distributed Tracing with OpenTelemetry and Grafana Tempo

Metrics tell us how a system is performing.

Logs tell us what happened.

Distributed tracing helps us understand how a request moves through multiple services.

This is especially important in a microservices architecture.

Imagine a request entering the API Gateway, moving to the Order Service, and then reaching the Payment Service.

If the request becomes slow, it may be difficult to identify which service caused the delay using metrics alone.

Distributed tracing helps connect the operations performed by the different services.

10.1 What is OpenTelemetry?

OpenTelemetry is an observability framework for generating, collecting, and exporting telemetry data.

It supports:

  • Traces
  • Metrics
  • Logs

For this project, I used OpenTelemetry instrumentation to generate distributed traces from the application services.

10.2 What is Grafana Tempo?

Grafana Tempo is the distributed tracing backend.

It receives and stores trace data and allows engineers to explore the traces through Grafana.

10.3 Understanding the tracing flow

The tracing pipeline is:

Client Request
      |
      v
  API Gateway
      |
      v
  Order Service
      |
      v
 Payment Service
      |
      v
OpenTelemetry Instrumentation
      |
      v
   OTLP Export
      |
      v
  Grafana Tempo
      |
      v
     Grafana

The application services were configured to export telemetry to Tempo through OTLP gRPC.

10.4 Validating a distributed trace

I generated an order request through the API Gateway and then explored the resulting trace in Grafana Tempo.

I used the following TraceQL query:

{
  resource.service.name = "api-gateway"
  && name = "POST /orders"
}

The query returned a matching trace.

This confirmed that the API Gateway request was being recorded and that Tempo could retrieve it.

[SCREENSHOT 15: Insert a Grafana Tempo Explore screenshot showing the successful POST /orders trace.]

This was one of the most important validations in the project because it demonstrated distributed tracing beyond simply deploying the tracing backend.

11. Configuring Operational Alerts in Grafana

Monitoring becomes more useful when it can notify engineers about conditions that require attention.

A dashboard requires someone to open it and inspect the metrics.

An alerting system can evaluate conditions continuously and notify the responsible team when a threshold is reached.

For this project, I configured five Grafana-managed alert rules.

They cover important application and Kubernetes operational conditions.

11.1 High HTTP Error Rate

This rule monitors the proportion of failed HTTP requests.

The objective is to detect a situation where the application begins returning too many errors.

The configured threshold is greater than 5%, with a pending period of five minutes.

11.2 High p99 Latency

This rule monitors high request latency using the p99 metric.

The purpose is to detect when a significant proportion of requests are taking longer than the expected threshold.

I also tested this alert by temporarily lowering its threshold.

The rule entered a firing state, and an email notification was successfully received.

The original threshold was restored after the test.

11.3 Kubernetes Node Not Ready

This rule monitors Kubernetes node readiness.

A node that becomes unavailable can affect workload scheduling and application availability.

The rule uses a five-minute pending period.

11.4 Low Disk Space

This rule monitors available filesystem capacity.

The configured condition checks whether available space falls below 10%.

The rule was configured and the underlying Prometheus filesystem metrics were inspected.

However, the Grafana alert detail displayed an evaluation value of zero even though the direct Prometheus query showed approximately 90.17% available space.

This discrepancy remains a validation caveat and requires further investigation.

11.5 Excessive Pod Restarts

This rule monitors excessive Kubernetes pod restarts.

Frequent restarts may indicate:

  • Application crashes
  • Configuration problems
  • Resource constraints
  • Dependency failures
  • Runtime instability

The rule was configured to detect excessive restarts over the selected monitoring window.

11.6 Summary of the five rules

Alert rule Purpose
High HTTP Error Rate Detect elevated application errors
High p99 Latency Detect slow application requests
Kubernetes Node Not Ready Detect unavailable Kubernetes nodes
Low Disk Space Detect low filesystem capacity
Excessive Pod Restarts Detect unstable application pods

11.7 Configuring email notifications

I configured Grafana SMTP using Brevo as the SMTP relay provider.

The SMTP credentials were stored in a Kubernetes Secret rather than being placed directly in the configuration file.

The Secret was named:

grafana-smtp-credentials

Grafana loaded the credentials through its environment configuration.

The Helm values referenced the Secret:

grafana:
  envFromSecret: grafana-smtp-credentials

The SMTP settings included:

grafana.ini:
  smtp:
    enabled: true
    host: smtp-relay.brevo.com:587
    user: $__env{GF_SMTP_USER}
    password: $__env{GF_SMTP_PASSWORD}
    from_address: YOUR_VERIFIED_SENDER_ADDRESS
    from_name: Microservices Observability
    startTLS_policy: MandatoryStartTLS

The actual credentials were kept out of the repository.

11.8 Testing notification delivery

I tested the Grafana contact point and confirmed that a test notification was successfully delivered to my email inbox.

I also tested the High p99 Latency alert.

After the alert entered the firing state, Grafana sent an email notification.

The notification included the alert name and affected service instances.

This confirmed the end-to-end notification path:

Prometheus Metrics
       |
       v
Grafana Alert Rule
       |
       v
Grafana Notification Policy
       |
       v
SMTP Contact Point
       |
       v
Email Notification

An important architectural detail is that these project alerts are Grafana-managed rules. They are routed through Grafana notification policies and the Grafana SMTP contact point.

They are not dependent on an Alertmanager-to-email routing configuration.

[SCREENSHOT 16: Insert a screenshot showing all five Grafana alert rules.]

[SCREENSHOT 17: Insert a screenshot of the Grafana notification contact point.]

[SCREENSHOT 18: Insert a screenshot of the successful email notification received in your inbox. Hide private email addresses and sensitive information.]

12. GitOps with Argo CD

Another important part of the project was GitOps.

GitOps is an approach where the desired state of an application or infrastructure is maintained in version control.

Instead of relying entirely on manually applying configuration changes, a GitOps controller continuously compares the desired state with the actual cluster state.

For this project, I used Argo CD.

Argo CD monitors the configured Git repository and manages the Kubernetes application state based on the manifests stored in Git.

The general workflow is:

GitHub Repository
       |
       v
    Argo CD
       |
       v
Kubernetes Cluster
       |
       v
Application Workloads

This approach makes the deployment configuration easier to review and maintain.

It also provides visibility into whether an application is synchronized with the desired Git state.

During project validation, the Argo CD application was observed in a Synced and Healthy state.

[SCREENSHOT 19: Insert your Argo CD application screenshot showing Synced and Healthy.]

13. Building the CI Pipeline with Jenkins

Continuous Integration is another important part of a platform engineering workflow.

I used Jenkins to automate application validation and container image checks.

The project includes a Jenkins pipeline defined in:

Jenkinsfile

The pipeline uses a custom workspace and skips the default checkout because the project workspace is managed separately.

It includes several stages.

13.1 Python compilation

The pipeline performs Python compilation checks to identify syntax errors before proceeding.

13.2 Application health tests

The pipeline runs application health smoke tests.

The tests use FastAPI's testing capabilities and validate the health endpoints of the three services.

The tracing configuration is stubbed during these isolated health tests.

These tests are intended to validate service health endpoints, not the complete business workflow.

13.3 Docker image builds

The pipeline builds the three application Docker images.

This confirms that the Dockerfiles and their dependencies can produce the expected images.

13.4 Ansible image validation

The pipeline runs an Ansible playbook to verify that the expected local Docker images exist.

The playbook uses Docker image inspection.

This is a lightweight validation step that confirms the images are available in the local Docker environment.

It is not a full security or runtime assessment.

13.5 Trivy security scanning

The pipeline uses Trivy to scan the application images for known vulnerabilities.

The purpose is to identify vulnerabilities in the operating-system packages and application dependencies included in the images.

13.6 Image publishing control

Image publishing is controlled through a pipeline parameter.

For the final report-only validation, image publishing was disabled.

This allowed the pipeline to validate the images without publishing them to a registry.

[SCREENSHOT 20: Insert your Jenkins pipeline screenshot showing the stages and successful report-only build.]

14. Container Security Scanning with Trivy

Security scanning was an important part of the project.

A Docker image can build successfully and still contain vulnerable packages.

Trivy helps identify known vulnerabilities in container images.

I used Trivy to scan the three application images.

14.1 Strict security validation

During strict scanning, the images were found to contain:

  • 53 HIGH-severity operating-system findings
  • 0 CRITICAL findings
  • 13 unique CVEs

The findings were associated with Debian operating-system packages in the Python base image.

The Python dependency scan did not report corresponding application dependency findings in the final scan results.

I investigated the findings and compared available base-image options.

An alternative Bookworm image produced more findings, including CRITICAL findings, so it was not selected as an improvement.

I retained the pinned Python 3.12 slim base image and documented the remaining findings.

14.2 Strict mode and report-only mode

The Jenkins pipeline supports strict and report-only scanning behaviour.

In strict mode, HIGH or CRITICAL findings can cause the pipeline to fail.

This behaviour was demonstrated during the project.

A strict scan failed because of the outstanding HIGH-severity findings.

I then ran the pipeline in report-only mode with:

FAIL_ON_TRIVY_HIGH_OR_CRITICAL=false
PUBLISH_IMAGES=false

The report-only pipeline completed successfully.

This distinction is important.

A successful report-only build does not mean the vulnerabilities have disappeared.

It means the pipeline completed while reporting the findings without enforcing the strict failure condition.

14.3 Documenting a narrow exception

The project also includes a Trivy ignore configuration:

.trivyignore.yaml

It contains a narrowly scoped exception for a specific setuptools finding associated with a package detected through the scanner's software bill of materials.

The exception includes an expiry date and a rationale.

It does not suppress the Debian operating-system findings.

This approach is preferable to broadly ignoring vulnerability categories without understanding the underlying result.

[SCREENSHOT 21: Insert a Trivy scan report showing the HIGH and CRITICAL finding counts.]

[SCREENSHOT 22: Insert a Jenkins screenshot showing the strict scan failure and report-only success. Make the difference clear.]

15. Automating Image Validation with Ansible

I also included Ansible in the project.

Ansible is an automation tool that can execute tasks across managed systems.

For this project, I used it for a focused validation task: checking whether the three expected application Docker images existed locally.

The playbook is located at:

ansible/playbooks/validate-images.yml

The playbook checks the expected images using Docker image inspection.

The validation covered:

observability-api-gateway:1.1
observability-order-service:1.1
observability-payment-service:1.1

The validation completed successfully with:

ok=3
changed=0
failed=0

This demonstrated how Ansible can be integrated into a CI pipeline to automate operational checks.

The scope of this playbook is deliberately limited to local image existence validation.

[SCREENSHOT 23: Insert the Ansible playbook execution output showing ok=3, changed=0, and failed=0.]

16. Operational Runbooks

Monitoring and alerting are useful, but engineers also need a documented process for responding to incidents.

I created five operational runbooks.

They are stored in the runbooks/ directory.

16.1 High HTTP Error Rate

runbooks/high-http-error-rate.md

This runbook covers investigation of elevated HTTP error rates.

It provides guidance for checking service health, examining logs, and identifying possible causes of application failures.

16.2 High p99 Latency

runbooks/high-p99-latency.md

This runbook addresses slow application requests.

It guides an engineer through investigating latency metrics, affected services, and potential dependencies.

16.3 Kubernetes Node Not Ready

runbooks/kubernetes-node-not-ready.md

This runbook covers Kubernetes node availability issues.

It helps an engineer investigate node conditions and workload impact.

16.4 Low Disk Space

runbooks/low-disk-space.md

This runbook covers filesystem capacity problems and the operational checks needed to investigate low available disk space.

16.5 Excessive Pod Restarts

runbooks/pod-excessive-restarts.md

This runbook covers unstable pods and repeated container restarts.

It provides a structured starting point for investigating application crashes and Kubernetes workload health.

The runbooks help turn monitoring signals into actionable operational procedures.

[SCREENSHOT 24: Insert a screenshot of the runbooks/ directory showing all five runbooks.]

17. Testing and Validation Strategy

An important part of the project was validating the individual components rather than assuming that successful installation meant everything was working.

I used several validation methods.

17.1 Application validation

The three FastAPI services were tested through their health endpoints.

The project also included an end-to-end order request through the API Gateway.

The request successfully passed through the Order Service and Payment Service.

Payment approval was simulated.

17.2 Kubernetes validation

I checked:

  • Namespace creation
  • Deployment readiness
  • Pod status
  • Service availability
  • Container security settings
  • Resource requests and limits
  • Health probes

17.3 Prometheus validation

I confirmed that the application targets were being scraped.

The following query was useful:

up{namespace="microservices"}

All three application services returned healthy scrape results during validation.

17.4 Grafana validation

I validated the three dashboards and their ten panels.

The infrastructure and service overview dashboards provided the intended monitoring views.

The application log volume panel showed logs from all three services.

The two application error panels remained configured but did not have matching ERROR events in the final validation window.

17.5 Loki validation

I queried Loki using LogQL and confirmed that application logs were available.

The log stream included structured fields such as:

namespace
service
level
pod
container

17.6 Tempo validation

I generated an application request and searched Tempo using TraceQL.

The search returned a matching API Gateway trace for POST /orders.

17.7 Alerting validation

I reviewed the five Grafana-managed alert rules.

I also tested SMTP delivery and triggered the High p99 Latency rule temporarily.

An actual alert email was received.

The Low Disk Space rule retained an evaluation-value discrepancy that requires further investigation.

17.8 CI validation

The Jenkins pipeline completed its report-only validation successfully.

It performed Python compilation, health smoke tests, Docker image builds, Ansible image checks, and Trivy scans.

Image publishing remained disabled during that validation.

[SCREENSHOT 25: Insert a collage or separate screenshots showing Prometheus, Grafana, Loki, Tempo, and Jenkins validation.]

18. Challenges Encountered and How I Addressed Them

Building the platform was not simply a matter of installing software.

Several challenges required investigation and correction.

18.1 Kubernetes resource constraints

Running several observability components alongside application workloads requires sufficient memory and CPU.

I encountered resource pressure while working with the local Minikube environment.

I adjusted the Minikube Docker memory allocation and used resource controls to manage the workloads.

This reinforced the importance of capacity planning, especially when running a full observability stack locally.

18.2 Loki log-processing configuration

One of the more interesting challenges involved container log processing in Alloy.

The initial pipeline used the CRI processing stage.

However, the actual log format required Docker-compatible processing.

I changed the pipeline to use:

stage.docker {}

I also introduced JSON extraction for the timestamp, level, and service fields.

This improved the processing pipeline and allowed structured application log fields to be used in Loki queries.

18.3 Alert notification configuration

Configuring email notifications required more than simply enabling SMTP.

I needed to:

  • Store SMTP credentials securely.
  • Expose the credentials to Grafana.
  • Configure the SMTP relay.
  • Configure a Grafana contact point.
  • Create notification policies.
  • Associate alert rules with the correct routing labels.
  • Test actual email delivery.

The successful test email and High p99 alert email confirmed that the notification path was working.

18.4 Trivy vulnerability findings

The image scans identified multiple HIGH-severity operating-system package findings.

Rather than hiding the results or claiming that the images were vulnerability-free, I investigated the findings and compared available base-image options.

The strict pipeline failure and report-only success also demonstrated why security findings should be handled deliberately in CI.

18.5 Distinguishing configured queries from validated queries

Another lesson came from the application error panels.

A LogQL query can be syntactically correct but return no results if matching events do not exist in the selected time range.

I confirmed that Loki was receiving application logs, but no matching ERROR events were available during the final validation window.

This reinforced an important operational principle:

A successful configuration is not automatically proof of successful functional validation.

18.6 Grafana Low Disk Space evaluation

The Low Disk Space rule exposed another issue.

Direct Prometheus queries showed approximately 90.17% available filesystem capacity, but the Grafana alert detail displayed an evaluation value of zero.

The discrepancy was not treated as a successful alert validation.

It remains an item for further investigation.

These challenges helped make the project more realistic because production engineering involves understanding and resolving problems, not only deploying tools.

19. Final Technology Stack Summary

The completed platform brings together the following technologies.

Technology Role in the project
Python Application development
FastAPI Microservices API framework
Docker Application containerization
Docker Compose Local multi-container validation
Kubernetes Container orchestration
Minikube Local Kubernetes environment
Helm Kubernetes application and observability deployment
GitHub Source code and configuration version control
Jenkins Continuous Integration pipeline
Argo CD GitOps application management
Prometheus Metrics collection
Grafana Dashboards, exploration, and alerting
Loki Centralized log storage and querying
Grafana Alloy Kubernetes log collection and processing
OpenTelemetry Application instrumentation and trace export
Tempo Distributed trace storage and exploration
Alertmanager Component included in the monitoring stack
Brevo SMTP Email relay for Grafana notifications
Ansible Local Docker image validation automation
Trivy Container image vulnerability scanning

20. Project Repository Structure

The repository is organized to separate application code, infrastructure configuration, observability resources, automation, and documentation.

The main structure is:

microservices-observability-platform/
│
├── app/
│   ├── api-gateway/
│   ├── order-service/
│   └── payment-service/
│
├── ansible/
│   ├── ansible.cfg
│   ├── inventory.ini
│   └── playbooks/
│       └── validate-images.yml
│
├── docker/
│   └── docker-compose.yml
│
├── docs/
│   ├── architecture/
│   │   └── architecture.mmd
│   └── evidence/
│       └── application-validation.md
│
├── kubernetes/
│   ├── application/
│   ├── namespaces/
│   └── resources/
│
├── observability/
│   ├── alloy/
│   ├── loki/
│   ├── prometheus/
│   ├── tempo/
│   └── kube-prometheus-stack-values.yaml
│
├── runbooks/
│   ├── high-http-error-rate.md
│   ├── high-p99-latency.md
│   ├── kubernetes-node-not-ready.md
│   ├── low-disk-space.md
│   └── pod-excessive-restarts.md
│
├── tests/
│   └── test_services.py
│
├── .gitignore
├── .trivyignore.yaml
├── Jenkinsfile
├── LICENSE
└── README.md

This structure makes it easier to understand where each component belongs and how the different parts of the platform relate to one another.

[SCREENSHOT 26: Insert a terminal screenshot showing the repository structure.]

21. What I Learned from Capstone 2

This project significantly strengthened my understanding of Platform Engineering.

Some of my most important lessons were:

1. Application deployment is only one part of platform engineering

Getting an application running is important, but engineers also need to consider monitoring, logging, tracing, security, automation, and operational support.

2. Observability requires multiple complementary signals

Metrics, logs, and traces answer different questions.

Prometheus helped me understand system behaviour through metrics.

Loki provided centralized application logs.

Tempo helped me follow requests across the application.

Grafana brought these signals together for exploration and monitoring.

3. Kubernetes requires resource and security awareness

A cluster is not simply a place to run containers.

Workloads need resource requests and limits, health checks, appropriate security contexts, and sensible namespace organization.

4. Automation improves consistency

Jenkins and Ansible helped turn manual validation activities into repeatable pipeline steps.

Argo CD introduced the GitOps approach to application management.

5. Security scanning should influence engineering decisions

Trivy demonstrated that successful image builds do not necessarily mean secure images.

Security findings must be investigated, documented, and handled through a deliberate remediation process.

6. Alerting must be tested end to end

Creating an alert rule is not enough.

The complete notification path must be tested, including evaluation, routing, contact points, SMTP configuration, and actual delivery.

7. Documentation is part of engineering

The runbooks, architecture diagrams, validation evidence, and configuration files make the platform easier to understand, troubleshoot, and maintain.

22. Conclusion

Completing this second Platform Engineering capstone gave me the opportunity to bring several important cloud-native engineering practices together in one project.

I built and containerized a three-service FastAPI application, deployed it to Kubernetes, configured application and infrastructure monitoring, centralized logs, implemented distributed tracing, created Grafana dashboards, configured operational alerts, tested email notifications, introduced Jenkins CI, integrated Ansible validation, and scanned container images with Trivy.

I also worked through real troubleshooting scenarios involving Kubernetes resource constraints, Alloy log processing, Grafana notification configuration, and vulnerability scanning.

The project was a reminder that a platform is more than a collection of tools.

It is the combination of application workloads, infrastructure, automation, observability, security controls, and operational procedures that allows software systems to be deployed and managed reliably.

There are still documented follow-up items, particularly the Grafana Low Disk Space evaluation discrepancy, the outstanding HIGH-severity operating-system package findings, and validation of application error panels using matching ERROR events.

I consider documenting these limitations part of responsible engineering rather than hiding them behind a successful deployment status.

Most importantly, this capstone has helped me connect the concepts I have been learning into a practical end-to-end Platform Engineering implementation.

Capstone 2 completed.

References and Official Documentation

The following resources were useful throughout the project and are also valuable for anyone who wants to explore the technologies further.

Project Links

GitHub Repository: [Insert your public project repository URL]

Project Portfolio: [Insert your portfolio URL]

Author: Jamiu Olatunji Bakre

Project: Platform Engineering — Capstone 2

A Friendly Reminder to Laravel Developers: Don't Skip PHP Fundamentals. 2026-12-03

I've noticed that developers sometimes focus so heavily on learning Laravel that they underestimate the importance of understanding PHP itself.

Laravel provides excellent abstractions, convenient syntax, and built-in tools that make backend development much more productive.

However, knowing how to use Laravel doesn't automatically mean you understand the PHP code and concepts behind your application.

Let me demonstrate with a practical example.

1. Understand PHP before relying on framework abstractions

Imagine you're building a notification system.

Your application needs to send notifications, but you want to keep notification logic independent of the delivery method.

You can achieve this using native PHP features such as interfaces, classes, constructor injection, and type declarations.

Example: Plain PHP

<?php

interface NotificationSender
{
    public function send(
        string $recipient,
        string $message
    ): void;
}

final class LogNotificationSender implements NotificationSender
{
    public function send(
        string $recipient,
        string $message
    ): void {
        error_log("To {$recipient}: {$message}");
    }
}

final class WelcomeService
{
    public function __construct(
        private NotificationSender $sender
    ) {}

    public function sendWelcome(string $email): void
    {
        $this->sender->send($email, 'Welcome!');
    }
}

$welcome = new WelcomeService(
    new LogNotificationSender()
);

$welcome->sendWelcome('[email protected]');

Notice what PHP gives us:

  • Interfaces: Define contracts that different implementations must follow.
  • Type declarations: Specify expected parameter and return types.
  • Constructor injection: Pass dependencies into a class.
  • Encapsulation: Separate responsibilities between different classes.

These are PHP language features, not Laravel-specific features.

2. Understand what Laravel does with these concepts

Laravel makes dependency management more convenient through its Service Container.

For example, you can register an interface-to-implementation binding inside AppServiceProvider:

use App\Contracts\NotificationSender;
use App\Services\LogNotificationSender;

public function register(): void
{
    $this->app->bind(
        NotificationSender::class,
        LogNotificationSender::class
    );
}

Then Laravel can automatically inject the required dependency:

final class WelcomeController
{
    public function __construct(
        private WelcomeService $welcome
    ) {}

    public function __invoke(): string
    {
        $this->welcome->sendWelcome(
            '[email protected]'
        );

        return 'Welcome notification processed.';
    }
}

What's happening here?

Laravel's Service Container resolves the controller, constructs WelcomeService, and resolves NotificationSender using the binding we registered.

But the underlying concepts are still PHP classes, interfaces, type declarations, and constructors.

Laravel organizes and automates dependency resolution. PHP provides the language features that make this architecture possible.

3. PHP fundamentals every Laravel developer should understand

I would recommend paying particular attention to these concepts:

Object-oriented programming (OOP)

Understand classes, objects, inheritance, abstraction, encapsulation, and polymorphism.

Interfaces and traits

Learn how to define contracts and reuse behavior across classes.

Namespaces and autoloading

Understand how PHP organizes classes and how Composer automatically loads them.

Type declarations

Learn parameter types, return types, nullable types, union types, and strict typing.

Exception handling

Understand how PHP throws and catches exceptions and how errors differ from exceptions.

Closures and anonymous functions

These are particularly useful when working with Laravel routes, callbacks, collections, and configuration.

Composer and dependency management

Understand how PHP packages are installed, managed, and loaded.

Memory management and execution

Learn how PHP executes scripts, handles processes, and manages memory.

These concepts help you understand what happens underneath Laravel's abstractions.

4. PHP isn't limited to Laravel applications

PHP has its own command-line execution environment.

For example:

php scripts/process-orders.php

You can execute PHP scripts directly without bootstrapping a Laravel application or running a web server.

You can also build:

  • Standalone CLI applications.
  • Automation and maintenance scripts.
  • Reusable Composer packages.
  • File-processing utilities.
  • Background processing tools.
  • Applications using other PHP frameworks or no framework at all.

This is another reason developers should understand the language independently of their framework.

5. My advice to Laravel developers

I'm not suggesting that developers should stop using Laravel or start implementing everything from scratch.

Laravel exists to make development more organized, productive, and maintainable.

But don't let the convenience of a framework prevent you from understanding the language underneath it.

Learn PHP fundamentals first, understand the abstractions Laravel provides, and then learn when and why to use them.

A strong Laravel developer should be comfortable reading Laravel code, understanding the underlying PHP behavior, and writing PHP outside the Laravel ecosystem when necessary.

That's an important step toward becoming a better backend engineer.

A framework should accelerate your development, not replace your understanding of the programming language.

Official documentation:

Hope this helps developers who are learning Laravel! 🚀

Building an ATS CV checker for UK, UAE and German job ads: lessons from 390 CVs 2026-12-03

I started building FixerCV in June 2026. It's a CV checker (a resume checker, if you're in the US). You upload your CV, paste the job ad and pick the country you're applying in. About 30 seconds later you get an ATS score, the keywords from the ad that your CV is missing, and your top 3 issues, with the fix for the first one.

There's no sign-up. That was the first decision, and most of the others followed from it.

Why no sign-up

Most CV checkers ask you to make an account before they show you anything, and many cap free scans per week or month. I wanted the opposite. Someone with an application due tonight should see what's wrong with their CV straight away, without handing over an email address first.

No accounts has a cost. You can't limit use per person, so you limit it per network: today that's 5 free checks an hour. A school computer room shares one network, so the links we give schools get a bigger cap.

It also shaped how files are handled. The upload is read into plain text (unpdf for PDFs, mammoth for Word files) and the file itself is thrown away. The text and results are deleted after 90 days.

What I learned getting a model to check CVs

The stack is plain: Next.js and TypeScript on Vercel, Supabase, Stripe, and Claude to read the CV. The hard part wasn't the stack. It was getting a language model to act like a careful recruiter rather than a confident one.

Three things mattered most.

1. A score built from parts. At first I asked the model for one number. It kept giving the same few values (58, 62, 72) to very different CVs. Now the score is the sum of six parts, each with a fixed maximum: keyword match (30), results and scale (25), sections and order (15), clean formatting (15), clarity and length (10) and contact details (5). Keyword match isn't judged at all. It's calculated from two lists: the ad's keywords the CV shows, and the ones it's missing. Scores spread out, they stay steady between runs, and the results page can show where the points went.

2. Rules against invention. The model must never invent numbers or achievements. It must never change a job title, an employer or a date. With a job ad, missing keywords must come from that ad, not from a generic list. Where a bullet clearly had a size but no figure, it writes a placeholder like [N] for the person to fill in. A CV with a made-up number in it is worse than a CV with a gap.

3. Honest words about ATS. An applicant tracking system stores applications and lets recruiters search and filter them. So the model isn't allowed to say a system "rejects" a CV. It says the CV is unlikely to be found or shortlisted, and explains why.

Two smaller lessons. Long CVs checked against long job ads sometimes hit the token limit halfway through the JSON. The parser now cuts back to the last complete item and closes the brackets. And the model doesn't know today's date: a recent report talked about a UK logistics role "in 2024". The check and the rewrite now get today's date in every prompt.

What 390 CVs showed

In November I published the FixerCV CV Report 2026: 390 CVs checked on the site between 7 August and 21 November 2026.

  • The median ATS score was 66 out of 100. Only 2% scored 85 or more.
  • 106 of those CVs were checked against a real job ad. 92% of them missed 5 or more of the ad's keywords, and 68% missed 10 or more.
  • 83% had no measurable results.
  • 75% listed duties rather than what the person achieved.
  • 63% had a summary that needed work.
  • 48% had no LinkedIn or portfolio link.

Some caveats. The sample is self-selected: people who chose to check their CV, not a random slice of job seekers. The score is our estimate, not what any employer's system shows. And the report spans the switch to the six-part score in October, so treat the median as a rough guide.

The most common gaps in the report were about content: keywords the ad asked for, and results with a number on them.

The full method is in the report, and the data is free to reuse under CC BY 4.0, with credit to "FixerCV CV Report 2026".

The same CV, three countries

People checked CVs for jobs in the UK, the US, the Gulf, Nigeria, India and elsewhere. A CV that's right in one country can be wrong in another:

  • UK: usually two pages. No photo and no date of birth.
  • UAE and the Gulf: recruiters expect your nationality, visa status and notice period near the top. A professional photo is common.
  • Germany: the Lebenslauf is usually a table, with dates on the left and roles on the right, newest first, one to two pages, with month and year for each role (03/2023 – heute). A photo and a date of birth are still common, but neither is required.

So the country is an input to the check, not an afterthought. A photo that's common in Dubai is one most UK employers would rather you left off.

What I'd do differently

  • Build the score from parts on day one. One number from a model looks precise and isn't.
  • Make the job ad harder to skip. Only 106 of the 390 CVs came with a usable job ad, and you can't compare a CV with an ad you don't have.
  • Give the model today's date in the first prompt, not after a report gets the year wrong.

Borrow the data

The full numbers and method are in the FixerCV CV Report 2026.

If you've built something that reads CVs or other messy PDFs, I'd like to hear how you handled scoring and made-up numbers. Comments are open.

Orhan

This article was created with the help of AI: an AI assistant wrote it from our code history and the FixerCV CV Report 2026, and each figure was checked against the report.