Setting Up Dynatrace
Tags: devops, monitoring
Published: 2022-10-07 18:57:30

---
title: Setting Up Dynatrace
published: true
date: 2022-09-30 22:27:04 UTC
tags: devops, monitoring
canonical_url: https://www.lkhrs.com/blog/2022/09/setting-up-dynatrace/
---

I’m learning more about DevOps stuff, so I’ve been looking into monitoring solutions used in large enterprise environments.

Dynatrace is an “all-in-one intelligence platform”, which is marketing-speak for monitoring, analytics, and reporting, though it does a bit more than that. Enterprises use it to monitor system load statistics from servers, containers, and cloud platforms, as well as individual application monitoring, tracing, network performance, and continuous delivery testing. It supports piping in metrics from other providers, too.

Once set up, metrics are available in one place to build dashboards, analyze with queries, generate reports, and other businessy things.

The documentation for [getting started](https://www.dynatrace.com/support/help/get-started) could be better, so I’m writing down my setup process for testing and some cool things you can do.

## Setup

The first thing you’ll need to do is sign up for the free trial. It’s 14-day, no card required, so you won’t get stuck with a surprise enterprise-level bill for monitoring your 2-player Factorio server.

For testing, I recommend the virtual machine route, or [Docker container](https://www.dynatrace.com/support/help/setup-and-configuration/setup-on-container-platforms/docker).

### Install in a VM

I installed the Dynatrace OneAgent on an Ubuntu VM that I spun up using [Multipass](https://multipass.run). If you follow the same route I did and you have an M1 Mac, make sure you use the ARM (AARCH64) version of OneAgent, otherwise it won’t install.

1. Once you’ve got your VM or dumpster-sourced Linux box running, log in to your Dynatrace account. If the panel doesn’t automatically load the “Deploy Dynatrace” page, you’re about to discover the UX wonder called “The Dynatrace Menu”. Click the hamburger icon at the top left of the page, and then head to **Favorites** → **Deploy Dynatrace** :

[![Screenshot of Dynatrace](https://www.lkhrs.com/blog/2022/09/setting-up-dynatrace/image-20220930183602257_hu8ae27336eefac1dd2d12f33a8fbae282_89650_1978x0_resize_q85_bgffffff_box_3.jpg)](https://www.lkhrs.com/blog/2022/09/setting-up-dynatrace/image-20220930183602257.png)

1. Once you’re there, click the **Start installation** button in the bottom right corner.

2. On the **Install OneAgent** page, select the **Linux** platform, and you’ll be presented with this page:

[![Screenshot of Dynatrace](https://www.lkhrs.com/blog/2022/09/setting-up-dynatrace/image-20220930184529122_hu28382e9c4d7c2661e1f6ffc8cc3bbeda_103520_1844x0_resize_q85_bgffffff_box_3.jpg)](https://www.lkhrs.com/blog/2022/09/setting-up-dynatrace/image-20220930184529122.png)

1. You’ll need to generate a PaaS token, which you can do by clicking the **Create token** button on the right.

2. Once you have a PasS token, the installer page will give you three commands to copy and paste into your VM’s shell, in order. The first one downloads the installer, the second one verifies the signature, and the last one runs the installer. You’ll need to run the last one as root.

When it’s done installing, your shell should look similar to mine:

[![Screenshot of Dynatrace](https://www.lkhrs.com/blog/2022/09/setting-up-dynatrace/image-20220930185415805_hu2662f6adce09c25e0919ea3645230aa1_276385_1524x0_resize_q85_bgffffff_box_3.jpg)](https://www.lkhrs.com/blog/2022/09/setting-up-dynatrace/image-20220930185415805.png)

You can verify OneAgent is running with `systemctl status oneagent.service`:

[![Screenshot of Dynatrace](https://www.lkhrs.com/blog/2022/09/setting-up-dynatrace/image-20220930185752544_hu69d443d00e67d54beff101dcdaaf2bb5_256472_1524x0_resize_q85_bgffffff_box_3.jpg)](https://www.lkhrs.com/blog/2022/09/setting-up-dynatrace/image-20220930185752544.png)

## Viewing host performance

Back to your browser, click the **Show deployment status** button on the lower right of the page, and after a small delay your VM will show up on the page:

[![Screenshot of Dynatrace](https://www.lkhrs.com/blog/2022/09/setting-up-dynatrace/image-20220930190051135_hu7d094f1234660ff86bbe254ad8917f7b_66064_1458x0_resize_q85_bgffffff_box_3.jpg)](https://www.lkhrs.com/blog/2022/09/setting-up-dynatrace/image-20220930190051135.png)

Click your host to head over to the details page, where you’ll see some quick stats like CPU, memory usage, and availability.

[![Screenshot of Dynatrace](https://www.lkhrs.com/blog/2022/09/setting-up-dynatrace/image-20220930190709856_hue0e9bf69d2a75dd46222d3a89ccefc69_222724_2422x0_resize_q85_bgffffff_box_3.jpg)](https://www.lkhrs.com/blog/2022/09/setting-up-dynatrace/image-20220930190709856.png)

**Note:** If you see the “improved version” banner at the top of the page, enable it for the new panel design. Now the page should look like this:

[![Screenshot of Dynatrace](https://www.lkhrs.com/blog/2022/09/setting-up-dynatrace/image-20220930191253705_hua9a560e9015f2c1959add02f75910958_185170_2108x0_resize_q85_bgffffff_box_3.jpg)](https://www.lkhrs.com/blog/2022/09/setting-up-dynatrace/image-20220930191253705.png)

Now you’ve got some pretty graphs! My favorite part though is the process analysis area, which saves me a trip to `htop`:

[![Screenshot of Dynatrace](https://www.lkhrs.com/blog/2022/09/setting-up-dynatrace/image-20220930191905104_hu287d02d4e5f29332c695a8889cdec1bd_103128_1782x0_resize_q85_bgffffff_box_3.jpg)](https://www.lkhrs.com/blog/2022/09/setting-up-dynatrace/image-20220930191905104.png)

You can also dive into a single process and see its usage history:

[![Screenshot of Dynatrace](https://www.lkhrs.com/blog/2022/09/setting-up-dynatrace/image-20220930192009335_hu2bf47b3a080bf97d64746a85e5250879_90589_1770x0_resize_q85_bgffffff_box_3.jpg)](https://www.lkhrs.com/blog/2022/09/setting-up-dynatrace/image-20220930192009335.png)

## Working with dashboards

Now imagine you’ve got several hundred of these VMs running (I recommend not imagining the bill). Going to each page is inefficient at best, so let’s make a dashboard to view infrastructure status at a glance.

### Create a new dashboard

1. Open the Dynatrace Menu (sidebar on the left)
2. Navigate to **Favorites** → **Dashboards**

[![Screenshot of Dynatrace](https://www.lkhrs.com/blog/2022/09/setting-up-dynatrace/image-20220930193536184_hu33fe81d46836c29f221a2ac963e00b9b_268084_2300x0_resize_q85_bgffffff_box_3.jpg)](https://www.lkhrs.com/blog/2022/09/setting-up-dynatrace/image-20220930193536184.png)

1. Above the dashboards table, click the **Create dashboard** button
2. Enter a dashboard name
3. Click **Create**

Now you should have a page like this:

[![Screenshot of Dynatrace](https://www.lkhrs.com/blog/2022/09/setting-up-dynatrace/image-20220930202645029_hu8c77317d5ae6bb778e51be22398c5508_50670_2304x0_resize_q85_bgffffff_box_3.jpg)](https://www.lkhrs.com/blog/2022/09/setting-up-dynatrace/image-20220930202645029.png)

Let’s add some widgets! The official tutorial recommends host health and CPU usage, so let’s start with those.

1. In the sidebar on the right, find the **Host health** widget
2. Drag and drop anywhere on the dot matrix

By default, this shows a hexagon per host. You can get more advanced with it and have multiple widgets for different groups, but I won’t get into that right now.

I added some network widgets, so now my dashboard looks like this:

[![Screenshot of Dynatrace](https://www.lkhrs.com/blog/2022/09/setting-up-dynatrace/image-20220930203506110_hu2bba36abccd59dac4639b6c0ce8f8549_32510_1724x0_resize_q85_bgffffff_box_3.jpg)](https://www.lkhrs.com/blog/2022/09/setting-up-dynatrace/image-20220930203506110.png)

We can add CPU usage dashboard widgets for individual hosts, so let’s add one now.

1. Navigate to **Infrastructure** → **Hosts**
2. Open the host we set up earlier
3. Make sure you’re using the new dashboard, as recommended earlier
4. In the **Host performance** group, find **CPU usage** , and click the three dot (•••) button to open the menu
5. Click **Pin to dashboard** , and choose the dashboard we created earlier

[![Screenshot of Dynatrace](https://www.lkhrs.com/blog/2022/09/setting-up-dynatrace/image-20220930203928362_hub463db9646a7fcd104c912b4ca17dfa7_25142_988x0_resize_q85_bgffffff_box_3.jpg)](https://www.lkhrs.com/blog/2022/09/setting-up-dynatrace/image-20220930203928362.png)

Now click the **Open dashboard** button to view the new CPU widget:

[![Screenshot of Dynatrace](https://www.lkhrs.com/blog/2022/09/setting-up-dynatrace/image-20220930204104587_hue6e3bf17f4459178cc0c3ebda0f80c23_75832_2310x0_resize_q85_bgffffff_box_3.jpg)](https://www.lkhrs.com/blog/2022/09/setting-up-dynatrace/image-20220930204104587.png)

### Advanced widgets

Let’s add some widgets for service-level objective (SLO) monitoring and server response time.

For the SLO widget:

1. Find and add the **Service-level objective** widget to the dashboard

By default there are no SLOs created yet, so let’s go define one.

1. Using the Dynatrace Menu, navigate to **Cloud Automation** → **Service-level objectives**

[![Screenshot of Dynatrace](https://www.lkhrs.com/blog/2022/09/setting-up-dynatrace/image-20220930205221748_huce85373d7b2ff75e5ee08e54b47b108b_53492_2318x0_resize_q85_bgffffff_box_3.jpg)](https://www.lkhrs.com/blog/2022/09/setting-up-dynatrace/image-20220930205221748.png)

Since our test VM has no services running yet, let’s manually configure an SLO.

1. Click **Configure SLOs**
2. Click **Add new SLO**
3. Give the SLO a name
4. For the metric expression field, use `builtin:host.availability`
5. Click **Save changes** in the floating modal on the bottom of the screen

Now we need to hook up our SLO widget on the dashboard to the SLO we just created.

1. On the dashboard, click the dropdown chevron on the SLO widget and click **Edit tile**
2. In the sidebar on the right, select the SLO we just created:

[![Screenshot of Dynatrace](https://www.lkhrs.com/blog/2022/09/setting-up-dynatrace/image-20220930205719351_hu9ac655573ac3648ff43f24ccddbb553a_12372_632x0_resize_q85_bgffffff_box_3.jpg)](https://www.lkhrs.com/blog/2022/09/setting-up-dynatrace/image-20220930205719351.png)

1. Turn off **Custom timeframe** , otherwise the default of one week will reflect poorly on our young VM

2. Click **Done**

Now we can keep an eye on how well we’re hitting our SLO:

[![Screenshot of Dynatrace](https://www.lkhrs.com/blog/2022/09/setting-up-dynatrace/image-20220930210124885_huc50654711c8f2e6c817f05a6c94f1259_10959_624x0_resize_q85_bgffffff_box_3.jpg)](https://www.lkhrs.com/blog/2022/09/setting-up-dynatrace/image-20220930210124885.png)

Wow, we’re failing to hit our availability metrics. The default timeframe is 7 days though, and our VM is less than an hour old at this point, so let’s adjust the timeframe: At the top right of the page, after the green **Deploy Dynatrace** button, adjust the timeframe to **Last 30 minutes**.

[![Screenshot of Dynatrace](https://www.lkhrs.com/blog/2022/09/setting-up-dynatrace/image-20220930210324947_hub13bf85c8dbc53e10f0d8b4c280d6a66_10050_616x0_resize_q85_bgffffff_box_3.jpg)](https://www.lkhrs.com/blog/2022/09/setting-up-dynatrace/image-20220930210324947.png)

There we go.

## Monitoring a container

Dynatrace automatically detects new Docker containers and makes them available for monitoring. Let’s spin up a WordPress container.

1. Install Docker in your VM with `sudo apt install docker`
2. Add your user to the `docker` group:
  1. `sudo usermod -a -G docker luke`
  2. `newgrp docker`
3. Pull the WordPress image: `docker pull wordpress`
4. Run the container: `docker run --name super-hexablog -d wordpress`

To view stats about the container in Dynatrace, wait about 2 minutes, and then head over to **Infrastructure** → **Containers** :

[![Screenshot of Dynatrace](https://www.lkhrs.com/blog/2022/09/setting-up-dynatrace/image-20220930214812401_hu4c48c49a60d25af244c3335561b57872_55481_2370x0_resize_q85_bgffffff_box_3.jpg)](https://www.lkhrs.com/blog/2022/09/setting-up-dynatrace/image-20220930214812401.png)

Clicking our `wordpress` container takes us to a performance metrics page:

[![Screenshot of Dynatrace](https://www.lkhrs.com/blog/2022/09/setting-up-dynatrace/image-20220930215055489_hu90107f2940eef89aa3ba9bdcf1c5a7bc_71723_2278x0_resize_q85_bgffffff_box_3.jpg)](https://www.lkhrs.com/blog/2022/09/setting-up-dynatrace/image-20220930215055489.png)

## Setting up problem alerting

I want to get notified when my web server crashes, so let’s set up some basic problem alerting.

1. Head to **Infrastructure** → **Technologies** → **Apache HTTP Server**
2. Click the **Settings** button
3. Click **Availability monitoring** in the sidebar
4. Enable **Process group availability monitoring**
5. Under **Open a new problem** , select **If any process becomes unavailable**

And I’d like to get emailed when things catch on fire:

1. Navigate to **Manage** → **Settings** → **Integration** → **Problem notifications**
2. Click **Add notification**
3. Under **Notification type** , select **Email**
4. Give it a name
5. Click **Save changes** in the floating modal at the bottom of the page

[![Screenshot of Dynatrace](https://www.lkhrs.com/blog/2022/09/setting-up-dynatrace/image-20220930224131159_huee2e7dfdf5ac4e2382a7083b3435afdc_39685_1732x0_resize_q85_bgffffff_box_3.jpg)](https://www.lkhrs.com/blog/2022/09/setting-up-dynatrace/image-20220930224131159.png)

Let’s test it out! In our VM, run `docker stop super-hexablog`. Within about a minute, you should see a red notification at the top of the page. Clicking it takes you to the **Problems** view:

[![Screenshot of Dynatrace](https://www.lkhrs.com/blog/2022/09/setting-up-dynatrace/image-20220930224906642_hud95ce060f0650bf9d7718e748956cfee_73417_2290x0_resize_q85_bgffffff_box_3.jpg)](https://www.lkhrs.com/blog/2022/09/setting-up-dynatrace/image-20220930224906642.png)

You can also drill down into problems and see what Dynatrace thinks is the root cause:

[![Screenshot of Dynatrace](https://www.lkhrs.com/blog/2022/09/setting-up-dynatrace/image-20220930225145868_hu4d7ad124bb208619f10e8cbcbd22bab4_103407_2280x0_resize_q85_bgffffff_box_3.jpg)](https://www.lkhrs.com/blog/2022/09/setting-up-dynatrace/image-20220930225145868.png)

## Conclusion

I really like how the Dynatrace agent can detect new things on a host with no configuration needed. And it’s easy to go from a bird’s-eye view of your entire fleet to analyzing the details of an individual process.

I plan to look at Datadog next. Prometheus + Grafana looks like a great open source option, I’m interested in seeing how they all compare. I’ve seen PromGraf used a lot for homelab setups.

[Reply via email](mailto:hi@lkhrs.com?subject=Re:%20Setting%20Up%20Dynatrace)