Skip to content

Commit

Permalink
Add context.http.url to spans.
Browse files Browse the repository at this point in the history
implements elastic#777
  • Loading branch information
simitt committed Jun 27, 2018
1 parent 8a7016a commit 9658a6e
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 5 deletions.
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
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,18 @@
"unloadEventEnd": 32,
"unloadEventStart": 32
},
"http": {
"url": {
"location": "http://localhost:8000/test/e2e/general-usecase/"
}
},
"service": {
"agent": {
"name": "apm-js",
"version": "0.0.0"
},
"name": "apm-agent-js",
"version": "1.0.0"
},
"url": {
"location": "http://localhost:8000/test/e2e/general-usecase/"
}
},
"processor": {
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
10 changes: 10 additions & 0 deletions processor/transaction/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -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."
}
}
}
}
},
Expand Down
6 changes: 4 additions & 2 deletions testdata/transaction/frontend.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
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

0 comments on commit 9658a6e

Please sign in to comment.