Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add system network fields #5436

Merged
merged 10 commits into from
Jun 16, 2021
Merged

Add system network fields #5436

merged 10 commits into from
Jun 16, 2021

Conversation

jalvz
Copy link
Contributor

@jalvz jalvz commented Jun 10, 2021

Motivation/summary

See motivation on the linked ticket bellow.

Some notes:

  • Uses network instead of net because ECS prefers it.
  • Does not have a host subkey, like in the OTel spec proposal because ECS already has a top level host key. We could nest network inside host but I don't see any value in doing that.
  • Does not add RUM v3 fields.

Checklist

How to test these changes

Related issues

Closes #5203

@apmmachine
Copy link
Contributor

apmmachine commented Jun 10, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: Pull request #5436 updated

  • Start Time: 2021-06-16T11:52:34.440+0000

  • Duration: 40 min 42 sec

  • Commit: 8a24fa5

Test stats 🧪

Test Results
Failed 0
Passed 6094
Skipped 120
Total 6214

Trends 🧪

Image of Build Times

Image of Tests

Copy link
Member

@axw axw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fields and processor/otel changes LGTM, but I don't think we need the modeldecoder, processor/stream, or testdata changes.

@@ -526,6 +526,21 @@ func mapToMetadataModel(from *metadata, out *model.Metadata) {
if from.System.Platform.IsSet() {
out.System.Platform = from.System.Platform.Val
}
if from.System.Network.Carrier.Name.IsSet() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new fields are only for the iOS agent, which uses OTLP. Let's leave modeldecoder out of it please.

model/system_test.go Outdated Show resolved Hide resolved
processor/otel/metadata.go Outdated Show resolved Hide resolved
@jalvz jalvz added the v7.14.0 label Jun 15, 2021
- name: network.connection_type
type: keyword
description: |
Cellular network technology, eg. 4G
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not certain about the naming. ECS has a definition for network and one for host with some host.network fields. None of them contain what we need. This PR introduces network.carrier.* fields, that are not (yet) in ECS, but also not aligned with the otel proposal net.host.carrier.*.

@jalvz did you have a conversation with the ECS folks where they would see these fields fit in? I am a bit worried to just remove the host part, that is in the otel proposal.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have already a top level host field, I didn't think it would make much sense to duplicate the field inside network to refer to the same host?
network is already defined as top level field in ECS (https://www.elastic.co/guide/en/ecs/current/ecs-network.html),

I sort of followed #491, btw.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ECS says (about the network fieldset):

The network is defined as the communication path over which a host or network event happens.

The network.* fields should be populated with details about the network activity associated with an event.

Seems to me it makes sense to go under network

Copy link
Contributor Author

@jalvz jalvz Jun 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So let me ask:

  • host and network.host would refer to the same host, or different ones?
  • If different: which is what? If same: why duplicate a field we already have?
  • What exactly says in the ECS network definition that dictates there should be a host field inside network? (sorry I can't see that in the quote)
  • If we go with network.host, why don't we apply the same reasoning elsewhere? Eg., a process normally runs on a host, yet there is no process.host; rather 2 top fields (conceptually related).
  • If we go with network.host, how do you justify that in the context of other fields? We could have eg. network.host.connection_type="wifi" and network.name="Guest wifi" - why connection_type and name would not be at the same level?
  • What does it mean, conceptually, network.host.carrier?: a host has a carrier? a carrier runs on a host?...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After some offline discussion, network.carrier.* is where the new fields fit best related to ECS, and net.host.carrier.* was the prefered nesting in the open-telemetry proposal; so 👍 on the changes.

@mergify
Copy link
Contributor

mergify bot commented Jun 16, 2021

This pull request is now in conflicts. Could you fix it @jalvz? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b mobile-fields upstream/mobile-fields
git merge upstream/master
git push upstream mobile-fields

@jalvz jalvz requested a review from axw June 16, 2021 07:30
Copy link
Member

@axw axw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but please wait until we have consensus on #5436 (review)

@jalvz jalvz merged commit 01a12f2 into elastic:master Jun 16, 2021
mergify bot pushed a commit that referenced this pull request Jun 16, 2021
(cherry picked from commit 01a12f2)

# Conflicts:
#	changelogs/head.asciidoc
#	include/fields.go
@stuartnelson3
Copy link
Contributor

Added test-plan to this one, but feel free to remove it

@axw axw mentioned this pull request Jul 12, 2021
1 task
@simitt simitt self-assigned this Jul 12, 2021
@simitt
Copy link
Contributor

simitt commented Jul 13, 2021

Tested with BC 2 - network fields are not indexed into ES although labels are present.
Screenshot 2021-07-13 at 22 07 49

@stuartnelson3
Copy link
Contributor

Bumped to 7.15 in #5719

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add fields for mobile network connectivity attributes
5 participants