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

[fix]: Use scaled float for all numeric transaction.marks.* values. #1704

Merged
merged 5 commits into from
Dec 21, 2018
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
1 change: 1 addition & 0 deletions changelogs/6.6.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ https://github.com/elastic/apm-server/compare/v6.5.4\...v6.6.0[View commits]
==== Bug fixes

- Fix index pattern bundled with Kibana to be in sync with ES template pull{1571}[1571].
- Ensure all `transaction.marks.*.*` values are stored as scaled floats. pull{1704}[1704]
2 changes: 1 addition & 1 deletion docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,7 @@ A user-defined mapping of groups of marks in milliseconds.

--

*`transaction.marks.navigationTiming`*::
*`transaction.marks.*.*`*::
+
--
type: object
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/transaction/_meta/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
description: >
A user-defined mapping of groups of marks in milliseconds.

- name: marks.navigationTiming
- name: marks.*.*
type: object
object_type: scaled_float
scaling_factor: 1000000
Expand Down
1 change: 1 addition & 0 deletions processor/stream/package_tests/transaction_attrs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func transactionFieldsNotInPayloadAttrs() *tests.Set {
"context.system.ip",
"context.http",
"context.http.status_code",
"transaction.marks.*.*",
)
}

Expand Down
2 changes: 1 addition & 1 deletion processor/transaction/package_tests/attrs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func TestPayloadMatchFields(t *testing.T) {
procSetup().PayloadAttrsMatchFields(t,
payloadAttrsNotInFields(nil),
fieldsNotInPayloadAttrs(tests.NewSet("parent", "parent.id", "span.hex_id",
"span.subtype", "span.action", "trace", "trace.id")))
"span.subtype", "span.action", "trace", "trace.id", "transaction.marks.*.*")))
}

func TestPayloadMatchJsonSchema(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion script/are_kibana_saved_objects_updated.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def iterate(val_id, key, v1, v2):
else:
d = jsondiff.JsonDiffer(syntax='symmetric').diff(*json_val(v1, v2))
if d:
if key == "attributes.title":
if key == "attributes.title" or key == "attributes.fields.name=transaction.marks.*.*":
return ret_val
ret_val = 2
print("Difference for id '{}' for key '{}'".format(val_id, key))
Expand Down
9 changes: 1 addition & 8 deletions tests/system/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,10 @@ def test_mark_navigation_timing(self):
self.load_docs_with_template(self.get_transaction_payload_path(), self.transactions_url, 'transaction', 9)
self.assert_no_logged_warnings()
mappings = self.es.indices.get_field_mapping(index=self.index_name, fields="transaction.marks.*")
found_other = False
for name, metric in mappings[self.index_name]["mappings"]["_doc"].items():
for mapping in metric["mapping"].values():
mtype = mapping["type"]
if name.startswith("transaction.marks.navigationTiming."):
assert mtype == "scaled_float", name + " mapped as " + mtype + ", not scaled_float"
else:
# only navigation timing marks are scaled floats for now
assert mtype != "scaled_float", name + " mapped as scaled_float"
found_other = True
assert found_other, "no non-scaled_float marks found"
assert mtype == "scaled_float", name + " mapped as " + mtype + ", not scaled_float"

@unittest.skipUnless(INTEGRATION_TESTS, "integration test")
def test_load_docs_with_template_and_add_error(self):
Expand Down