How to monitor bloat in Postgres with Datadog custom metrics on Azure Database for PostgreSQL

Published 07-23-2020 07:25 PM 3,656 Views
Microsoft

Monitoring your database is one of the most crucial tasks to ensure a continued healthy and steady workload. Azure Database for PostgreSQL, our managed database service for Postgres, provides a wealth of metrics to monitor your Postgres database on Azure. But what if the very metric that you are after is not yet available?

 

Worry not because there are ample options to easily create and monitor custom metrics with Azure Database for PostgreSQL. One solution you can use with Postgres on Azure is Datadog’s custom metrics.

 

If you are not familiar with Datadog, it is one of many solid 3rd party solutions that provides a set of canned metrics for various technologies, including PostgreSQL. Datadog also enables you to poll our databases with the help of custom queries to emit custom metrics data to a central location where you can monitor how well your workload is doing.

 

If you don’t yet have a Datadog account, no problem, you can use a free trial Datadog account to try out everything I’m going to show you in this post.

 

What is bloat in Postgres & why should you monitor it?

 

As a proud owner of a PostgreSQL database, you will inevitably have to experience and manage bloat, which is a product of PostgreSQL’s storage implementation for multi-version concurrency control. Concurrency is achieved by creating different versions of tuples as they receive modifications. As you can imagine, PostgreSQL will keep as many versions of the same tuple as the number of concurrent transactions at any time and make the last committed version visible to the consecutive transactions. Eventually, this creates dead tuples in pages that later need to be reclaimed.

 

To keep your database humming, it's important to understand how your table and index bloat values progress over time—and to make sure that garbage collection happens as aggressively as it should. So you need to monitor your bloat in Postgres and act on it as needed. 

 

Before you start, I should clarify that this post is focused on how to monitor bloat on Azure Database for PostgreSQL – Single Server. On Azure, our Postgres managed database service also has a built-in deployment option called Hyperscale (Citus)—based on the Citus open source extension—and this Hyperscale (Citus) option enables you to scale out Postgres horizontally. Because the code snippets and instructions below are a bit different for monitoring a single Postgres server vs. monitoring a Hyperscale (Citus) server group, I plan to publish the how-to instructions for using custom monitoring metrics on a Hyperscale (Citus) cluster in a separate/future blog post. Stay tuned! Now, let’s get started.

 

First, prepare your monitoring setup for Azure Database for PostgreSQL - Single Server

 

If you do not already have an Azure Database for PostgreSQL server, you may create one as prescribed in our quickstart documentation.

 

Create a read-only monitoring user

As a best practice, you should allocate a read-only user to poll your data from database. Depending on what you want to collect, granting pg_monitor role, which is a member of pg_read_all_settings, pg_read_all_stats and pg_stat_scan_tables starting from Postgres 10, could be sufficient.

 

For this situation, we will also need to GRANT SELECT for the role to all the tables that we want to track for bloat.

 

 

CREATE ROLE metrics_reader WITH LOGIN NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT NOREPLICATION CONNECTION LIMIT 1 PASSWORD 'xxxxxx';
GRANT pg_monitor TO metrics_reader;
--Rights granted here as blanket for simplicity.
GRANT SELECT ON ALL TABLES IN SCHEMA public TO metrics_reader;
--Ensure that user will have the same rights for the tables created later
--ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO metrics_reader;

 


Create your bloat monitoring function

To keep Datadog configuration nice and tidy, let’s first have a function to return the bloat metrics we want to track. Create the function below in the Azure Database for PostgreSQL – Single Server database you would like to track.

If you have multiple databases to track, you can consider an aggregation mechanism from different databases into a single monitoring database to achieve the same objective. This how-to post is designed for a single database, for the sake of simplicity.

 

The bloat tracking script used here is a popular choice and was created by Greg Sabino Mullane.  There are other bloat tracking scripts out there in case you want to research a better fitting approach to track your bloat estimates and adjust your get_bloat function.

 

 

