Skip to content

Commit 553ef09

Browse files
Andrew Wilkinsmergify-bot
authored andcommitted
model: change Host.IP to an array (#6694)
ECS states that this field is an array. (cherry picked from commit fbb6167)
1 parent 0b555b8 commit 553ef09

41 files changed

Lines changed: 1064 additions & 361 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎beater/api/mux.go‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,12 @@ func emptyRequestMetadata(c *request.Context) model.APMEvent {
309309
}
310310

311311
func backendRequestMetadata(c *request.Context) model.APMEvent {
312+
var hostIP []net.IP
313+
if c.ClientIP != nil {
314+
hostIP = []net.IP{c.ClientIP}
315+
}
312316
return model.APMEvent{
313-
Host: model.Host{IP: c.ClientIP},
317+
Host: model.Host{IP: hostIP},
314318
Timestamp: c.Timestamp,
315319
}
316320
}

‎beater/test_approved_es_documents/TestPublishIntegrationErrors.approved.json‎

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,9 @@
222222
"host": {
223223
"architecture": "x64",
224224
"hostname": "node-name",
225-
"ip": "127.0.0.1",
225+
"ip": [
226+
"127.0.0.1"
227+
],
226228
"name": "prod.example",
227229
"os": {
228230
"platform": "darwin"
@@ -409,7 +411,9 @@
409411
"host": {
410412
"architecture": "x64",
411413
"hostname": "node-name",
412-
"ip": "127.0.0.1",
414+
"ip": [
415+
"127.0.0.1"
416+
],
413417
"name": "prod.example",
414418
"os": {
415419
"platform": "darwin"
@@ -527,7 +531,9 @@
527531
"host": {
528532
"architecture": "x64",
529533
"hostname": "node-name",
530-
"ip": "127.0.0.1",
534+
"ip": [
535+
"127.0.0.1"
536+
],
531537
"name": "prod.example",
532538
"os": {
533539
"platform": "darwin"
@@ -645,7 +651,9 @@
645651
"host": {
646652
"architecture": "x64",
647653
"hostname": "node-name",
648-
"ip": "127.0.0.1",
654+
"ip": [
655+
"127.0.0.1"
656+
],
649657
"name": "prod.example",
650658
"os": {
651659
"platform": "darwin"
@@ -767,7 +775,9 @@
767775
"host": {
768776
"architecture": "x64",
769777
"hostname": "node-name",
770-
"ip": "127.0.0.1",
778+
"ip": [
779+
"127.0.0.1"
780+
],
771781
"name": "prod.example",
772782
"os": {
773783
"platform": "darwin"

‎beater/test_approved_es_documents/TestPublishIntegrationEvents.approved.json‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,9 @@
148148
"host": {
149149
"architecture": "amd64",
150150
"hostname": "node-name",
151-
"ip": "127.0.0.1",
151+
"ip": [
152+
"127.0.0.1"
153+
],
152154
"name": "host1",
153155
"os": {
154156
"platform": "Linux"
@@ -315,7 +317,9 @@
315317
"host": {
316318
"architecture": "amd64",
317319
"hostname": "node-name",
318-
"ip": "127.0.0.1",
320+
"ip": [
321+
"127.0.0.1"
322+
],
319323
"name": "host1",
320324
"os": {
321325
"platform": "Linux"
@@ -483,7 +487,9 @@
483487
"host": {
484488
"architecture": "amd64",
485489
"hostname": "node-name",
486-
"ip": "127.0.0.1",
490+
"ip": [
491+
"127.0.0.1"
492+
],
487493
"name": "host1",
488494
"os": {
489495
"platform": "Linux"
@@ -675,7 +681,9 @@
675681
"host": {
676682
"architecture": "amd64",
677683
"hostname": "node-name",
678-
"ip": "127.0.0.1",
684+
"ip": [
685+
"127.0.0.1"
686+
],
679687
"name": "host1",
680688
"os": {
681689
"platform": "Linux"

‎beater/test_approved_es_documents/TestPublishIntegrationMetricsets.approved.json‎

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
"version": "1.12.0"
1414
},
1515
"host": {
16-
"ip": "127.0.0.1"
16+
"ip": [
17+
"127.0.0.1"
18+
]
1719
},
1820
"labels": {
1921
"some": "abc",
@@ -80,7 +82,9 @@
8082
},
8183
"go.memstats.heap.sys.bytes": 6520832,
8284
"host": {
83-
"ip": "127.0.0.1"
85+
"ip": [
86+
"127.0.0.1"
87+
]
8488
},
8589
"labels": {
8690
"some": "abc",
@@ -134,7 +138,9 @@
134138
"version": "1.12.0"
135139
},
136140
"host": {
137-
"ip": "127.0.0.1"
141+
"ip": [
142+
"127.0.0.1"
143+
]
138144
},
139145
"labels": {
140146
"some": "abc",
@@ -190,7 +196,9 @@
190196
"version": "1.12.0"
191197
},
192198
"host": {
193-
"ip": "127.0.0.1"
199+
"ip": [
200+
"127.0.0.1"
201+
]
194202
},
195203
"labels": {
196204
"some": "abc",
@@ -258,7 +266,9 @@
258266
"version": "1.12.0"
259267
},
260268
"host": {
261-
"ip": "127.0.0.1"
269+
"ip": [
270+
"127.0.0.1"
271+
]
262272
},
263273
"labels": {
264274
"some": "abc",

‎beater/test_approved_es_documents/TestPublishIntegrationMinimalEvents.approved.json‎

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
}
2121
},
2222
"host": {
23-
"ip": "127.0.0.1"
23+
"ip": [
24+
"127.0.0.1"
25+
]
2426
},
2527
"message": "error log message",
2628
"observer": {
@@ -63,7 +65,9 @@
6365
"id": "abcdef0123456790"
6466
},
6567
"host": {
66-
"ip": "127.0.0.1"
68+
"ip": [
69+
"127.0.0.1"
70+
]
6771
},
6872
"message": "error exception message",
6973
"observer": {
@@ -106,7 +110,9 @@
106110
"id": "abcdef0123456791"
107111
},
108112
"host": {
109-
"ip": "127.0.0.1"
113+
"ip": [
114+
"127.0.0.1"
115+
]
110116
},
111117
"observer": {
112118
"ephemeral_id": "00000000-0000-0000-0000-000000000000",
@@ -142,7 +148,9 @@
142148
"outcome": "unknown"
143149
},
144150
"host": {
145-
"ip": "127.0.0.1"
151+
"ip": [
152+
"127.0.0.1"
153+
]
146154
},
147155
"observer": {
148156
"ephemeral_id": "00000000-0000-0000-0000-000000000000",
@@ -192,7 +200,9 @@
192200
"outcome": "unknown"
193201
},
194202
"host": {
195-
"ip": "127.0.0.1"
203+
"ip": [
204+
"127.0.0.1"
205+
]
196206
},
197207
"observer": {
198208
"ephemeral_id": "00000000-0000-0000-0000-000000000000",
@@ -242,7 +252,9 @@
242252
"outcome": "unknown"
243253
},
244254
"host": {
245-
"ip": "127.0.0.1"
255+
"ip": [
256+
"127.0.0.1"
257+
]
246258
},
247259
"labels": {
248260
"wrapped_reporter": "true"
@@ -293,7 +305,9 @@
293305
"version": "1.12.0"
294306
},
295307
"host": {
296-
"ip": "127.0.0.1"
308+
"ip": [
309+
"127.0.0.1"
310+
]
297311
},
298312
"metricset.name": "app",
299313
"observer": {

0 commit comments

Comments
 (0)