Monday Monitor Tips – Adding Redgate Monitor Custom Metrics from SQLMonitorMetrics

This post talks about adding custom metrics from the sqlmonitormetrics.com site automatically and how this works (and how it doesn’t).

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

What is SQL Monitor Metrics?

SQLMonitorMetrics was a site that Redgate built years ago to hold various community submitted metrics that users of Redgate Monitor (formerly SQL Monitor) might care about or be interested in using. Myself, Grant, and a number of other MVPs and SQL Server experts submitted our own metrics in various categories.

At some point an integration was created to make the install of these metrics easy. This post shows how to do this and not to do this below.

How to Auto Install Metrics

The proper way to install metrics is to start in Redgate Monitor. Go to the config screen by clicking the gear in the upper right.

2024-07-02 14_37_58-Global Dashboard — Mozilla Firefox

Next, in the Alerts section pick the custom metrics and alerts item. Click this.

2024-07-02 14_38_43-Configuration — Mozilla Firefox

This brings up a list of your custom metrics. In the text at the top, it says you can install a metric automatically, but you need to click the link my cursor is highlighted on below.

2024-07-02 14_39_14-Custom metrics and alerts — Mozilla Firefox

This brings me to the sqlmonitormetrics site. I’ll click find a metric. I could also click the Custom Metrics at the top.

2024-07-02 14_40_42-Redgate Monitor Metrics - Custom metrics to use in Redgate Monitor — Mozilla Fir

I’ll select the first one for this post, but you can filter, search, or scroll around to find one.

2024-07-02 14_40_51-Custom Metric Archives - Redgate Monitor Metrics — Mozilla Firefox

The page for the custom metric has a button at the top. Please read the page and test the SQL to see what’s returned before you click this, but when you’re ready, click the button.

2024-07-02 14_42_59-Detecting Connection Timeouts - Redgate Monitor Metrics — Mozilla Firefox

When I do this, I’m returned to Redgate Monitor, this time on the Create Custom Metric page, with the fields filled in. As with anything, be sure you review and check to be sure this is what you want.

2024-07-02 14_43_49-Custom metrics — Mozilla Firefox

That’s it. When you’re done, click create and your metric and/or alert will be set up.

How Not to Install Metrics

This works, but it’s a pain. If I go directly to https://sqlmonitormetrics.red-gate.com/ and then find a metric, such as the number of active backups and restores, I see this, an inactive button:

2024-07-02 14_45_56-Number of active backups and restores - Redgate Monitor Metrics

Because I didn’t start from Redgate Monitor, I can’t get this automatically.

If I scroll down, I see all the fields (in bold) and the entries. I can copy/paste all of these into the form, but this is a slow way to add metrics.

2024-07-02 14_46_45-Number of active backups and restores - Redgate Monitor Metrics

Don’t do this. Go to Redgate Monitor and start there (as shown above).

Summary

This post shows how to automatically add custom metrics written by others from the sqlmonitormetrics website. This is a good way to add common checks to your system that others use.

If you see something missing, submit it, or ping me and I’ll write it or find someone else to do so.

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.

Posted in Blog | Tagged , , , | Comments Off on Monday Monitor Tips – Adding Redgate Monitor Custom Metrics from SQLMonitorMetrics

The Biggest Database Professional Challenges Today

Today I have a question for you:

What are the three biggest challenges you face today as a database professional?

I was asked this recently, and I had some ideas, but I wonder if my challenges are the same ones you face. I don’t want to influence you, but I’m wondering what things cause you stress, headaches, difficulties, or somehow lower the enjoyment of your job.

Or maybe these are the things that challenge and motivate you to do more. It’s up to you to decide what is a challenge to you as a database professional.

I think about the challenges I have faced (and would face today) as someone working with data in a few ways. First, there are the actual challenges of working in an organization and dealing with other people/groups/management. Next, I think about technology challenges as well, with how we architect systems, pick tools, and make choices. Lastly, I also think about this in terms of my career and what difficulties I face there. How do I keep my career moving forward?

There are several ways to look at this. In a general sense with a high-level view or with specific challenges in dealing with technology/people/etc., such as HA latency. Maybe you think about long-term issues or acute firefighting that you are dealing with every week. There are many ways to view the impediments to an endless progression of smooth, quiet, easy workdays.

Spend a few minutes thinking about what challenges you have and let us know today what those are.

Steve Jones

Listen to the podcast at Libsyn, Spotify, or iTunes.

Note, podcasts are only available for a limited time online.