CREATE OR REPLACE FUNCTION get_bloat (TableNames character varying[] DEFAULT '{}'::character varying[])
RETURNS TABLE (
    database_name NAME,
    schema_name NAME,
    table_name NAME,
    table_bloat NUMERIC,
    wastedbytes NUMERIC,
    index_name NAME,
    index_bloat NUMERIC,
    wastedibytes DOUBLE PRECISION
)
AS $$
BEGIN
IF COALESCE(array_length(TableNames,1),0) = 0 THEN
TableNames := (SELECT ARRAY_AGG(DISTINCT relname) FROM pg_stat_user_tables);
END IF;
RETURN QUERY WITH tns AS (SELECT UNNEST(TableNames) as tn) SELECT current_database() as databasename, schemaname, tablename,ROUND((CASE WHEN otta=0 THEN 0.0 ELSE sml.relpages::FLOAT/otta END)::NUMERIC,1) AS tbloat,CASE WHEN relpages < otta THEN 0 ELSE bs*(sml.relpages-otta)::BIGINT END AS wastedbytes,iname, ROUND((CASE WHEN iotta=0 OR ipages=0 THEN 0.0 ELSE ipages::FLOAT/iotta END)::NUMERIC,1) AS ibloat,CASE WHEN ipages < iotta THEN 0 ELSE bs*(ipages-iotta) END AS wastedibytes FROM (SELECT schemaname, tablename, cc.reltuples, cc.relpages, bs,CEIL((cc.reltuples*((datahdr+ma-(CASE WHEN datahdr%ma=0 THEN ma ELSE datahdr%ma END))+nullhdr2+4))/(bs-20::FLOAT)) AS otta,COALESCE(c2.relname,'?') AS iname, COALESCE(c2.reltuples,0) AS ituples, COALESCE(c2.relpages,0) AS ipages,COALESCE(CEIL((c2.reltuples*(datahdr-12))/(bs-20::FLOAT)),0) AS iotta FROM (SELECT ma,bs,schemaname,tablename,(datawidth+(hdr+ma-(CASE WHEN hdr%ma=0 THEN ma ELSE hdr%ma END)))::NUMERIC AS datahdr,(maxfracsum*(nullhdr+ma-(CASE WHEN nullhdr%ma=0 THEN ma ELSE nullhdr%ma END))) AS nullhdr2 FROM (SELECT schemaname, tablename, hdr, ma, bs,SUM((1-null_frac)*avg_width) AS datawidth,MAX(null_frac) AS maxfracsum,hdr+(SELECT 1+COUNT(*)/8 FROM pg_stats s2 WHERE null_frac<>0 AND s2.schemaname = s.schemaname AND s2.tablename = s.tablename) AS nullhdr FROM pg_stats s, (SELECT(SELECT current_setting('block_size')::NUMERIC) AS bs,CASE WHEN SUBSTRING(v,12,3) IN ('8.0','8.1','8.2') THEN 27 ELSE 23 END AS hdr,CASE WHEN v ~ 'mingw32' THEN 8 ELSE 4 END AS ma FROM (SELECT version() AS v) AS foo) AS constants GROUP BY 1,2,3,4,5) AS foo) AS rs JOIN pg_class cc ON cc.relname = rs.tablename JOIN pg_namespace nn ON cc.relnamespace = nn.oid AND nn.nspname = rs.schemaname AND nn.nspname <> 'information_schema' LEFT JOIN pg_index i ON indrelid = cc.oid LEFT JOIN pg_class c2 ON c2.oid = i.indexrelid) AS sml JOIN tns ON tablename =  tn WHERE schemaname NOT IN ('pg_catalog') ORDER BY wastedbytes DESC;
END; $$
LANGUAGE 'plpgsql';

 

 

Confirm your read-only Postgres user can observe results

At this point, you should be able to connect to your Azure Database for PostgreSQL server with your read-only user and run SELECT * FROM get_bloat(); to observe results.

 

get_bloat function's sample outputget_bloat function's sample output

 

If you don’t get anything in the output, see if the following steps remedy this:

 

  1. Check your pg_stat records with SELECT * FROM pg_stat_user_tables;
  2. If you don’t see your table and columns in there, make sure to run ANALYZE <your_table> and try again
  3. If you still don’t see your table in the result set from #1, your user very likely does not have select privilege on a table that you expect to see in the output
  4. Lastly, is it possible that your table may not have any records yet?

If you want to get bloat results for a specific set of your Postgres tables you can also run a SELECT * FROM get_bloat(ARRAY[‘stores’,’transactions’]);

 

Then, setup your 3rd party monitoring (in this case, with Datadog)

 

Once you confirm that your read-only user is able to collect the metrics you want to track on your Azure Postgres single server, you are now ready to set up your 3rd party monitoring!

 

For this you will need two things. First, a Datadog account. Second, a machine that will host your Datadog agent, to do the heavy lifting of connecting to your database to extract the metrics you want and to push the metrics into your Datadog workspace.

 

For this exercise, I had an Azure Linux virtual machine handy that I could use as the agent host, but you can follow quickstart guides available for Azure Virtual Machines to create a new machine or use an existing one. Datadog provides scripts to set up diverse environments, which you can find after you log in to your Datadog account and go to the Agents section in Datadog’s Postgres Integrations page. Following the instructions, you should get message similar to the following.

 

datadog agent setup success statedatadog agent setup success state

 

Next step is to configure datadog agent for Postgres specific collection. If you aren’t already working with an existing postgres.d/conf.yaml, just copy the conf.yaml.example in /etc/datadog-agent/conf.d/postgres.d/ and adjust to your needs.

 

Once you follow the directions and set up your host, port, user, and password in /etc/datadog-agent/conf.d/postgres.d/conf.yaml, the part that remains is to set up your custom metrics section with below snippet.

 

 

custom_queries:
       - metric_prefix: azure.postgres.single_server.custom_metrics
         query: select database_name, schema_name, table_name, table_bloat, wastedbytes, index_name, index_bloat, wastedibytes from get_bloat();
         columns:
           - name: database_name
             type: tag
           - name: schema_name
             type: tag
           - name: table_name
             type: tag
           - name: table_bloat
             type: gauge
           - name: wastedbytes
             type: gauge
           - name: index_name
             type: tag
           - name: index_bloat
             type: gauge
           - name: wastedibytes
             type: gauge

 

 

Once this step is done, all you need to do is to restart your datadog-agent sudo systemctl restart datadog-agent for your custom metrics to start flowing in.

 

