Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Carson Ip <[email protected]>
  • Loading branch information
JonasKunz and carsonip authored Apr 5, 2024
1 parent 03af947 commit c33b7ae
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions input/elasticapm/internal/modeldecoder/v2/decoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -715,11 +715,11 @@ func mapToMetadataModel(from *metadata, out *modelpb.APMEvent) {
}
out.Host.Hostname = from.System.DetectedHostname.Val
}
if from.System.HostId.IsSet() {
if from.System.HostID.IsSet() {
if out.Host == nil {
out.Host = modelpb.HostFromVTPool()
}
out.Host.Id = from.System.HostId.Val
out.Host.Id = from.System.HostID.Val
}
if !from.System.ConfiguredHostname.IsSet() && !from.System.DetectedHostname.IsSet() &&
from.System.DeprecatedHostname.IsSet() {
Expand Down
2 changes: 1 addition & 1 deletion input/elasticapm/internal/modeldecoder/v2/metadata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ func TestDecodeMapToMetadataModel(t *testing.T) {
input.System.ConfiguredHostname.Set("configured-host")
input.System.DetectedHostname.Set("detected-host")
input.System.DeprecatedHostname.Set("deprecated-host")
input.System.HostId.Set("host-id")
input.System.HostID.Set("host-id")
mapToMetadataModel(&input, &out)
assert.Equal(t, "configured-host", out.Host.Name)
assert.Equal(t, "detected-host", out.Host.Hostname)
Expand Down
2 changes: 1 addition & 1 deletion input/elasticapm/internal/modeldecoder/v2/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ type metadataSystem struct {
// Platform name of the system platform the monitored service is running on.
Platform nullable.String `json:"platform" validate:"maxLength=1024"`
// The OpenTelemetry semantic conventions compliant "host.id" attribute, if available.
HostId nullable.String `json:"host_id" validate:"maxLength=1024"`
HostID nullable.String `json:"host_id" validate:"maxLength=1024"`
}

type metadataSystemContainer struct {
Expand Down

0 comments on commit c33b7ae

Please sign in to comment.