Skip to content

Commit

Permalink
Consolidate model.HTTP and model.Http (#5764)
Browse files Browse the repository at this point in the history
For a long time we have had two distinct types,
model.HTTP and model.Http, for span (outgoing)
and transaction (incoming) HTTP fields.

Consolidate these two into one type, to simplify
the model and transformation to documents.

There is a minor change in precedence for handling
context.http.status_code and context.http.response.status_code.
This should not matter; the values should be the same,
and if they're not then that's on the agent.
  • Loading branch information
axw authored Jul 21, 2021
1 parent 0b60ec6 commit 46f214e
Show file tree
Hide file tree
Showing 42 changed files with 638 additions and 525 deletions.
8 changes: 4 additions & 4 deletions apmpackage/apm/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,9 @@ Traces are written to `traces-apm.*` indices.
"outcome": "unknown"
},
"http": {
"request.method": "GET",
"request": {
"method": "GET"
},
"response": {
"status_code": 200
}
Expand Down Expand Up @@ -346,11 +348,9 @@ Traces are written to `traces-apm.*` indices.
"method": "GET",
"response": {
"status_code": 200
},
"url": {
"original": "http://localhost:8000"
}
},
"http.url.original": "http://localhost:8000",
"id": "0aaaaaaaaaaaaaaa",
"name": "SELECT FROM product_types",
"stacktrace": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,7 @@
},
"http": {
"request": {
"body": {
"original": "Hello World"
},
"body.original": "Hello World",
"cookies": {
"c1": "v1",
"c2": "v2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,7 @@
},
"http": {
"request": {
"body": {
"original": "HelloWorld"
},
"body.original": "HelloWorld",
"cookies": {
"c1": "v1",
"c2": "v2"
Expand Down Expand Up @@ -315,9 +313,11 @@
}
},
"http": {
"request.method": "GET",
"request": {
"method": "GET"
},
"response": {
"status_code": 200
"status_code": 302
}
},
"kubernetes": {
Expand Down Expand Up @@ -402,13 +402,11 @@
"application/json"
]
},
"status_code": 200,
"status_code": 302,
"transfer_size": 300.12
},
"url": {
"original": "http://localhost:8000"
}
},
"http.url.original": "http://localhost:8000",
"id": "1234567890aaaade",
"name": "GET users-authenticated",
"stacktrace": [
Expand Down Expand Up @@ -481,14 +479,12 @@
},
"http": {
"request": {
"body": {
"original": {
"additional": {
"bar": 123,
"req": "additionalinformation"
},
"string": "helloworld"
}
"body.original": {
"additional": {
"bar": 123,
"req": "additionalinformation"
},
"string": "helloworld"
},
"cookies": {
"c1": "v1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,9 @@
}
},
"http": {
"request.method": "GET",
"request": {
"method": "GET"
},
"response": {
"status_code": 200
}
Expand Down Expand Up @@ -676,11 +678,9 @@
"encoded_body_size": 356,
"status_code": 200,
"transfer_size": 300.12
},
"url": {
"original": "http://localhost:8000"
}
},
"http.url.original": "http://localhost:8000",
"id": "1234567890aaaade",
"name": "SELECT FROM product_types",
"stacktrace": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,12 @@
},
"http": {
"request": {
"body": {
"original": {
"additional": {
"bar": 123,
"req": "additional information"
},
"str": "hello world"
}
"body.original": {
"additional": {
"bar": 123,
"req": "additional information"
},
"str": "hello world"
},
"cookies": {
"c1": "v1",
Expand Down
4 changes: 1 addition & 3 deletions docs/data/elasticsearch/generated/errors.json
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,7 @@
},
"http": {
"request": {
"body": {
"original": "Hello World"
},
"body.original": "Hello World",
"cookies": {
"c1": "v1",
"c2": "v2"
Expand Down
8 changes: 4 additions & 4 deletions docs/data/elasticsearch/generated/spans.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
"outcome": "unknown"
},
"http": {
"request.method": "GET",
"request": {
"method": "GET"
},
"response": {
"status_code": 200
}
Expand Down Expand Up @@ -56,11 +58,9 @@
"method": "GET",
"response": {
"status_code": 200
},
"url": {
"original": "http://localhost:8000"
}
},
"http.url.original": "http://localhost:8000",
"id": "0aaaaaaaaaaaaaaa",
"name": "SELECT FROM product_types",
"stacktrace": [
Expand Down
14 changes: 6 additions & 8 deletions docs/data/elasticsearch/generated/transactions.json
Original file line number Diff line number Diff line change
Expand Up @@ -325,14 +325,12 @@
},
"http": {
"request": {
"body": {
"original": {
"additional": {
"bar": 123,
"req": "additional information"
},
"str": "hello world"
}
"body.original": {
"additional": {
"bar": 123,
"req": "additional information"
},
"str": "hello world"
},
"cookies": {
"c1": "v1",
Expand Down
Loading

0 comments on commit 46f214e

Please sign in to comment.