# Metricbeat \> Module PostgreSQL \> wrong mapping of blk\_read\_time and blk\_write\_time

**URL:** <https://discuss.elastic.co/t/metricbeat-module-postgresql-wrong-mapping-of-blk-read-time-and-blk-write-time/270722>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [April 20, 2021, 2:04pm UTC](https://discuss.elastic.co/t/metricbeat-module-postgresql-wrong-mapping-of-blk-read-time-and-blk-write-time/270722 "2021-04-20T14:04:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fabski](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fabski/32/87420_2.png) [@fabski](https://discuss.elastic.co/u/fabski)\
**Post date:** [April 20, 2021, 2:04pm UTC](https://discuss.elastic.co/t/metricbeat-module-postgresql-wrong-mapping-of-blk-read-time-and-blk-write-time/270722/1 "2021-04-20T14:04:47Z")

</div>

Hi,

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

According to [beats/metricbeat/module/postgresql/database/data.go](https://github.com/elastic/beats/blob/master/metricbeat/module/postgresql/database/data.go#L40-L41), the following fields are mapped as Integer:

```auto
	    "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](https://www.postgresql.org/docs/9.2/monitoring-stats.html#PG-STAT-DATABASE-VIEW)

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.

---

<div class="post-metadata">

**Author:** ![fabski](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fabski/32/87420_2.png) [@fabski](https://discuss.elastic.co/u/fabski)\
**Post date:** [April 26, 2021, 9:30am UTC](https://discuss.elastic.co/t/metricbeat-module-postgresql-wrong-mapping-of-blk-read-time-and-blk-write-time/270722/2 "2021-04-26T09:30:15Z")

</div>

> [@fabski](#):
>
> track\_io\_timing

Bug reported on Github [[Metricbeat] [PostgreSQL] module [database] metricset - wrong mapping for blk\_read\_time and blk\_write\_time · Issue #25301 · elastic/beats · GitHub](https://github.com/elastic/beats/issues/25301)

---

<div class="post-metadata">

**Author:** ![jsoriano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsoriano/32/27920_2.png) [@jsoriano](https://discuss.elastic.co/u/jsoriano)\
**Post date:** [April 26, 2021, 5:50pm UTC](https://discuss.elastic.co/t/metricbeat-module-postgresql-wrong-mapping-of-blk-read-time-and-blk-write-time/270722/3 "2021-04-26T17:50:48Z")

</div>

Hi @fabski, welcome to discuss 🙂

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 24, 2021, 7:51pm UTC](https://discuss.elastic.co/t/metricbeat-module-postgresql-wrong-mapping-of-blk-read-time-and-blk-write-time/270722/4 "2021-05-24T19:51:27Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