Setup your new bloat monitoring dashboard for Azure Database for PostgreSQL – Single Server

 

If all goes well, you should be able to see your custom metrics in Metrics Explorer shortly!

 

azure postgresql custom metrics flowing successfully into datadog workspaceazure postgresql custom metrics flowing successfully into datadog workspace

 

From above you can export these charts to a new or existing dashboard and edit the widgets to your needs to show separate visuals by dimensions as table or index or you can simply overlay them as below. Datadog documentation is quite rich to help you out.

 

 

custom metrics added to a new dashboardcustom metrics added to a new dashboard

 

Knowing how your bloat metrics are trending will help you investigate performance problems and help you to identify if bloat is contributing to performance fluctuations. Monitoring bloat in Postgres will also help you evaluate whether your workload (or your Postgres tables) are configured optimally for autovacuum to perform its function.

 

Using custom metrics makes it easy to monitor bloat in Azure Database for PostgreSQL

 

You can and absolutely should track bloat. And with custom metrics and Datadog, you can easily track bloat in your workload for an Azure Database for PostgreSQL server. You can track other types of custom Postgres metrics easily in the same fashion.

 

One more thing to keep in mind: I recommend you always be intentional on what and how to collect, as metric polling can impact your workload.

If you have a much more demanding workload and are using Hyperscale (Citus) to scale out Postgres horizontally, I will soon have a post on how you can monitor bloat with custom metrics in Azure Database for Postgres - Hyperscale (Citus). I look forward to seeing you there!

