Skip to content

Commit

Permalink
Add context.http.url to spans. (#1037)
Browse files Browse the repository at this point in the history
* Add context.http.url to spans.

implements #777
  • Loading branch information
simitt authored Jun 28, 2018
1 parent 64f0b32 commit 2665a0d
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 1 deletion.
3 changes: 3 additions & 0 deletions docs/data/elasticsearch/span.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"type": "sql",
"user": "readonly_user"
},
"http": {
"url": "http://localhost:8000"
},
"service": {
"agent": {
"name": "elastic-node",
Expand Down
3 changes: 3 additions & 0 deletions docs/data/intake-api/generated/transaction/payload.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@
"statement": "SELECT * FROM product_types WHERE user_id=?",
"type": "sql",
"user": "readonly_user"
},
"http": {
"url": "http://localhost:8000"
}
}
},
Expand Down
10 changes: 10 additions & 0 deletions docs/spec/transactions/span.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@
"description": "Username for accessing database"
}
}
},
"http": {
"type": ["object", "null"],
"description": "An object containing contextual data of the related http request.",
"properties": {
"url": {
"type": ["string", "null"],
"description": "The raw url of the correlating http request."
}
}
}
}
},
Expand Down
10 changes: 10 additions & 0 deletions processor/transaction/generated/schema/payload.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,16 @@ const PayloadSchema = `{
"description": "Username for accessing database"
}
}
},
"http": {
"type": ["object", "null"],
"description": "An object containing contextual data of the related http request.",
"properties": {
"url": {
"type": ["string", "null"],
"description": "The raw url of the correlating http request."
}
}
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@
{
"@timestamp": "-",
"context": {
"http": {
"url": "http://localhost:8000/test/e2e/general-usecase/span"
},
"service": {
"agent": {
"name": "apm-js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@
"type": "sql",
"user": "readonly_user"
},
"http": {
"url": "http://localhost:8000"
},
"service": {
"agent": {
"name": "elastic-node",
Expand Down
7 changes: 6 additions & 1 deletion testdata/transaction/frontend.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@
"lineno": 1,
"colno": 18
}
]
],
"context": {
"http": {
"url": "http://localhost:8000/test/e2e/general-usecase/span"
}
}
}
],
"context": {
Expand Down
3 changes: 3 additions & 0 deletions testdata/transaction/payload.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@
"statement": "SELECT * FROM product_types WHERE user_id=?",
"type": "sql",
"user": "readonly_user"
},
"http": {
"url": "http://localhost:8000"
}
}
},
Expand Down
1 change: 1 addition & 0 deletions tests/fields.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ func TestEventAttrsDocumentedInFields(t *testing.T, fieldPaths []string, fn proc
"context.db.type",
"context.db.instance",
"context.db.user",
"context.http",
"sourcemap",
"transaction.marks.another_mark",
"transaction.marks.another_mark.some_long",
Expand Down
3 changes: 3 additions & 0 deletions tests/system/spans.approved.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,9 @@
"user": "readonly_user",
"statement": "SELECT * FROM product_types WHERE user_id=?"
},
"http": {
"url": "http://localhost:8000"
},
"service": {
"name": "1234_service-12a3",
"agent": {
Expand Down

0 comments on commit 2665a0d

Please sign in to comment.