Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename span.hex_id to span.id #1811

Merged
merged 1 commit into from
Jan 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"duration": {
"us": 3564
},
"hex_id": "0123456a89012345",
"id": "0123456a89012345",
"name": "GET /api/types",
"start": {
"us": 1845
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"duration": {
"us": 141581
},
"hex_id": "abcdef01234567",
"id": "abcdef01234567",
"name": "GET /api/types",
"type": "request"
},
Expand Down Expand Up @@ -78,7 +78,7 @@
"duration": {
"us": 32592
},
"hex_id": "1234abcdef567895",
"id": "1234abcdef567895",
"name": "GET /api/types",
"start": {
"us": 22000
Expand Down Expand Up @@ -135,7 +135,7 @@
"duration": {
"us": 3564
},
"hex_id": "0123456a89012345",
"id": "0123456a89012345",
"name": "GET /api/types",
"start": {
"us": 1845
Expand Down Expand Up @@ -185,7 +185,7 @@
"duration": {
"us": 13980
},
"hex_id": "abcde56a89012345",
"id": "abcde56a89012345",
"name": "get /api/types",
"start": {
"us": 0
Expand Down Expand Up @@ -250,7 +250,7 @@
"duration": {
"us": 3781
},
"hex_id": "1234567890aaaade",
"id": "1234567890aaaade",
"name": "SELECT FROM product_types",
"stacktrace": [
{
Expand Down
1 change: 1 addition & 0 deletions changelogs/head.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- Update response format of the healthcheck handler and prettyfy all JSON responses {pull}1748[1748].
- Add transaction.type to error data {pull}1781[1781].
- Rename transaction.span_count.dropped.total to transaction.span_count.dropped {pull}1809[1809].
- Rename span.hex_id to span.id {pull}XXX[XXX].

[float]
==== Removed
Expand Down
10 changes: 5 additions & 5 deletions docs/data/elasticsearch/generated/spans.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"duration": {
"us": 141581
},
"hex_id": "abcdef01234567",
"id": "abcdef01234567",
"name": "GET /api/types",
"type": "request"
},
Expand Down Expand Up @@ -54,7 +54,7 @@
"duration": {
"us": 32592
},
"hex_id": "1234abcdef567895",
"id": "1234abcdef567895",
"name": "GET /api/types",
"start": {
"us": 22000
Expand Down Expand Up @@ -99,7 +99,7 @@
"duration": {
"us": 3564
},
"hex_id": "0123456a89012345",
"id": "0123456a89012345",
"name": "GET /api/types",
"start": {
"us": 1845
Expand Down Expand Up @@ -137,7 +137,7 @@
"duration": {
"us": 13980
},
"hex_id": "abcde56a89012345",
"id": "abcde56a89012345",
"name": "get /api/types",
"start": {
"us": 0
Expand Down Expand Up @@ -190,7 +190,7 @@
"duration": {
"us": 3781
},
"hex_id": "1234567890aaaade",
"id": "1234567890aaaade",
"name": "SELECT FROM product_types",
"stacktrace": [
{
Expand Down
2 changes: 1 addition & 1 deletion docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ format: url
--


*`span.hex_id`*::
*`span.id`*::
+
--
type: keyword
Expand Down
2 changes: 1 addition & 1 deletion include/fields.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion model/span/_meta/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
dynamic: false
fields:

- name: hex_id
- name: id
type: keyword
description: >
The ID of the span stored as hex encoded string.
Expand Down
2 changes: 1 addition & 1 deletion model/span/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func (s *Event) fields(tctx *transform.Context) common.MapStr {
}
tr := common.MapStr{}
if s.HexId != "" {
utility.Add(tr, "hex_id", s.HexId)
utility.Add(tr, "id", s.HexId)
}
utility.Add(tr, "subtype", s.Subtype)
utility.Add(tr, "action", s.Action)
Expand Down
4 changes: 2 additions & 2 deletions model/span/event_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ func TestSpanTransform(t *testing.T) {
Context: common.MapStr{"key": "val"},
},
Output: common.MapStr{
"hex_id": hexId,
"id": hexId,
"duration": common.MapStr{"us": 1200},
"name": "myspan",
"start": common.MapStr{"us": 650},
Expand All @@ -216,7 +216,7 @@ func TestSpanTransform(t *testing.T) {
"type": "",
"duration": common.MapStr{"us": 0},
"name": "",
"hex_id": hexId,
"id": hexId,
},
Msg: "Span without a Stacktrace",
},
Expand Down
2 changes: 1 addition & 1 deletion processor/stream/package_tests/span_attrs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ func TestKeywordLimitationOnSpanAttrs(t *testing.T) {
{Template: "transaction.id", Mapping: "transaction_id"},
{Template: "parent.id", Mapping: "parent_id"},
{Template: "trace.id", Mapping: "trace_id"},
{Template: "span.hex_id", Mapping: "id"},
{Template: "span.id", Mapping: "id"},
{Template: "span.", Mapping: ""},
},
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"duration": {
"us": 3564
},
"hex_id": "0123456a89012345",
"id": "0123456a89012345",
"name": "GET /api/types",
"start": {
"us": 1845
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"duration": {
"us": 141581
},
"hex_id": "abcdef01234567",
"id": "abcdef01234567",
"name": "GET /api/types",
"start": {
"us": 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"duration": {
"us": 141581
},
"hex_id": "abcdef01234567",
"id": "abcdef01234567",
"name": "GET /api/types",
"start": {
"us": 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"duration": {
"us": 20000
},
"hex_id": "0147258369abcdef",
"id": "0147258369abcdef",
"name": "sp1",
"start": {
"us": 10000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"duration": {
"us": 643000
},
"hex_id": "aaaaaaaaaaaaaaaa",
"id": "aaaaaaaaaaaaaaaa",
"name": "transaction",
"stacktrace": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"duration": {
"us": 141581
},
"hex_id": "abcdef01234567",
"id": "abcdef01234567",
"name": "GET /api/types",
"type": "request"
},
Expand Down Expand Up @@ -54,7 +54,7 @@
"duration": {
"us": 32592
},
"hex_id": "1234abcdef567895",
"id": "1234abcdef567895",
"name": "GET /api/types",
"start": {
"us": 22000
Expand Down Expand Up @@ -99,7 +99,7 @@
"duration": {
"us": 3564
},
"hex_id": "0123456a89012345",
"id": "0123456a89012345",
"name": "GET /api/types",
"start": {
"us": 1845
Expand Down Expand Up @@ -137,7 +137,7 @@
"duration": {
"us": 13980
},
"hex_id": "abcde56a89012345",
"id": "abcde56a89012345",
"name": "get /api/types",
"start": {
"us": 0
Expand Down Expand Up @@ -190,7 +190,7 @@
"duration": {
"us": 3781
},
"hex_id": "1234567890aaaade",
"id": "1234567890aaaade",
"name": "SELECT FROM product_types",
"stacktrace": [
{
Expand Down
10 changes: 5 additions & 5 deletions tests/system/spans.approved.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"name": "1234_service-12a3"
},
"span": {
"hex_id": "2aaaaaaaaaaaaaaa",
"id": "2aaaaaaaaaaaaaaa",
"name": "GET /api/types",
"start": {
"us": 1845
Expand Down Expand Up @@ -54,7 +54,7 @@
"version": "7.0.0-alpha1"
},
"span": {
"hex_id": "15aaaaaaaaaaaaaa",
"id": "15aaaaaaaaaaaaaa",
"duration": {
"us": 3781
},
Expand Down Expand Up @@ -108,7 +108,7 @@
"name": "1234_service-12a3"
},
"span": {
"hex_id": "3aaaaaaaaaaaaaaa",
"id": "3aaaaaaaaaaaaaaa",
"name": "GET /api/types",
"start": {
"us": 0
Expand Down Expand Up @@ -147,7 +147,7 @@
"name": "1234_service-12a3"
},
"span": {
"hex_id": "0aaaaaaaaaaaaaaa",
"id": "0aaaaaaaaaaaaaaa",
"stacktrace": [
{
"function": "onread",
Expand Down Expand Up @@ -239,7 +239,7 @@
"name": "1234_service-12a3"
},
"span": {
"hex_id": "1aaaaaaaaaaaaaaa",
"id": "1aaaaaaaaaaaaaaa",
"name": "GET /api/types",
"start": {
"us": 0
Expand Down
11 changes: 2 additions & 9 deletions tests/system/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,24 +117,17 @@ def check_docs(self, approved, received, doc_type):
for rec_entry in received:
checked = False
rec = rec_entry['_source']
rec_id = self.get_id(rec[doc_type])
rec_id = rec[doc_type]['id']

for appr_entry in approved:
appr = appr_entry['_source']
if rec_id == self.get_id(appr[doc_type]):
if rec_id == appr[doc_type]['id']:
checked = True
self.assert_docs(rec[doc_type], appr[doc_type])
self.assert_docs(rec.get('context'), appr.get('context'))
self.assert_docs(rec['processor'], appr['processor'])
assert checked, "New entry with id {}".format(rec_id)

@staticmethod
def get_id(doc):
if 'id' in doc:
return doc['id']
else:
return doc['hex_id']

def assert_docs(self, received, approved):
assert approved == received, "expected:\n{}\nreceived:\n{}".format(self.dump(approved), self.dump(received))

Expand Down