%3CLINGO-SUB%20id%3D%22lingo-sub-1542366%22%20slang%3D%22en-US%22%3EHow%20to%20monitor%20bloat%20in%20Postgres%20with%20Datadog%20custom%20metrics%20on%20Azure%20Database%20for%20PostgreSQL%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1542366%22%20slang%3D%22en-US%22%3E%3CP%3EMonitoring%20your%20database%20is%20one%20of%20the%20most%20crucial%20tasks%20to%20ensure%20a%20continued%20healthy%20and%20steady%20workload.%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fpostgresql%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EAzure%20Database%20for%20PostgreSQL%3C%2FA%3E%2C%20our%20managed%20database%20service%20for%20Postgres%2C%20provides%20a%20wealth%20of%20metrics%20to%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fpostgresql%2Fconcepts-monitoring%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Emonitor%20your%20Postgres%20database%20on%20Azure%3C%2FA%3E.%20But%20what%20if%20the%20very%20metric%20that%20you%20are%20after%20is%20not%20yet%20available%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWorry%20not%20because%20there%20are%20ample%20options%20to%20easily%20create%20and%20monitor%20%3CSTRONG%3Ecustom%20metrics%3C%2FSTRONG%3E%20with%20Azure%20Database%20for%20PostgreSQL.%20One%20solution%20you%20can%20use%20with%20Postgres%20on%20Azure%20is%20%5B%23%24dp9%5D%3CA%20href%3D%22https%3A%2F%2Fdocs.datadoghq.com%2Fintegrations%2Ffaq%2Fpostgres-custom-metric-collection-explained%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3EDatadog%E2%80%99s%20custom%20metrics%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20are%20not%20familiar%20with%20Datadog%2C%20it%20is%20one%20of%20many%20solid%203%3CSUP%3Erd%3C%2FSUP%3E%20party%20solutions%20that%20provides%20a%20set%20of%20canned%20metrics%20for%20various%20technologies%2C%20including%20PostgreSQL.%20Datadog%20also%20enables%20you%20to%20poll%20our%20databases%20with%20the%20help%20of%20custom%20queries%20to%20emit%20custom%20metrics%20data%20to%20a%20central%20location%20where%20you%20can%20monitor%20how%20well%20your%20workload%20is%20doing.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20don%E2%80%99t%20yet%20have%20a%20Datadog%20account%2C%20no%20problem%2C%20you%20can%20use%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fwww.datadoghq.com%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ea%20free%20trial%20Datadog%20account%3C%2FA%3E%20to%20try%20out%20everything%20I%E2%80%99m%20going%20to%20show%20you%20in%20this%20post.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--1298188239%22%20id%3D%22toc-hId--1298193039%22%3EWhat%20is%20bloat%20in%20Postgres%20%26amp%3B%20why%20should%20you%20monitor%20it%3F%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20a%20proud%20owner%20of%20a%20PostgreSQL%20database%2C%20you%20will%20inevitably%20have%20to%20experience%20and%20manage%20bloat%2C%20which%20is%20a%20product%20of%20PostgreSQL%E2%80%99s%20storage%20implementation%20for%20multi-version%20concurrency%20control.%20Concurrency%20is%20achieved%20by%20creating%20different%20versions%20of%20tuples%20as%20they%20receive%20modifications.%20As%20you%20can%20imagine%2C%20PostgreSQL%20will%20keep%20as%20many%20versions%20of%20the%20same%20tuple%20as%20the%20number%20of%20concurrent%20transactions%20at%20any%20time%20and%20make%20the%20last%20committed%20version%20visible%20to%20the%20consecutive%20transactions.%20Eventually%2C%20this%20creates%20dead%20tuples%20in%20pages%20that%20later%20need%20to%20be%20reclaimed.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ETo%20keep%20your%20database%20humming%2C%20it's%20important%20to%20understand%20how%20your%20table%20and%20index%20bloat%20values%20progress%20over%20time%E2%80%94and%20to%20make%20sure%20that%20garbage%20collection%20happens%20as%20aggressively%20as%20it%20should.%20So%20you%20need%20to%20%3CA%20href%3D%22https%3A%2F%2Fwww.citusdata.com%2Fblog%2F2017%2F10%2F20%2Fmonitoring-your-bloat-in-postgres%2F%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Emonitor%20your%20bloat%20in%20Postgres%3C%2FA%3E%20and%20act%20on%20it%20as%20needed.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBefore%20you%20start%2C%20I%20should%20clarify%20that%20this%20post%20is%20focused%20on%20how%20to%20monitor%20bloat%20on%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fpostgresql%2Fquickstart-create-server-database-portal%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%3CSTRONG%3EAzure%20Database%20for%20PostgreSQL%20%E2%80%93%20Single%20Server%3C%2FSTRONG%3E%3C%2FA%3E.%20On%20Azure%2C%20our%20Postgres%20managed%20database%20service%20also%20has%20a%20built-in%20deployment%20option%20called%20Hyperscale%20(Citus)%E2%80%94based%20on%20the%20%3CA%20href%3D%22https%3A%2F%2Fwww.citusdata.com%2Fdownload%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3ECitus%20open%20source%20extension%3C%2FA%3E%E2%80%94and%20this%20Hyperscale%20(Citus)%20option%20enables%20you%20to%20scale%20out%20Postgres%20horizontally.%20Because%20the%20code%20snippets%20and%20instructions%20below%20are%20a%20bit%20different%20for%20monitoring%20a%20single%20Postgres%20server%20vs.%20monitoring%20a%20Hyperscale%20(Citus)%20server%20group%2C%20I%20plan%20to%20publish%20the%20how-to%20instructions%20for%20using%20custom%20monitoring%20metrics%20on%20a%20Hyperscale%20(Citus)%20cluster%20in%20a%20separate%2Ffuture%20blog%20post.%20Stay%20tuned!%20Now%2C%20let%E2%80%99s%20get%20started.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1189324594%22%20id%3D%22toc-hId-1189319794%22%3EFirst%2C%20prepare%20your%20monitoring%20setup%20for%20Azure%20Database%20for%20PostgreSQL%20-%20Single%20Server%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20do%20not%20already%20have%20an%20Azure%20Database%20for%20PostgreSQL%20server%2C%20you%20may%20create%20one%20as%20prescribed%20in%20our%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fpostgresql%2Fquickstart-create-server-database-portal%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Equickstart%20documentation%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-1879886068%22%20id%3D%22toc-hId-1879881268%22%3ECreate%20a%20read-only%20monitoring%20user%3C%2FH3%3E%0A%3CP%3EAs%20a%20best%20practice%2C%20you%20should%20allocate%20a%20read-only%20user%20to%20poll%20your%20data%20from%20database.%20Depending%20on%20what%20you%20want%20to%20collect%2C%20granting%3CCODE%20style%3D%22color%3A%20black%3B%22%3Epg_monitor%3C%2FCODE%3E%20role%2C%20which%20is%20a%20member%20of%20%3CCODE%20style%3D%22color%3A%20black%3B%22%3Epg_read_all_settings%3C%2FCODE%3E%2C%20%3CCODE%20style%3D%22color%3A%20black%3B%22%3Epg_read_all_stats%3C%2FCODE%3E%20and%20%3CCODE%20style%3D%22color%3A%20black%3B%22%3Epg_stat_scan_tables%3C%2FCODE%3E%20starting%20from%20Postgres%2010%2C%20could%20be%20sufficient.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20this%20situation%2C%20we%20will%20also%20need%20to%20%3CCODE%20style%3D%22color%3A%20black%3B%22%3EGRANT%20SELECT%3C%2FCODE%3E%20for%20the%20role%20to%20all%20the%20tables%20that%20we%20want%20to%20track%20for%20bloat.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-sql%22%3E%3CCODE%3ECREATE%20ROLE%20metrics_reader%20WITH%20LOGIN%20NOSUPERUSER%20NOCREATEDB%20NOCREATEROLE%20INHERIT%20NOREPLICATION%20CONNECTION%20LIMIT%201%20PASSWORD%20'xxxxxx'%3B%0AGRANT%20pg_monitor%20TO%20metrics_reader%3B%0A--Rights%20granted%20here%20as%20blanket%20for%20simplicity.%0AGRANT%20SELECT%20ON%20ALL%20TABLES%20IN%20SCHEMA%20public%20TO%20metrics_reader%3B%0A--Ensure%20that%20user%20will%20have%20the%20same%20rights%20for%20the%20tables%20created%20later%0A--ALTER%20DEFAULT%20PRIVILEGES%20IN%20SCHEMA%20public%20GRANT%20SELECT%20ON%20TABLES%20TO%20metrics_reader%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-72431605%22%20id%3D%22toc-hId-72426805%22%3E%3CBR%20%2F%3ECreate%20your%20bloat%20monitoring%20function%3C%2FH3%3E%0A%3CP%3ETo%20keep%20Datadog%20configuration%20nice%20and%20tidy%2C%20let%E2%80%99s%20first%20have%20a%20function%20to%20return%26nbsp%3Bthe%20bloat%20metrics%20we%20want%20to%20track.%20Create%20the%20function%20below%20in%20the%20Azure%20Database%20for%20PostgreSQL%20%E2%80%93%20Single%20Server%20database%20you%20would%20like%20to%20track.%20%3CBR%20%2F%3E%3CBR%20%2F%3EIf%20you%20have%20multiple%20databases%20to%20track%2C%20you%20can%20consider%20an%20aggregation%20mechanism%20from%20different%20databases%20into%20a%20single%20monitoring%20database%20to%20achieve%20the%20same%20objective.%20This%20how-to%20post%20is%20designed%20for%20a%20single%20database%2C%20for%20the%20sake%20of%20simplicity.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20bloat%20tracking%20script%20used%20here%20is%20a%20popular%20choice%20and%20was%26nbsp%3B-ERR%3AREF-NOT-FOUND-created%20by%20Greg%20Sabino%20Mullane.%20%26nbsp%3BThere%20are%20other%20bloat%20tracking%20scripts%20out%20there%20in%20case%20you%20want%20to%20research%20a%20better%20fitting%20approach%20to%20track%20your%20bloat%20estimates%20and%20adjust%20your%20get_bloat%20function.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-sql%22%3E%3CCODE%3ECREATE%20OR%20REPLACE%20FUNCTION%20get_bloat%20(TableNames%20character%20varying%5B%5D%20DEFAULT%20'%7B%7D'%3A%3Acharacter%20varying%5B%5D)%0ARETURNS%20TABLE%20(%0A%20%20%20%20database_name%20NAME%2C%0A%20%20%20%20schema_name%20NAME%2C%0A%20%20%20%20table_name%20NAME%2C%0A%20%20%20%20table_bloat%20NUMERIC%2C%0A%20%20%20%20wastedbytes%20NUMERIC%2C%0A%20%20%20%20index_name%20NAME%2C%0A%20%20%20%20index_bloat%20NUMERIC%2C%0A%20%20%20%20wastedibytes%20DOUBLE%20PRECISION%0A)%0AAS%20%24%24%0ABEGIN%0AIF%20COALESCE(array_length(TableNames%2C1)%2C0)%20%3D%200%20THEN%0ATableNames%20%3A%3D%20(SELECT%20ARRAY_AGG(DISTINCT%20relname)%20FROM%20pg_stat_user_tables)%3B%0AEND%20IF%3B%0ARETURN%20QUERY%20WITH%20tns%20AS%20(SELECT%20UNNEST(TableNames)%20as%20tn)%20SELECT%20current_database()%20as%20databasename%2C%20schemaname%2C%20tablename%2CROUND((CASE%20WHEN%20otta%3D0%20THEN%200.0%20ELSE%20sml.relpages%3A%3AFLOAT%2Fotta%20END)%3A%3ANUMERIC%2C1)%20AS%20tbloat%2CCASE%20WHEN%20relpages%20%26lt%3B%20otta%20THEN%200%20ELSE%20bs*(sml.relpages-otta)%3A%3ABIGINT%20END%20AS%20wastedbytes%2Ciname%2C%20ROUND((CASE%20WHEN%20iotta%3D0%20OR%20ipages%3D0%20THEN%200.0%20ELSE%20ipages%3A%3AFLOAT%2Fiotta%20END)%3A%3ANUMERIC%2C1)%20AS%20ibloat%2CCASE%20WHEN%20ipages%20%26lt%3B%20iotta%20THEN%200%20ELSE%20bs*(ipages-iotta)%20END%20AS%20wastedibytes%20FROM%20(SELECT%20schemaname%2C%20tablename%2C%20cc.reltuples%2C%20cc.relpages%2C%20bs%2CCEIL((cc.reltuples*((datahdr%2Bma-(CASE%20WHEN%20datahdr%25ma%3D0%20THEN%20ma%20ELSE%20datahdr%25ma%20END))%2Bnullhdr2%2B4))%2F(bs-20%3A%3AFLOAT))%20AS%20otta%2CCOALESCE(c2.relname%2C'%3F')%20AS%20iname%2C%20COALESCE(c2.reltuples%2C0)%20AS%20ituples%2C%20COALESCE(c2.relpages%2C0)%20AS%20ipages%2CCOALESCE(CEIL((c2.reltuples*(datahdr-12))%2F(bs-20%3A%3AFLOAT))%2C0)%20AS%20iotta%20FROM%20(SELECT%20ma%2Cbs%2Cschemaname%2Ctablename%2C(datawidth%2B(hdr%2Bma-(CASE%20WHEN%20hdr%25ma%3D0%20THEN%20ma%20ELSE%20hdr%25ma%20END)))%3A%3ANUMERIC%20AS%20datahdr%2C(maxfracsum*(nullhdr%2Bma-(CASE%20WHEN%20nullhdr%25ma%3D0%20THEN%20ma%20ELSE%20nullhdr%25ma%20END)))%20AS%20nullhdr2%20FROM%20(SELECT%20schemaname%2C%20tablename%2C%20hdr%2C%20ma%2C%20bs%2CSUM((1-null_frac)*avg_width)%20AS%20datawidth%2CMAX(null_frac)%20AS%20maxfracsum%2Chdr%2B(SELECT%201%2BCOUNT(*)%2F8%20FROM%20pg_stats%20s2%20WHERE%20null_frac%26lt%3B%26gt%3B0%20AND%20s2.schemaname%20%3D%20s.schemaname%20AND%20s2.tablename%20%3D%20s.tablename)%20AS%20nullhdr%20FROM%20pg_stats%20s%2C%20(SELECT(SELECT%20current_setting('block_size')%3A%3ANUMERIC)%20AS%20bs%2CCASE%20WHEN%20SUBSTRING(v%2C12%2C3)%20IN%20('8.0'%2C'8.1'%2C'8.2')%20THEN%2027%20ELSE%2023%20END%20AS%20hdr%2CCASE%20WHEN%20v%20~%20'mingw32'%20THEN%208%20ELSE%204%20END%20AS%20ma%20FROM%20(SELECT%20version()%20AS%20v)%20AS%20foo)%20AS%20constants%20GROUP%20BY%201%2C2%2C3%2C4%2C5)%20AS%20foo)%20AS%20rs%20JOIN%20pg_class%20cc%20ON%20cc.relname%20%3D%20rs.tablename%20JOIN%20pg_namespace%20nn%20ON%20cc.relnamespace%20%3D%20nn.oid%20AND%20nn.nspname%20%3D%20rs.schemaname%20AND%20nn.nspname%20%26lt%3B%26gt%3B%20'information_schema'%20LEFT%20JOIN%20pg_index%20i%20ON%20indrelid%20%3D%20cc.oid%20LEFT%20JOIN%20pg_class%20c2%20ON%20c2.oid%20%3D%20i.indexrelid)%20AS%20sml%20JOIN%20tns%20ON%20tablename%20%3D%20%20tn%20WHERE%20schemaname%20NOT%20IN%20('pg_catalog')%20ORDER%20BY%20wastedbytes%20DESC%3B%0AEND%3B%20%24%24%0ALANGUAGE%20'plpgsql'%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--1735022858%22%20id%3D%22toc-hId--1735027658%22%3E%26nbsp%3B%3C%2FH3%3E%0A%3CH3%20id%3D%22toc-hId-752489975%22%20id%3D%22toc-hId-752485175%22%3EConfirm%20your%20read-only%20Postgres%20user%20can%20observe%20results%3C%2FH3%3E%0A%3CP%3EAt%20this%20point%2C%20you%20should%20be%20able%20to%20connect%20to%20your%20Azure%20Database%20for%20PostgreSQL%20server%20with%20your%20read-only%20user%20and%20run%20%3CCODE%20style%3D%22color%3A%20black%3B%22%3ESELECT%20*%20FROM%20get_bloat()%3B%3C%2FCODE%3E%20to%20observe%20results.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22get-bloat-function-sample-output-pgadmin.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F207565i52BBE5B7A0BFD93C%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22get-bloat-function-sample-output-pgadmin.png%22%20alt%3D%22get_bloat%20function's%20sample%20output%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3Eget_bloat%20function's%20sample%20output%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20don%E2%80%99t%20get%20anything%20in%20the%20output%2C%20see%20if%20the%20following%20steps%20remedy%20this%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3ECheck%20your%20pg_stat%20records%20with%20%3CCODE%20style%3D%22color%3A%20black%3B%22%3E%20SELECT%20*%20FROM%20pg_stat_user_tables%3B%3C%2FCODE%3E%3C%2FLI%3E%0A%3CLI%3EIf%20you%20don%E2%80%99t%20see%20your%20table%20and%20columns%20in%20there%2C%20make%20sure%20to%20run%20%3CCODE%20style%3D%22color%3A%20black%3B%22%3EANALYZE%20%3CYOUR_TABLE%3E%3C%2FYOUR_TABLE%3E%3C%2FCODE%3E%20and%20try%20again%3C%2FLI%3E%0A%3CLI%3EIf%20you%20still%20don%E2%80%99t%20see%20your%20table%20in%20the%20result%20set%20from%20%231%2C%20your%20user%20very%20likely%20does%20not%20have%20select%20privilege%20on%20a%20table%20that%20you%20expect%20to%20see%20in%20the%20output%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3ELastly%2C%20is%20it%20possible%20that%20your%20table%20may%20not%20have%20any%20records%20yet%3F%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%3CSPAN%3EIf%20you%20want%20to%20get%20bloat%20results%20for%20a%20specific%20set%20of%20your%20Postgres%20tables%20you%20can%20also%20run%20a%20%3CCODE%20style%3D%22color%3A%20black%3B%22%3ESELECT%20*%20FROM%20get_bloat(ARRAY%5B%E2%80%98stores%E2%80%99%2C%E2%80%99transactions%E2%80%99%5D)%3B%3C%2FCODE%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-741986871%22%20id%3D%22toc-hId-741982071%22%3EThen%2C%26nbsp%3Bsetup%20your%203rd%20party%20monitoring%20(in%20this%20case%2C%20with%20Datadog)%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOnce%20you%20confirm%20that%20your%20read-only%20user%20is%20able%20to%20collect%20the%20metrics%20you%20want%20to%20track%20on%20your%20Azure%20Postgres%20single%20server%2C%20you%20are%20now%20ready%20to%20set%20up%20your%203%3CSUP%3Erd%3C%2FSUP%3E%20party%20monitoring!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20this%20you%20will%20need%20two%20things.%20First%2C%20a%20Datadog%20account.%20Second%2C%20a%20machine%20that%20will%20host%20your%20Datadog%20agent%2C%20to%20do%20the%20heavy%20lifting%20of%20connecting%20to%20your%20database%20to%20extract%20the%20metrics%20you%20want%20and%20to%20push%20the%20metrics%20into%20your%20Datadog%20workspace.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20this%20exercise%2C%20I%20had%20an%20Azure%20Linux%20virtual%20machine%20handy%20that%20I%20could%20use%20as%20the%20agent%20host%2C%20but%20you%20can%20follow%20-ERR%3AREF-NOT-FOUND-quickstart%20guides%20available%20for%20Azure%20Virtual%20Machines%20to%20create%20a%20new%20machine%20or%20use%20an%20existing%20one.%20Datadog%20provides%20scripts%20to%20set%20up%20diverse%20environments%2C%20which%20you%20can%20find%20after%20you%20log%20in%20to%20your%20Datadog%20account%20and%20go%20to%20the%20Agents%20section%20in%20Datadog%E2%80%99s%26nbsp%3B-ERR%3AREF-NOT-FOUND-Postgres%20Integrations%20page.%20Following%20the%20instructions%2C%20you%20should%20get%20message%20similar%20to%20the%20following.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22datadog-agent-setup-success.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F207558iE53A764C7788A5F1%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22datadog-agent-setup-success.png%22%20alt%3D%22datadog%20agent%20setup%20success%20state%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3Edatadog%20agent%20setup%20success%20state%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENext%20step%20is%20to%20configure%20datadog%20agent%20for%20Postgres%20specific%20collection.%20If%20you%20aren%E2%80%99t%20already%20working%20with%20an%20existing%20%3CCODE%20style%3D%22color%3A%20black%3B%22%3Epostgres.d%2Fconf.yaml%3C%2FCODE%3E%2C%20just%20copy%20the%20%3CCODE%20style%3D%22color%3A%20black%3B%22%3Econf.yaml.example%3C%2FCODE%3E%20in%20%3CCODE%20style%3D%22color%3A%20black%3B%22%3E%2Fetc%2Fdatadog-agent%2Fconf.d%2Fpostgres.d%2F%3C%2FCODE%3E%20and%20adjust%20to%20your%20needs.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOnce%20you%20follow%20the%20directions%20and%20set%20up%20your%20%3CCODE%20style%3D%22color%3A%20black%3B%22%3Ehost%3C%2FCODE%3E%2C%20%3CCODE%20style%3D%22color%3A%20black%3B%22%3Eport%3C%2FCODE%3E%2C%20%3CCODE%20style%3D%22color%3A%20black%3B%22%3Euser%3C%2FCODE%3E%2C%20and%20%3CCODE%20style%3D%22color%3A%20black%3B%22%3Epassword%3C%2FCODE%3E%20in%20%3CCODE%20style%3D%22color%3A%20black%3B%22%3E%2Fetc%2Fdatadog-agent%2Fconf.d%2Fpostgres.d%2Fconf.yaml%3C%2FCODE%3E%2C%20the%20part%20that%20remains%20is%20to%20set%20up%20your%20custom%20metrics%20section%20with%20below%20snippet.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-yaml%22%3E%3CCODE%3Ecustom_queries%3A%0A%20%20%20%20%20%20%20-%20metric_prefix%3A%20azure.postgres.single_server.custom_metrics%0A%20%20%20%20%20%20%20%20%20query%3A%20select%20database_name%2C%20schema_name%2C%20table_name%2C%20table_bloat%2C%20wastedbytes%2C%20index_name%2C%20index_bloat%2C%20wastedibytes%20from%20get_bloat()%3B%0A%20%20%20%20%20%20%20%20%20columns%3A%0A%20%20%20%20%20%20%20%20%20%20%20-%20name%3A%20database_name%0A%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20tag%0A%20%20%20%20%20%20%20%20%20%20%20-%20name%3A%20schema_name%0A%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20tag%0A%20%20%20%20%20%20%20%20%20%20%20-%20name%3A%20table_name%0A%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20tag%0A%20%20%20%20%20%20%20%20%20%20%20-%20name%3A%20table_bloat%0A%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20gauge%0A%20%20%20%20%20%20%20%20%20%20%20-%20name%3A%20wastedbytes%0A%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20gauge%0A%20%20%20%20%20%20%20%20%20%20%20-%20name%3A%20index_name%0A%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20tag%0A%20%20%20%20%20%20%20%20%20%20%20-%20name%3A%20index_bloat%0A%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20gauge%0A%20%20%20%20%20%20%20%20%20%20%20-%20name%3A%20wastedibytes%0A%20%20%20%20%20%20%20%20%20%20%20%20%20type%3A%20gauge%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOnce%20this%20step%20is%20done%2C%20all%20you%20need%20to%20do%20is%20to%20restart%20your%20datadog-agent%20%3CCODE%20style%3D%22color%3A%20black%3B%22%3Esudo%20systemctl%20restart%20datadog-agent%3C%2FCODE%3E%20for%20your%20custom%20metrics%20to%20start%20flowing%20in.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--1065467592%22%20id%3D%22toc-hId--1065472392%22%3ESetup%20your%20new%20bloat%20monitoring%20dashboard%20for%20Azure%20Database%20for%20PostgreSQL%20%E2%80%93%20Single%20Server%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20all%20goes%20well%2C%20you%20should%20be%20able%20to%20see%20your%20custom%20metrics%20in%20%3CSTRONG%3EMetrics%20Explorer%3C%2FSTRONG%3E%20shortly!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22datadog-custom-metrics-flowing-successfully.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F207559i8B2BA9D8AF77AF5B%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22datadog-custom-metrics-flowing-successfully.png%22%20alt%3D%22azure%20postgresql%20custom%20metrics%20flowing%20successfully%20into%20datadog%20workspace%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3Eazure%20postgresql%20custom%20metrics%20flowing%20successfully%20into%20datadog%20workspace%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFrom%20above%20you%20can%20export%20these%20charts%20to%20a%20new%20or%20existing%20dashboard%20and%20edit%20the%20widgets%20to%20your%20needs%20to%20show%20separate%20visuals%20by%20dimensions%20as%20table%20or%20index%20or%20you%20can%20simply%20overlay%20them%20as%20below.%20Datadog%20documentation%20is%20quite%20rich%20to%20help%20you%20out.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22datadog-dashboard-showing-azure-pg-custom-metrics.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F207560i7953951E5CC2CD26%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22datadog-dashboard-showing-azure-pg-custom-metrics.png%22%20alt%3D%22custom%20metrics%20added%20to%20a%20new%20dashboard%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3Ecustom%20metrics%20added%20to%20a%20new%20dashboard%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EKnowing%20how%20your%20bloat%20metrics%20are%20trending%20will%20help%20you%20investigate%20performance%20problems%20and%20help%20you%20to%20identify%20if%20bloat%20is%20contributing%20to%20performance%20fluctuations.%20Monitoring%20bloat%20in%20Postgres%20will%20also%20help%20you%20evaluate%20whether%20your%20workload%20(or%20your%20Postgres%20tables)%20are%20configured%20optimally%20for%20-ERR%3AREF-NOT-FOUND-autovacuum%20to%20perform%20its%20function.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1422045241%22%20id%3D%22toc-hId-1422040441%22%3EUsing%20custom%20metrics%20makes%20it%20easy%20to%20monitor%20bloat%20in%20Azure%20Database%20for%20PostgreSQL%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20can%20and%20absolutely%20should%20track%20bloat.%20And%20with%20custom%20metrics%20and%20Datadog%2C%20you%20can%20easily%20track%20bloat%20in%20your%20workload%20for%20an%20Azure%20Database%20for%20PostgreSQL%20server.%20You%20can%20track%20other%20types%20of%20custom%20Postgres%20metrics%20easily%20in%20the%20same%20fashion.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOne%20more%20thing%20to%20keep%20in%20mind%3A%20I%20recommend%20you%20always%20be%20intentional%20on%20what%20and%20how%20to%20collect%2C%20as%20metric%20polling%20can%20impact%20your%20workload.%20%3CBR%20%2F%3E%3CBR%20%2F%3EIf%20you%20have%20a%20much%20more%20demanding%20workload%20and%20are%20using%20Hyperscale%20(Citus)%20to%20scale%20out%20Postgres%20horizontally%2C%20I%20will%20soon%20have%20a%20post%20on%20how%20you%20can%20monitor%20bloat%20with%20custom%20metrics%20in%26nbsp%3B-ERR%3AREF-NOT-FOUND-Azure%20Database%20for%20Postgres%20-%20Hyperscale%20(Citus).%20I%20look%20forward%20to%20seeing%20you%20there!%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1542366%22%20slang%3D%22en-US%22%3E%3CDIV%3ETracking%20bloat%20in%20your%20Azure%20Database%20for%20PostgreSQL%20database%20is%20easy%20with%20custom%20metrics%2C%20Datadog%2C%20%26amp%3B%20this%20how-to%20post.%3C%2FDIV%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Monitoring-Bloat-with-Custom-Metrics-on-Azure-Database-for-PostgreSQL-999x463-blue.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F207561i004AE7BBE24C41B8%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Monitoring-Bloat-with-Custom-Metrics-on-Azure-Database-for-PostgreSQL-999x463-blue.png%22%20alt%3D%22monitor%20bloat%20with%20custom%20metrics%20in%20azure%20database%20for%20postgresql%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3Emonitor%20bloat%20with%20custom%20metrics%20in%20azure%20database%20for%20postgresql%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1542366%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3Ebloat%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMonitoring%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPerformance%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Etuning%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Version history
Last update:
‎Jul 27 2020 09:57 AM
Updated by: