Blog Post

Monday Monitor Tips: Finding the Hostname for Queries

,

I was chatting with a customer recently and they wanted to know which host was sending in queries that were causing problems in real time. This post looks at where you can find the hostname for running queries, which is in two places.

This is part of a series of posts on Redgate Monitor. Click to see the other posts.

The Server Overview

There are two places where you can see the host name. From the server overview, you can go to the current activity, or the new Query Executions tab in preview.

Current Activity

In the server overview, there is a lot of data, but most people scroll down to see the list of queries, such as this list from the ssc-db-n3 instance.

2025-04_0089

There is the database and lots of data, but no hostname. The reason is that these are aggregates. Each of these queries has run many times, possibly from different hosts. This is a historical view.

The better way to look for details on certain problem queries now is to look for current activity. I’ve zoomed in and highlighted this item below.

2025-04_0090

If I click that, I get an sp_who, or sp_whoisActive view of the server, and I can see the logins listed here. That’s helpful.

2025-04_0091

Still no hostname, but if I pick a query from a login, and see the details, I see this view.

2025-04_0092

In the lower left corner, I get the hostname. I’ve zoomed in below.

2025-04_0093

We could add that in the main box, but we’re trying to surface the most important info, and for most of our customers, that isn’t the hostname. However, we have added it in the detail.

If you’re like it in the main box, or would like to choose which fields are there (maybe host and not program?), send us a note to your rep or to sales@red-gate.com.

Query Executions

For some of our servers, we have a new Query Executions tab that uses Extended Events to get some data. The Workload02 system has this enabled. You can see the tab at the top, and then the view of this below.

Query Execution tabs

If I zoom in to the lower right, you can see the hostname as part of the details for query executions, along with other data. As you are examining the details of those queries which have run for over 5 seconds, you can get the metadata about the host, application, and more.

Zoom in to hostname details

Summary

Hostnames are available, you just need to learn where to look. Hence this post. Hopefully this gives you a quick tip on how to find them.

Redgate Monitor is a world class monitoring solution for your database estate. Download a trial today and see how it can help you manage your estate more efficiently.

Original post (opens in new tab)
View comments in original post (opens in new tab)

Rate

You rated this post out of 5. Change rating

Share

Share

Rate

You rated this post out of 5. Change rating