My First Grafana Asserts

So now you have Grafana Cloud setup and you want to try Asserts? Well you have come to the right place. In this post I will show you how to enable and configure asserts. Then we will run a command inside a container to simulate an out of memory killer so you can see Asserts in action. Ready?

Let’s get started

Login to your Grafana Cloud Account that you configured as part of an earlier post. If you have not followed those steps this won’t work. Don’t worry, go to the post and configure everything and I will wait right here for you! .

Navigate to Asserts then click Get Started

Make sure cluster is set for environment and leave everything else as default.

Click to select all and click Test and Save

Yay, we are good to go

Navigate back to Asserts and notice that it is still setting up. Now is a perfect time to go grab a coffee or tea. It will take a few minutes to configure.

Welcome back! After a few minutes you should see the following page, click show all services.

Now you should see the following with all your services

Now let’s simulate a problem so Asserts can pick it up. Go back to your command line where kubectl and your cluster are and change to the opentelemetry-demo namespace

kubectl config set-context --current --namespace=opentelemetry-demo

Then get the pod names with the following:

kubectl get pods

Now copy the adservice pod name to the following command so we can open a shell to that pod. Notice you need to have it match what you get above

kubectl exec --stdin --tty adservice-yournumberhere -- /bin/bash

At the prompt enter the following and press enter

tail /dev/zero

Now type the following and you will see the pod restarted

kubectl get pods

Do this over and over a couple times until the pod crashes and you see the following

After doing this a few times go back to Grafana Cloud Asserts:

  1. Change the time to Last 5 Minutes
  2. Click refresh
  3. Select the adservice
  4. Click Troubleshoot in Workbench

Hover over the red zone and see what Asserts Picked up

Now you have a solution that can detect issues in your application before they become an outage or lost customers. To learn more head on over to Grafana.com

Remember sharing is caring!

One Reply to “My First Grafana Asserts”

  1. Pingback: My First Grafana Cloud – RyanKellysBlog.com

Leave a Reply

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

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.