diff --git a/input/elasticapm/internal/modeldecoder/v2/span_test.go b/input/elasticapm/internal/modeldecoder/v2/span_test.go index 520bc923..ff931ed9 100644 --- a/input/elasticapm/internal/modeldecoder/v2/span_test.go +++ b/input/elasticapm/internal/modeldecoder/v2/span_test.go @@ -460,12 +460,12 @@ func TestDecodeMapToSpanModel(t *testing.T) { t.Run("network", func(t *testing.T) { attrs := map[string]interface{}{ - "net.host.connection.type": "cell", - "net.host.connection.subtype": "LTE", - "net.host.carrier.name": "Vodafone", - "net.host.carrier.mnc": "01", - "net.host.carrier.mcc": "101", - "net.host.carrier.icc": "UK", + "network.connection.type": "cell", + "network.connection.subtype": "LTE", + "network.carrier.name": "Vodafone", + "network.carrier.mnc": "01", + "network.carrier.mcc": "101", + "network.carrier.icc": "UK", } var input span var event modelpb.APMEvent diff --git a/input/elasticapm/internal/modeldecoder/v2/transaction_test.go b/input/elasticapm/internal/modeldecoder/v2/transaction_test.go index 662071f7..6363cea7 100644 --- a/input/elasticapm/internal/modeldecoder/v2/transaction_test.go +++ b/input/elasticapm/internal/modeldecoder/v2/transaction_test.go @@ -563,12 +563,12 @@ func TestDecodeMapToTransactionModel(t *testing.T) { t.Run("network", func(t *testing.T) { attrs := map[string]interface{}{ - "net.host.connection.type": "cell", - "net.host.connection.subtype": "LTE", - "net.host.carrier.name": "Vodafone", - "net.host.carrier.mnc": "01", - "net.host.carrier.mcc": "101", - "net.host.carrier.icc": "UK", + "network.connection.type": "cell", + "network.connection.subtype": "LTE", + "network.carrier.name": "Vodafone", + "network.carrier.mnc": "01", + "network.carrier.mcc": "101", + "network.carrier.icc": "UK", } var input transaction var event modelpb.APMEvent diff --git a/input/otlp/logs.go b/input/otlp/logs.go index 979e1c40..8906dcbb 100644 --- a/input/otlp/logs.go +++ b/input/otlp/logs.go @@ -174,6 +174,14 @@ func (c *Consumer) convertLogRecord( event.Session = modelpb.SessionFromVTPool() } event.Session.Id = v.Str() + case attributeNetworkConnectionType: + if event.Network == nil { + event.Network = modelpb.NetworkFromVTPool() + } + if event.Network.Connection == nil { + event.Network.Connection = modelpb.NetworkConnectionFromVTPool() + } + event.Network.Connection.Type = v.Str() default: setLabel(replaceDots(k), event, ifaceAttributeValue(v)) } diff --git a/input/otlp/traces.go b/input/otlp/traces.go index 533a1000..af99fa9a 100644 --- a/input/otlp/traces.go +++ b/input/otlp/traces.go @@ -63,12 +63,12 @@ const ( outcomeFailure = "failure" outcomeUnknown = "unknown" - attributeNetworkConnectionType = "net.host.connection.type" - attributeNetworkConnectionSubtype = "net.host.connection.subtype" - attributeNetworkMCC = "net.host.carrier.mcc" - attributeNetworkMNC = "net.host.carrier.mnc" - attributeNetworkCarrierName = "net.host.carrier.name" - attributeNetworkICC = "net.host.carrier.icc" + attributeNetworkConnectionType = "network.connection.type" + attributeNetworkConnectionSubtype = "network.connection.subtype" + attributeNetworkMCC = "network.carrier.mcc" + attributeNetworkMNC = "network.carrier.mnc" + attributeNetworkCarrierName = "network.carrier.name" + attributeNetworkICC = "network.carrier.icc" attributeHttpRequestMethod = "http.request.method" attributeHttpResponseStatusCode = "http.response.status_code" attributeServerAddress = "server.address" diff --git a/input/otlp/traces_test.go b/input/otlp/traces_test.go index c7951314..1feb3126 100644 --- a/input/otlp/traces_test.go +++ b/input/otlp/traces_test.go @@ -752,12 +752,12 @@ func TestSpanTypePriorities(t *testing.T) { func TestSpanNetworkAttributes(t *testing.T) { networkAttributes := map[string]interface{}{ - "net.host.connection.type": "cell", - "net.host.connection.subtype": "LTE", - "net.host.carrier.name": "Vodafone", - "net.host.carrier.mnc": "01", - "net.host.carrier.mcc": "101", - "net.host.carrier.icc": "UK", + "network.connection.type": "cell", + "network.connection.subtype": "LTE", + "network.carrier.name": "Vodafone", + "network.carrier.mnc": "01", + "network.carrier.mcc": "101", + "network.carrier.icc": "UK", } txEvent := transformTransactionWithAttributes(t, networkAttributes) spanEvent := transformSpanWithAttributes(t, networkAttributes)