elastic / beats

:tropical_fish: Beats - Lightweight shippers for Elasticsearch & Logstash
https://www.elastic.co/products/beats
Other
12.06k stars 4.89k forks source link

[Metricbeat] [PostgreSQL] module [database] metricset - wrong mapping for blk_read_time and blk_write_time #25301

Closed fkalinowski closed 4 months ago

fkalinowski commented 3 years ago

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 wrong mapping, 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).

elasticmachine commented 3 years ago

Pinging @elastic/integrations (Team:Integrations)