Skip to content

Commit 4fa6b6a

Browse files
tobiasstadleraxw
andauthored
Only overwrite service.version if service.name is also set (#7281)
* Only overwrite service.version if service.name is also set * Added #7281 to the changelog * Fixed tests Co-authored-by: Andrew Wilkins <axw@elastic.co>
1 parent e651ddd commit 4fa6b6a

File tree

9 files changed

+13
-26
lines changed

9 files changed

+13
-26
lines changed

beater/test_approved_es_documents/TestPublishIntegrationErrors.approved.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,7 @@
327327
"runtime": {
328328
"name": "node",
329329
"version": "8.0.0"
330-
},
331-
"version": "5.1.3"
330+
}
332331
},
333332
"source": {
334333
"ip": "12.53.12.1"

beater/test_approved_es_documents/TestPublishIntegrationEvents.approved.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,7 @@
261261
"runtime": {
262262
"name": "Java",
263263
"version": "10.0.2"
264-
},
265-
"version": "4.3.0"
264+
}
266265
},
267266
"source": {
268267
"ip": "12.53.12.1"
@@ -400,8 +399,7 @@
400399
"runtime": {
401400
"name": "Java",
402401
"version": "10.0.2"
403-
},
404-
"version": "4.3.0"
402+
}
405403
},
406404
"span": {
407405
"action": "connect",
@@ -602,8 +600,7 @@
602600
"runtime": {
603601
"name": "Java",
604602
"version": "10.0.2"
605-
},
606-
"version": "4.3.0"
603+
}
607604
},
608605
"source": {
609606
"ip": "12.53.12.1",

beater/test_approved_es_documents/TestPublishIntegrationSpans.approved.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -655,8 +655,7 @@
655655
"runtime": {
656656
"name": "node",
657657
"version": "8.0.0"
658-
},
659-
"version": "5.1.3"
658+
}
660659
},
661660
"span": {
662661
"action": "query",

changelogs/head.asciidoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ See <<apm-server-configuration>> for more information.
1414
[float]
1515
==== Bug fixes
1616
- Fix infinite loop in tail-based sampling subscriber causing high CPU and repeated Elasticsearch searches {pull}7211[7211]
17+
- Do not overwrite `service version` if no transaction/error/... specific `service.name` is givven {pull}7281[7281]
1718

1819
[float]
1920
==== Intake API Changes

model/modeldecoder/rumv3/decoder.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -436,16 +436,14 @@ func mapToServiceModel(from contextService, out *model.Service) {
436436
}
437437
if from.Name.IsSet() {
438438
out.Name = from.Name.Val
439+
out.Version = from.Version.Val
439440
}
440441
if from.Runtime.Name.IsSet() {
441442
out.Runtime.Name = from.Runtime.Name.Val
442443
}
443444
if from.Runtime.Version.IsSet() {
444445
out.Runtime.Version = from.Runtime.Version.Val
445446
}
446-
if from.Version.IsSet() {
447-
out.Version = from.Version.Val
448-
}
449447
}
450448

451449
func mapToAgentModel(from contextServiceAgent, out *model.Agent) {

model/modeldecoder/v2/decoder.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,7 @@ func mapToServiceModel(from contextService, out *model.Service) {
763763
}
764764
if from.Name.IsSet() {
765765
out.Name = from.Name.Val
766+
out.Version = from.Version.Val
766767
}
767768
if from.Node.Name.IsSet() {
768769
out.Node.Name = from.Node.Name.Val
@@ -773,9 +774,6 @@ func mapToServiceModel(from contextService, out *model.Service) {
773774
if from.Runtime.Version.IsSet() {
774775
out.Runtime.Version = from.Runtime.Version.Val
775776
}
776-
if from.Version.IsSet() {
777-
out.Version = from.Version.Val
778-
}
779777
if from.Origin.IsSet() {
780778
outOrigin := &model.ServiceOrigin{}
781779
if from.Origin.ID.IsSet() {

processor/stream/test_approved_es_documents/testIntakeIntegrationErrors.approved.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,7 @@
313313
"runtime": {
314314
"name": "node",
315315
"version": "8.0.0"
316-
},
317-
"version": "5.1.3"
316+
}
318317
},
319318
"source": {
320319
"ip": "12.53.12.1"

processor/stream/test_approved_es_documents/testIntakeIntegrationEvents.approved.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,7 @@
246246
"runtime": {
247247
"name": "Java",
248248
"version": "10.0.2"
249-
},
250-
"version": "4.3.0"
249+
}
251250
},
252251
"source": {
253252
"ip": "12.53.12.1"
@@ -372,8 +371,7 @@
372371
"runtime": {
373372
"name": "Java",
374373
"version": "10.0.2"
375-
},
376-
"version": "4.3.0"
374+
}
377375
},
378376
"span": {
379377
"action": "connect",
@@ -561,8 +559,7 @@
561559
"runtime": {
562560
"name": "Java",
563561
"version": "10.0.2"
564-
},
565-
"version": "4.3.0"
562+
}
566563
},
567564
"source": {
568565
"ip": "12.53.12.1",

processor/stream/test_approved_es_documents/testIntakeIntegrationSpans.approved.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -575,8 +575,7 @@
575575
"runtime": {
576576
"name": "node",
577577
"version": "8.0.0"
578-
},
579-
"version": "5.1.3"
578+
}
580579
},
581580
"span": {
582581
"action": "query",

0 commit comments

Comments
 (0)