[pg_stat_monitor] pg_stat_monitor_internal: API version not supported

Hello Percona Team,

I am trying to integrate pg_stat_monitor with PMM2 Server (Docker Setup). Here are my installed PG packages via Yum.

Installed Packages
gnupg2.x86_64                                   2.0.22-5.el7_5                        @base
gpgme.x86_64                                    1.3.2-5.el7                           @base
libgpg-error.x86_64                             1.12-3.el7                            @base
pg_stat_monitor_12.x86_64                       2.0.1-1PGDG.rhel7                     @pgdg12
pganalyze-collector.x86_64                      0.50.1-1                              @pganalyze_collector
pgdg-redhat-repo.noarch                         42.0-32                               @/pgdg-redhat-repo-latest.noarch
postgresql12.x86_64                             12.15-1PGDG.rhel7                     @pgdg12
postgresql12-contrib.x86_64                     12.15-1PGDG.rhel7                     @pgdg12
postgresql12-devel.x86_64                       12.15-1PGDG.rhel7                     @pgdg12
postgresql12-libs.x86_64                        12.15-1PGDG.rhel7                     @pgdg12
postgresql12-server.x86_64                      12.15-1PGDG.rhel7                     @pgdg12
pygpgme.x86_64                                  0.3-9.el7                             @base

Atleast, according to me - I am using the latest version of PMM Server and pg_stat_monitor, But I am getting error while querying pg_stat_monitor.

postgres=# SELECT pg_stat_monitor_version();
 pg_stat_monitor_version
-------------------------
 2.0.1
(1 row)

postgres=# select count(*) from pg_stat_monitor;
ERROR:  [pg_stat_monitor] pg_stat_monitor_internal: API version not supported.
HINT:  Upgrade pg_stat_monitor extension

Also, here is how its configured in postgresql.conf

shared_preload_libraries = 'pg_prewarm, timescaledb, auto_explain, pg_stat_statements, pg_stat_monitor'
auto_explain.log_min_duration = '0.5s'
auto_explain.log_format = 'json'
auto_explain.log_min_duration = '500'
auto_explain.log_analyze = 'on'
auto_explain.log_buffers = 'on'
auto_explain.log_timing = 'off'
auto_explain.log_triggers = 'on'
auto_explain.log_verbose = 'on'
auto_explain.log_nested_statements = 'on'
auto_explain.sample_rate= '1'

pg_stat_monitor.pgsm_query_max_len = 4096
pg_stat_monitor.pgsm_normalized_query = 0
pg_stat_monitor.pgsm_enable_query_plan = 1

Also, in case if this is useful, here is pmm-admin status:

pmm-admin status
Agent ID : /agent_id/4d8ed7c0-23db-4bad-9d34-b4a8a4d3a58a
Node ID  : /node_id/e94a5f96-cc32-460a-add6-606bc4513c5b
Node name: xxxx

PMM Server:
	URL    : https://xxx:443/
	Version: 2.39.0

PMM Client:
	Connected        : true
	Time drift       : 7.309169ms
	Latency          : 7.56792ms
	Connection uptime: 100
	pmm-admin version: 2.37.0
	pmm-agent version: 2.37.0
Agents:
	/agent_id/0968c78a-fab2-41f6-ac9a-ac59ec5c503b vmagent Running 42000
	/agent_id/36ad5207-3c96-4c15-9d82-6790214ee137 postgresql_pgstatmonitor_agent Waiting 0
	/agent_id/38c5e31f-562f-4ab2-9e64-87dd6eed4ef9 postgres_exporter Running 42001
	/agent_id/9d53d8b5-f720-46ee-a523-01809d7749ef node_exporter Running 42002

Kindly help to find the issue and please share what I am missing here. Thank you for your time in advance.

hello, anyone can help?

Anyone can help … Please!!