Skip to content

Commit 1d492eb

Browse files
committed
Add context.http.url to spans.
implements #777
1 parent 8a7016a commit 1d492eb

File tree

9 files changed

+42
-5
lines changed

9 files changed

+42
-5
lines changed

docs/data/elasticsearch/span.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
"type": "sql",
77
"user": "readonly_user"
88
},
9+
"http": {
10+
"url": "http://localhost:8000"
11+
},
912
"service": {
1013
"agent": {
1114
"name": "elastic-node",

docs/data/intake-api/generated/transaction/payload.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,9 @@
163163
"statement": "SELECT * FROM product_types WHERE user_id=?",
164164
"type": "sql",
165165
"user": "readonly_user"
166+
},
167+
"http": {
168+
"url": "http://localhost:8000"
166169
}
167170
}
168171
},

docs/spec/transactions/span.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@
3131
"description": "Username for accessing database"
3232
}
3333
}
34+
},
35+
"http": {
36+
"type": ["object", "null"],
37+
"description": "An object containing contextual data of the related http request.",
38+
"properties": {
39+
"url": {
40+
"type": ["string", "null"],
41+
"description": "The raw url of the correlating http request."
42+
}
43+
}
3444
}
3545
}
3646
},

processor/transaction/package_tests/TestProcessTransactionFrontend.approved.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,18 @@
2424
"unloadEventEnd": 32,
2525
"unloadEventStart": 32
2626
},
27+
"http": {
28+
"url": {
29+
"location": "http://localhost:8000/test/e2e/general-usecase/"
30+
}
31+
},
2732
"service": {
2833
"agent": {
2934
"name": "apm-js",
3035
"version": "0.0.0"
3136
},
3237
"name": "apm-agent-js",
3338
"version": "1.0.0"
34-
},
35-
"url": {
36-
"location": "http://localhost:8000/test/e2e/general-usecase/"
3739
}
3840
},
3941
"processor": {

processor/transaction/package_tests/TestProcessTransactionFull.approved.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,9 @@
148148
"type": "sql",
149149
"user": "readonly_user"
150150
},
151+
"http": {
152+
"url": "http://localhost:8000"
153+
},
151154
"service": {
152155
"agent": {
153156
"name": "elastic-node",

processor/transaction/schema.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,16 @@ var transactionSchema = `{
396396
"description": "Username for accessing database"
397397
}
398398
}
399+
},
400+
"http": {
401+
"type": ["object", "null"],
402+
"description": "An object containing contextual data of the related http request.",
403+
"properties": {
404+
"url": {
405+
"type": ["string", "null"],
406+
"description": "The raw url of the correlating http request."
407+
}
408+
}
399409
}
400410
}
401411
},

testdata/transaction/frontend.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,10 @@
5959
"loadEventStart": 645,
6060
"loadEventEnd": 648
6161
},
62-
"url": {
63-
"location": "http://localhost:8000/test/e2e/general-usecase/"
62+
"http": {
63+
"url": {
64+
"location": "http://localhost:8000/test/e2e/general-usecase/"
65+
}
6466
}
6567
},
6668
"unknownName": true

testdata/transaction/payload.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,9 @@
163163
"statement": "SELECT * FROM product_types WHERE user_id=?",
164164
"type": "sql",
165165
"user": "readonly_user"
166+
},
167+
"http": {
168+
"url": "http://localhost:8000"
166169
}
167170
}
168171
},

tests/fields.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ func TestEventAttrsDocumentedInFields(t *testing.T, fieldPaths []string, fn proc
4242
"context.db.type",
4343
"context.db.instance",
4444
"context.db.user",
45+
"context.http",
4546
"sourcemap",
4647
"transaction.marks.another_mark",
4748
"transaction.marks.another_mark.some_long",

0 commit comments

Comments
 (0)