diff --git a/docs/spec/transactions/span.json b/docs/spec/transactions/span.json index b8dc2a67664..837874e0b35 100644 --- a/docs/spec/transactions/span.json +++ b/docs/spec/transactions/span.json @@ -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." + } + } } } }, diff --git a/processor/transaction/package_tests/TestProcessTransactionFrontend.approved.json b/processor/transaction/package_tests/TestProcessTransactionFrontend.approved.json index 7463884ce1d..fcb80bfe183 100644 --- a/processor/transaction/package_tests/TestProcessTransactionFrontend.approved.json +++ b/processor/transaction/package_tests/TestProcessTransactionFrontend.approved.json @@ -24,6 +24,11 @@ "unloadEventEnd": 32, "unloadEventStart": 32 }, + "http": { + "url": { + "location": "http://localhost:8000/test/e2e/general-usecase/" + } + }, "service": { "agent": { "name": "apm-js", @@ -31,9 +36,6 @@ }, "name": "apm-agent-js", "version": "1.0.0" - }, - "url": { - "location": "http://localhost:8000/test/e2e/general-usecase/" } }, "processor": { diff --git a/processor/transaction/package_tests/TestProcessTransactionFull.approved.json b/processor/transaction/package_tests/TestProcessTransactionFull.approved.json index ca15cb01734..b76893b6b8e 100644 --- a/processor/transaction/package_tests/TestProcessTransactionFull.approved.json +++ b/processor/transaction/package_tests/TestProcessTransactionFull.approved.json @@ -148,6 +148,9 @@ "type": "sql", "user": "readonly_user" }, + "http": { + "url": "http://localhost:8000" + }, "service": { "agent": { "name": "elastic-node", diff --git a/processor/transaction/schema.go b/processor/transaction/schema.go index 95148be8197..2946371ff1e 100644 --- a/processor/transaction/schema.go +++ b/processor/transaction/schema.go @@ -396,6 +396,16 @@ var transactionSchema = `{ "description": "Username for accessing database" } } + }, + "http": { + "type": ["object", "null"], + "description": "An object containing contextual data for the correlating http request.", + "properties": { + "url": { + "type": ["string", "null"], + "description": "The raw url of the correlating http request." + } + } } } }, diff --git a/testdata/transaction/frontend.json b/testdata/transaction/frontend.json index 73d2013164c..815bab5ed77 100644 --- a/testdata/transaction/frontend.json +++ b/testdata/transaction/frontend.json @@ -59,8 +59,10 @@ "loadEventStart": 645, "loadEventEnd": 648 }, - "url": { - "location": "http://localhost:8000/test/e2e/general-usecase/" + "http": { + "url": { + "location": "http://localhost:8000/test/e2e/general-usecase/" + } } }, "unknownName": true diff --git a/testdata/transaction/payload.json b/testdata/transaction/payload.json index 1a293435e74..7073772c7ba 100644 --- a/testdata/transaction/payload.json +++ b/testdata/transaction/payload.json @@ -163,6 +163,9 @@ "statement": "SELECT * FROM product_types WHERE user_id=?", "type": "sql", "user": "readonly_user" + }, + "http": { + "url": "http://localhost:8000" } } }, diff --git a/tests/fields.go b/tests/fields.go index d85366d9294..87b9909a16a 100644 --- a/tests/fields.go +++ b/tests/fields.go @@ -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",