Metricbeat > Module PostgreSQL > wrong mapping of blk_read_time and blk_write_time

Hi,

I think there is a bug in the PostgreSQL module of Metricbeat.

According to beats/metricbeat/module/postgresql/database/data.go, the following fields are mapped as Integer:

	    "blocks": s.Object{
...
		"time": s.Object{
			"read":  s.Object{"ms": c.Int("blk_read_time")},
			"write": s.Object{"ms": c.Int("blk_write_time")},
		},
...

But according to the official PostgreSQL documentation, theses columns are double precision - see PostgreSQL: Documentation: 9.2: The Statistics Collector

Due to this, once the "track_io_timing" feature is enabled at PostgreSQL side then the fields postgresql.database.blocks.time.read.ms and postgresql.database.blocks.time.write.ms are always missing (more than probably due to an error while mapping).

Can you confirm ?

Kind regards,
Fabien.

Bug reported on Github [Metricbeat] [PostgreSQL] module [database] metricset - wrong mapping for blk_read_time and blk_write_time · Issue #25301 · elastic/beats · GitHub

Hi @fabski, welcome to discuss :slight_smile:

I think you are right, these fields should be defined as double, thanks for reporting!