Skip to content

Commit a8878bf

Browse files
committed
Convert postgresql.statement.query.id to number (#24359)
It is a number, and defined as long in fields.yml, so send is as number in the document. (cherry picked from commit 5f4a5e6)
1 parent 2de6133 commit a8878bf

2 files changed

Lines changed: 11 additions & 14 deletions

File tree

metricbeat/module/postgresql/statement/_meta/data.json

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
{
22
"@timestamp": "2017-10-12T08:05:34.853Z",
3-
"agent": {
4-
"hostname": "host.example.com",
5-
"name": "host.example.com"
6-
},
73
"event": {
84
"dataset": "postgresql.statement",
95
"duration": 115000,
106
"module": "postgresql"
117
},
128
"metricset": {
13-
"name": "statement"
9+
"name": "statement",
10+
"period": 10000
1411
},
1512
"postgresql": {
1613
"statement": {
@@ -19,7 +16,7 @@
1916
},
2017
"query": {
2118
"calls": 2,
22-
"id": "1592910677",
19+
"id": 1592910677,
2320
"memory": {
2421
"local": {
2522
"dirtied": 0,
@@ -42,19 +39,19 @@
4239
"text": "SELECT * FROM pg_stat_statements",
4340
"time": {
4441
"max": {
45-
"ms": 0.388
42+
"ms": 0.161
4643
},
4744
"mean": {
48-
"ms": 0.235
45+
"ms": 0.1595
4946
},
5047
"min": {
51-
"ms": 0.082
48+
"ms": 0.158
5249
},
5350
"stddev": {
54-
"ms": 0.153
51+
"ms": 0.0015000000000000013
5552
},
5653
"total": {
57-
"ms": 0.47000000000000003
54+
"ms": 0.319
5855
}
5956
}
6057
},
@@ -64,7 +61,7 @@
6461
}
6562
},
6663
"service": {
67-
"address": "172.26.0.2:5432",
64+
"address": "192.168.144.2:5432",
6865
"type": "postgresql"
6966
}
7067
}

metricbeat/module/postgresql/statement/data.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
c "github.com/elastic/beats/v7/libbeat/common/schema/mapstrstr"
2323
)
2424

25-
// Based on: https://www.postgresql.org/docs/9.2/static/monitoring-stats.html#PG-STAT-ACTIVITY-VIEW
25+
// Based on: https://www.postgresql.org/docs/9.6/pgstatstatements.html
2626
var schema = s.Schema{
2727
"user": s.Object{
2828
"id": c.Int("userid"),
@@ -31,7 +31,7 @@ var schema = s.Schema{
3131
"oid": c.Int("dbid"),
3232
},
3333
"query": s.Object{
34-
"id": c.Str("queryid"),
34+
"id": c.Int("queryid"),
3535
"text": c.Str("query"),
3636
"calls": c.Int("calls"),
3737
"rows": c.Int("rows"),

0 commit comments

Comments
 (0)