October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk3 min

Microservices Part 6: Trace One Request Through the Logs

Use a shared x-request-id and JSON log fields to connect a successful or failed Bean There request across orders-api and catalog-api in Light Cloud.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To follow one request across orders-api and catalog-api on Light Cloud, give it a request ID, forward it in an x-request-id header, and include it in each service’s JSON log entries. The same ID in both Logs tabs lets you connect the events for a successful order or investigate a failed one.

What this workflow does—and what it does not

This tutorial applies to the Bean There microservices project and Light Cloud’s Logs tab. Each API keeps an incoming request ID or creates one, returns it in its response header, and records it in logs. When orders-api calls catalog-api, it forwards the same ID so the two services’ records can be searched together.

As an Amazon Associate I earn from qualifying purchases.

This is a way to correlate log entries for the example request. It is not evidence that the setup replaces a full distributed tracing system, and the tutorial does not describe propagation through asynchronous messages.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Prerequisites and source code

Start with the Bean There project from Parts 1–5. You need Git and a terminal with curl; in PowerShell 7 on Windows, use curl.exe. The code is in the tutorial-microservices repository at its part-6 tag: tutorial-microservices, part-6.

Both APIs change in this installment, so redeploy orders-api and catalog-api before testing. The tutorial’s curl examples use placeholder deployment hostnames; replace them with the endpoint for your own deployment.

Establish a request ID at the service boundary

The example middleware in each service checks for x-request-id. If the header is present, the service keeps that value; if it is absent, the service creates a UUID. Each API adds the resulting ID to its response header, so a caller can obtain it from the response or from the first log entry.

For a production request that arrives without an ID, the first service should create it. Do not let a browser choose the ID. This keeps creation at the service boundary while allowing downstream services to use the same correlation value.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Forward the same ID between services

When orders-api calls catalog-api, it sends the ID in the downstream request’s x-request-id header. The catalog service retains that received ID instead of generating a new one. This continuity is what makes entries from the two APIs searchable as parts of one request.

Write structured log records

Each service writes one JSON object per line. Include the request ID, service name, severity, and message; the tutorial’s example fields are requestId, service, severity, and message. Light Cloud’s Logs tab reads severity to set the entry level and support its level filter.

The Python example in orders-api serializes the object, prints it, and flushes output. The JavaScript example in catalog-api serializes an object to the console. Keeping the fields consistent across the services makes it easier to recognize related entries, while the service and message fields explain what each entry records.

Follow a successful order in the Logs tabs

  1. Submit an order to the deployed orders-api using the tutorial’s curl request, with your own deployment endpoint in place of the placeholder hostname.
  2. Obtain the request ID from the response header or the first orders-api log entry.
  3. Open the Light Cloud Logs tab for orders-api and search for that exact ID.
  4. Open the Logs tab for catalog-api and search for the same ID.

The example’s related entries include messages such as “placing order,” “order placed,” and “reserved stock.” Their timestamps and shared request ID show the request’s path through the two services; the messages distinguish each service’s part in it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Find and follow a failed request

The tutorial’s failure case submits an order for a product that does not exist. The API returns 404 Product not found. The example records a warning, and Light Cloud marks HTTP request logs with 4xx status codes as WARNING.

Best Value
Grooved Writing Books for Kids 3-5 - Magic Grooved Writing Practice
  • Develop Handwriting Skills with Complete Grooved Writing Books for Kids 3-5. Preschool learning toys packed with activities that engage hands-on learners, this 5-book set includes 2 magic pens, 10 disappearing ink refills, 2 soft pencil grips, and a sticker sheet. Ideal for screen-free entertainment and fine motor skill growth. Fun, learning toys for 4 year old for home use or classrooms, supporting early learning and creative self-expression.
  • Spark Confidence with 48 Engaging Activities Across 5 Reusable Kids Books. Grooved Tracing Books for Kids Ages 3-5 feature letter tracing, counting, early math and word recognition. This spiral-bound set strengthens fine motor development while fostering STEAM learning through play. Perfect gifts for 5 year old girls or gifts for 3 year old boys that are ready to boost literacy skills at school, home, or during holiday breaks.
  • Make Learning to Write Exciting Using Magic Pens with Disappearing Ink! Ideal 4 year old boy toys for sensory-friendly and neurodiverse learners. Grooved handwriting practice for kids 5-7 improves coordination and focus while enjoying calming, screen-free learning toys for 4+ year old children that’s great for quiet time, travel, or educational play. Thoughtful gifts for 5 year old girls or gifts for 4 year old boys that inspire writing practice and imagination development.
  • Encourage Creativity and Skill Building with Magic Grooved Writing Practice for Kids Age 3-5. Features vivid pages, spiral binding, and left and right-hand accessibility. Designed for durability and comfort, this colorful writing practice set is a standout among Christmas gifts for grandkids and 4 year old girl birthday gifts. Ideal educational toys for 4 year old boys and girls for preschool classrooms or home settings, it blends learning with artistic expression to inspire young writers.
  • Fun and Educational Christmas Gifts for Kids. These activity books for 3 year olds combine educational fun and writing skill growth in one engaging experience. Loved by parents and teachers, these Christmas gifts for girls and boys strengthen hand-eye coordination, support screen-free learning, and make Christmas, birthdays or back to school gifting easy. Add to Cart now to surprise a young learner with hours of joyful writing discovery!
  1. In the Logs tab for orders-api, select the warnings-and-above filter to narrow the entries.
  2. Open the warning entry for the failed request and note its request ID.
  3. Search for that same ID in the catalog-api Logs tab to inspect the related service entries.

The filter helps surface a warning, but the request ID is the link between the services. Searching the exact ID in both tabs lets you move from the failed order to the catalog-side record without relying on the message text alone.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.