Posted in Editorial | Tagged | Comments Off on The Biggest Database Professional Challenges Today

Friday Flyway Tips–Comparison Defaults

One of the little details that I find matter more and more in enterprises is understanding why a tool behaves a certain way. OSS/home-grown ones often have limited docs, but vendor tools should have great docs. Today I learned about how to easily find Flyway comparison defaults, which is the topic of this post.

I’ve been working with Flyway Desktop for work more and more as we transition from older SSMS plugins to the standalone tool. This series looks at some tips I’ve gotten along the way.

The Defaults

Do you know all the SQL Compare defaults? Would you realize it if someone changed them? Do you think they’re the same in Flyway? I actually don’t know about the latter question, and I’m not digging through and comparing the options.

In any case, I saw an internal discussion recently about documentation and someone pointed out that we have this page that discusses where you change options. It’s good for that purpose, but it doesn’t list the defaults.

However, at the bottom, there are links:

If you click through, then you get a list of default options. There is first a link to the full list of options (SQL Server, Oracle) as well as a link to SQL Compare options (SQL Server, Oracle).

The SQL Server page looks like this:

2024-07-15 14_44_38-SQL Server comparison options - Flyway - Product Documentation

Note the sentence just below the image, which links to all the options. The second link is for the SQL Compare option explanations. Below this, you see the default options. This is a table of options, which looks like this image. Note this says certain options are set to true and all others false.

2024-07-15 15_00_11-SQL Server comparison options - Flyway - Product Documentation

If I click through to the full list, I see this:

2024-07-15 14_44_58-SQL Server comparison settings - Flyway - Product Documentation

I can see all the settings and if they are required. I also see an example of the TOML file below this, where I can set these and store them in version control.

2024-07-15 14_45_06-SQL Server comparison settings - Flyway - Product Documentation

If you want to change behavior of the comparison engine in Flyway, or double check if someone else has changed something, this is the place to check.

Note, if you are looking to induce certain behavior, changes should be made in a TOML file for the project and flow through a PR process for approval and into a pipeline. Don’t edit these options directly, or change them in a pipeline.

Flyway Enterprise

Try Flyway Enterprise out today. If you haven’t worked with Flyway Desktop, download it today. There is a free version that organizes migrations and paid versions with many more features.

If you use Flyway Community, download Flyway Desktop and get a GUI for your migration scripts.

Video Walkthrough

I made a quick video showing this as well. You can watch it below, or check out all the Flyway videos I’ve added:

Posted in Blog | Tagged , , , | Comments Off on Friday Flyway Tips–Comparison Defaults

A Programmer’s Attitude

I caught this piece on the need for programmers (developers) to not trust anyone, including themselves. It is written by a software developer for other software developers, but I think it can also apply to database work as well. It is a bit long, but it starts with the nature of abstractions in the world and how they let us work with simpler models of a situation or environment. However, most abstractions are leaky, and our assumptions about them can cause our systems to fail.

The leap from trust to abstractions seems a bit funny, but it makes some sense. We ought to simplify our situations so that we can generalize how to solve them, but we also need to verify things. There are a few examples, one of which is we ought to use tests to ensure the code does what we think it does, including using a wide variety of data. We ought to ensure that refactoring something doesn’t break the system, or more often for databases, we return the same results. Changing a query to run more efficiently with joins or a window function instead of a loop or subquery should return the same results. Not just for one row but all rows, and across different inputs.

One I especially like is the check on deployments. If we changed our code and had a deployment, did our code actually get deployed? In today’s world where different people might be responsible for merging and deploying code than those writing the software, we might want to verify that our changes actually got deployed. Perhaps reviewing deployment reports or logs can help ensure that we know the state of our live systems in addition to those in development.

There are some suggestions for how to become a better software developer, and as you might guess, this requires learning. I think in today’s world, some group exercises (katas) or reviews can be helpful as well. Maybe even practicing new techniques in a sandbox and running them through a PR process to let others see them. It can be scary to ask others to review your code when you are learning, but they might teach you something, or you might teach them something. We build in teams; we should think about learning in teams, at least periodically.

Becoming a successful software professional, data or application, takes regular work to improve our skills. Just as a woodworker might practice with their tools or a chef with recipes, we ought to practice with our tools. I’d hope that many organizations would also see this as something that needs to be encouraged with some amount of time allocated towards ensuring your staff continues to improve and produces high-quality results.

Steve Jones

Listen to the podcast at Libsyn, Spotify, or iTunes.

Note, podcasts are only available for a limited time online.

Posted in Editorial | Tagged | 2 Comments