Skip to content

model: change Host.IP to an array #6694

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

Merged
merged 3 commits into from
Nov 23, 2021
Merged

Conversation

axw
Copy link
Member

@axw axw commented Nov 23, 2021

Motivation/summary

ECS states that host.ip should hold an array of values. Let's align with ECS before we settle on a stable encoding.

Checklist

How to test these changes

  1. Run apm-server, send events
  2. Check a transaction sample's metadata, host.ip should be rendered sensibly in the flyout in the UI
  3. Check the document's _source, host.ip should be an array (even if there's just one IP).

Related issues

#4120

@axw axw added v8.0.0 backport-8.0 Automated backport with mergify labels Nov 23, 2021
ECS states that this field is an array.
@axw axw force-pushed the model-host-ip-array branch from 1484024 to 4ca999a Compare November 23, 2021 05:37
@apmmachine
Copy link
Contributor

apmmachine commented Nov 23, 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 preview

Expand to view the summary

Build stats

  • Start Time: 2021-11-23T08:09:16.084+0000

  • Duration: 40 min 17 sec

  • Commit: dfaed22

Test stats 🧪

Test Results
Failed 0
Passed 5622
Skipped 19
Total 5641

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /hey-apm : Run the hey-apm benchmark.

  • /package : Generate and publish the docker images.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@axw axw requested a review from a team November 23, 2021 06:22
@axw axw marked this pull request as ready for review November 23, 2021 06:22
@axw axw enabled auto-merge (squash) November 23, 2021 08:08
@axw axw merged commit fbb6167 into elastic:master Nov 23, 2021
mergify bot pushed a commit that referenced this pull request Nov 23, 2021
ECS states that this field is an array.

(cherry picked from commit fbb6167)
axw added a commit that referenced this pull request Nov 23, 2021
ECS states that this field is an array.

(cherry picked from commit fbb6167)

Co-authored-by: Andrew Wilkins <[email protected]>
@marclop
Copy link
Contributor

marclop commented Dec 21, 2021

Verified with 9bb5e4c:

$ curl -H "Content-type: application/x-ndjson" --data-binary @testdata/intake-v2/transactions.ndjson http://localhost:8200/intake/v2/events
GET traces-apm*/_search
{
  "_source": [false], 
  "fields": ["host.ip"],
  "query": {
    "exists": {
      "field": "host.ip"
    }
  }
}
{
  "took" : 840,
  "timed_out" : false,
  "_shards" : {
    "total" : 2,
    "successful" : 2,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : {
      "value" : 5,
      "relation" : "eq"
    },
    "max_score" : 1.0,
    "hits" : [
      {
        "_index" : ".ds-traces-apm-default-2021.12.21-000001",
        "_id" : "gDPr230ByDpadNqDk0pg",
        "_score" : 1.0,
        "_source" : { },
        "fields" : {
          "host.ip" : [
            "127.0.0.1"
          ]
        }
      },
      {
        "_index" : ".ds-traces-apm-default-2021.12.21-000001",
        "_id" : "gTPr230ByDpadNqDk0pg",
        "_score" : 1.0,
        "_source" : { },
        "fields" : {
          "host.ip" : [
            "127.0.0.1"
          ]
        }
      },
      {
        "_index" : ".ds-traces-apm-default-2021.12.21-000001",
        "_id" : "gjPr230ByDpadNqDk0pg",
        "_score" : 1.0,
        "_source" : { },
        "fields" : {
          "host.ip" : [
            "127.0.0.1"
          ]
        }
      },
      {
        "_index" : ".ds-traces-apm-default-2021.12.21-000001",
        "_id" : "gzPr230ByDpadNqDk0pg",
        "_score" : 1.0,
        "_source" : { },
        "fields" : {
          "host.ip" : [
            "127.0.0.1"
          ]
        }
      },
      {
        "_index" : ".ds-traces-apm-default-2021.12.21-000001",
        "_id" : "hDPr230ByDpadNqDk0pg",
        "_score" : 1.0,
        "_source" : { },
        "fields" : {
          "host.ip" : [
            "127.0.0.1"
          ]
        }
      }
    ]
  }
}

It is also displayed correctly in the APM UI:

image

@marclop marclop self-assigned this Dec 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants