Learning paths / Operate your application / Observability basics

Try it: a tour of your service's Logs, Metrics and Traffic tabs

Reading · 8 min · Module 1, lesson 3 of 413 min left in this module

Module 1 · Observability basicsLesson 3 of 4

Goal: Find logs, latency, traffic, errors and saturation for your own service.

You need hello-web Running, from lab 5.1.4, and csph signed in (lesson 5.1.1).

Deleted hello-web since Path 5?

Deploy it again; you don't need the health check for this tour:

csph deploy --image quay.io/computesphere/learn-hello-web:1.0.0 --name hello-web --port 8080
  1. Send it some traffic

    Put your URL in a variable (it's on hello-web's page in the console), then send 60 requests to the home page and 60 to a page that doesn't exist:

    URL=https://<your-hello-web-url>
    for i in $(seq 1 60); do
      curl -s -o /dev/null -w "%{http_code} " "$URL/"
      curl -s -o /dev/null -w "%{http_code} " "$URL/missing"
    done; echo
    

    You should seea long row of 200 and 404 codes.

  2. Read the runtime log

    In the console, open hello-web, choose the Logs tab, then Runtime. Or from the terminal:

    csph logs hello-web
    

    hello-web logs when it starts and nothing per request. What an app logs is up to the app, which is why the next lesson's sample logs every request.

    You should seea line ending hello-web 1.0.0 listening on :8080, and nothing for your 120 requests.

  3. Read the deploy log

    Choose Deploy next to Runtime, or run:

    csph logs hello-web --kind deploy
    

    This is ComputeSphere's record of starting your app, not your app's output. csph puts the newest event at the top, so read it from the bottom up.

    You should seethe steps of your last rollout. The console ends in Live; csph lists the newest event first.

  4. Open the Metrics tab

    These are the saturation graphs. They lag a few minutes, so a brand-new service can show nothing yet. hello-web is tiny, so CPU sits close to zero and memory at a few MB, far below a Flex spherelet's 0.25 vCPU and 512 MB.

    You should seeCPU in vCPU, Memory, and Spherelets at 1.

  5. Open the Traffic tab

    The 4xx bar is your /missing requests. Requests shows request volume over the time range, not a count of your 120 calls, so it can be a small number with decimals. Traffic lags about three minutes: if the charts are empty, wait and open the tab again.

    Check yourself

    You deploy a new version and want to know if it's failing more requests than the last one. Where do you look first?

    You should seea Requests figure, a p95 latency figure, and a Status breakdown with a 2xx bar and a 4xx bar of about the same size.

The rest of this path uses a different sample. On the free trial, which runs two Flex spherelets at a time, delete hello-web now so the labs have room:

csph services list
csph services delete <hello-web-service-id>

In the docs