Share via

Metrics on individual managed instance databases in Grafana dashboard

Thea 80 Reputation points
2026-02-09T12:00:38.4333333+00:00

Hi there, hope you are having a good day so far! I am trying to get metrics on individual databases on a managed instance in Azure, in our Grafana instance. I have connected using Azure Monitor, and I do get some metrics on the managed instance itself. I have made the various managed instances we have dashboard variables, and I was wondering if there is any way I can build on this to get individual values for databases? The closest I have gotten to a dashboard variable for databases is choosing query type "resource names" and then filling in subscription and resource group, but don't understand how I can just the databases and not all other kinds of resources as well (like the managed instances, private endpoints etc)... Any way I could get some help here/how Grafana best can be used for monitoring managed instance databases? :)

Azure Monitor
Azure Monitor

An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.


Answer accepted by question author

Bharath Y P 9,110 Reputation points Microsoft External Staff Moderator
2026-02-09T20:23:57.5333333+00:00

Hello Thea. It sounds like you’re trying to pull individual database metrics from your Azure SQL Managed Instance into your Grafana dashboard. Great to hear you've connected with Azure Monitor! Let’s see how we can refine your dashboard setup.

To monitor individual databases, you’ll want to ensure that your Grafana instance is properly set up to access the metrics specific to those databases. Here are some steps and tips that could help you achieve this:

  1. Use Specific Resource Types: When you're configuring your Grafana data source, ensure that you're selecting metrics for SQL Database specifically instead of broader categories that include managed instances and other resources. You might want to look for a data source in Grafana that specifically points to Azure Monitor for database metrics.
  2. Set Up Diagnostic Settings: Make sure you have diagnostic settings configured for your Azure SQL Managed Instance. This allows you to stream metrics for your individual databases. You can do this through the Azure portal by navigating to your managed instance, selecting "Diagnostics settings", and configuring it to stream to Log Analytics or other services.
  3. Use Direct Queries: In Grafana, when defining your queries, try using the Azure Monitor API directly to pull metrics for specific databases. You can craft queries that fetch data from the Microsoft.Sql/servers/databases resource type specifically.
  4. Filtering in Grafana: Once you set up the data source correctly, you may still need to filter out the other resource types. You can apply filters such as ResourceType eq 'Microsoft.Sql/servers/databases' in your Azure Monitor query section in Grafana to ensure you only receive database metrics.
  5. Dashboard Variables: You mentioned creating dashboard variables for your managed instances. Make sure you create another variable for selecting databases that filters based on the currently selected managed instance variable. This ensures that when you select a managed instance from the dropdown, only its respective databases are shown in the database selection variable.
  6. Tutorial Guidance: If you’re looking for more guidance, you can also check out the Getting started with Azure Metrics Explorer to familiarize yourself with querying metrics effectively.

Follow-up Questions:

  • Are you able to see metrics for other resources within your monitoring setup, like managed instances?
  • Have you set up diagnostic settings for your individual databases?
  • Can you provide any error messages that appear when trying to query database metrics in Grafana?

References:

Hope this helps! Let me know if you have more questions or need further clarification!

Was this answer helpful?

0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Thea 80 Reputation points
    2026-02-10T13:28:02.0733333+00:00

    Hi again! Hmm, for step 5, do you have any examples of how to get the names of databases on a given managed instance as dashboard variables? Like I said, I am able to get data from Azure and the managed instance, and I am filtering on currently selected managed instance, I am just not single out just the database names as dashboard variables. I get other resources too, such as network security groups and route tables, for the managed instance I have chosen through the variable I created for managed instance. How to get only the databases?Furthermore, do you have any examples on metrics that can be used for individual databases? For example, I see that a metric for the managed instance on a whole is "Average CPU percentage". Anything similar for databases, or a way to get the CPU usage per database? Just overall not so sure how to create the best possible dashboard specifically for databases on managed instances, and I haven't really found a lot of documentation on it online... :)

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.