diff --git a/_meta/fields.common.yml b/_meta/fields.common.yml index 54c09de8559..a20af0ca94d 100644 --- a/_meta/fields.common.yml +++ b/_meta/fields.common.yml @@ -90,7 +90,11 @@ - name: tags type: object - object_type: keyword + object_type_params: + - object_type: keyword + - object_type: boolean + - object_type: scaled_float + scaling_factor: 1000000 dynamic: true description: > A flat mapping of user-defined tags with string values. diff --git a/changelogs/head.asciidoc b/changelogs/head.asciidoc index bc831dfd163..35bef1a6ef7 100644 --- a/changelogs/head.asciidoc +++ b/changelogs/head.asciidoc @@ -11,6 +11,11 @@ https://github.com/elastic/apm-server/compare/6.5\...6.x[View commits] - Make `service.framework` properties optional and nullable {pull}1546[1546]. - Add `transaction.sampled` to errors {pull}1662[1662]. - Remove formatting of `duration.us` to milliseconds in index pattern pull{1717}[1717]. +- Allow numbers and boolean values for `transaction.tags`, `span.tags`, `metricset.tags` {pull}1712[1712]. + +[float] +==== Removed +- Remove support for using dots in tags for experimental metricset endpoint {pull}1712[1712]. [float] ==== Bug fixes diff --git a/docs/data/elasticsearch/generated/metricsets.json b/docs/data/elasticsearch/generated/metricsets.json index 310f1c6d0f0..5cadfa8de58 100644 --- a/docs/data/elasticsearch/generated/metricsets.json +++ b/docs/data/elasticsearch/generated/metricsets.json @@ -18,8 +18,9 @@ "name": "1234_service-12a3" }, "tags": { - "code": "200", - "some.other.code": "abc" + "code": 200, + "some": "abc", + "success": true } }, "dotted": { @@ -31,8 +32,9 @@ "float_gauge": 9.16, "integer_gauge": 42767, "labels": { - "code": "200", - "some.other.code": "abc" + "code": 200, + "some": "abc", + "success": true }, "long_gauge": 3147483648, "negative": { diff --git a/docs/data/elasticsearch/generated/spans.json b/docs/data/elasticsearch/generated/spans.json index 6119fbc20f2..6ea8c41f6ac 100644 --- a/docs/data/elasticsearch/generated/spans.json +++ b/docs/data/elasticsearch/generated/spans.json @@ -90,7 +90,10 @@ "name": "backendspans" }, "tags": { - "tag1": "value1" + "tag1": "value1", + "tag2": 123, + "tag3": 12.34, + "tag4": true } }, "parent": { diff --git a/docs/data/elasticsearch/generated/transactions.json b/docs/data/elasticsearch/generated/transactions.json index e4ae91e348c..640e2403ac9 100644 --- a/docs/data/elasticsearch/generated/transactions.json +++ b/docs/data/elasticsearch/generated/transactions.json @@ -183,7 +183,10 @@ "platform": "darwin" }, "tags": { - "organization_uuid": "9f0e9d64-c185-4d21-a6f4-4673ed561ec8" + "organization_uuid": "9f0e9d64-c185-4d21-a6f4-4673ed561ec8", + "tag2": 12, + "tag3": 12.45, + "tag4": false }, "user": { "email": "foo@example.com", diff --git a/docs/data/elasticsearch/metric.json b/docs/data/elasticsearch/metric.json index dacf0d7ef01..210800181c2 100644 --- a/docs/data/elasticsearch/metric.json +++ b/docs/data/elasticsearch/metric.json @@ -31,8 +31,9 @@ "platform": "darwin" }, "tags": { - "code": "200", - "some.other.code": "abc" + "code": 200, + "key": "value", + "success": true } }, "dotted": { @@ -44,8 +45,9 @@ "float_gauge": 9.16, "integer_gauge": 42767, "labels": { - "code": "200", - "some.other.code": "abc" + "code": 200, + "key": "value", + "success": true }, "long_gauge": 3147483648, "negative": { diff --git a/docs/data/elasticsearch/span.json b/docs/data/elasticsearch/span.json index c52ff4242f3..d5b98b42344 100644 --- a/docs/data/elasticsearch/span.json +++ b/docs/data/elasticsearch/span.json @@ -19,6 +19,8 @@ "name": "1234_service-12a3" }, "tags": { + "code": 200, + "error": false, "span_tag": "something" } }, diff --git a/docs/data/elasticsearch/transaction.json b/docs/data/elasticsearch/transaction.json index 9b8a98d7425..457f929f3c1 100644 --- a/docs/data/elasticsearch/transaction.json +++ b/docs/data/elasticsearch/transaction.json @@ -99,6 +99,8 @@ "platform": "darwin" }, "tags": { + "bool_error": false, + "number_code": 2, "organization_uuid": "9f0e9d64-c185-4d21-a6f4-4673ed561ec8" }, "user": { diff --git a/docs/spec/metricsets/common_metricset.json b/docs/spec/metricsets/common_metricset.json index cc0c3ca479c..8de45e85be2 100644 --- a/docs/spec/metricsets/common_metricset.json +++ b/docs/spec/metricsets/common_metricset.json @@ -15,15 +15,7 @@ "additionalProperties": false }, "tags": { - "type": ["object", "null"], - "description": "A flat mapping of user-defined tags with string values.", - "patternProperties": { - "^[^*\"]*$": { - "type": ["string", "null"], - "maxLength": 1024 - } - }, - "additionalProperties": false + "$ref": "../tags.json" } }, "required": ["samples"] diff --git a/docs/spec/tags.json b/docs/spec/tags.json index 58a2ed835f3..aba75796c41 100644 --- a/docs/spec/tags.json +++ b/docs/spec/tags.json @@ -2,10 +2,10 @@ "$id": "doc/spec/tags.json", "title": "Tags", "type": ["object", "null"], - "description": "A flat mapping of user-defined tags with string values.", + "description": "A flat mapping of user-defined tags with string, boolean or number values.", "patternProperties": { "^[^.*\"]*$": { - "type": ["string", "null"], + "type": ["string", "boolean", "number", "null"], "maxLength": 1024 } }, diff --git a/include/fields.go b/include/fields.go index fce60d3e2cb..545b3919007 100644 --- a/include/fields.go +++ b/include/fields.go @@ -31,5 +31,5 @@ func init() { // Asset returns asset data func Asset() string { - return "eJzcfW9z27jR+Pt8CvycuXHSkRjbiZOrZtr+/CTXq6eXJnNO+nSm7SgQuJJQkwADgFZ0nX73Z/CPBEmQoiz5Lle9uIspYnex2H9YLFZTdAvbGcJF/gghRVUGM/Q9MBA4Q1fv3z5CKAVJBC0U5WyGfv8IIYT+SCFLJSI8zzlDiqM7LCgvpR6B4A6YkskjhJbmtZkZMkUM5zBDGZUKGGUr8xQhtS1gpmnYcJG6ZxGM+nOVpgKkRGoNSIK4A4GorAEizpIGqkJwAlJykei/x+J770cZKMmjHpBmlvvDNMNaQBXNQSqcFw1wK8FL/yRkZDiylNUjPyzjFWv1h/CSqRk6Dx71cFd/PnhKEF8aNhtyEWUop0RwCYSzVCJJGQH0kdEvCApO1q35EM4UfFG9s+lbXrZFWCyoElhsPZASZ4iyJRc51u8jASssUr3aFXkTRHChSgEpWmzNY7wyj7lBgbNsq9ftjqb1G6UEkXhytgznlMzQEmcSdnCclFLxvMN1vvgXEBU8BoYXGaQ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vBGS9ltkVcINx4EjsvsOXhdgVS9l2EPph4ec8y5CrSNRalwAdoXhQMXIEPjRfN6Hj9aq8En6MXB40uZq2Qf15mis6HlDzu893nYL5vGQwLkHZXQ0nZKqu92Sfmsyrff/cBPSslCPlsRtPT2IJy+IW/ey+KCTp1bqVe+BaY3Oo5ZOm/+MItgAfYnZDg45ujXXsMsz1OG9aHynAGx1ghAbLMunq+d3EHCycolVm5TehPHz68b3yeR+uefjg1qwmkYfMYjTkWt0dIvb/Pd5Ub31EOvq9sJMFEMA1xltFZRvsZbdolv0l+s+dAekJj+35HOrL+FJjNzZJ3kOORCl4UPafgQ4WpUevXF8BvQoyoCYodidrYUR2KcVS66rP2ekRTWZJH/xcAAP//sAIe5w==" } diff --git a/model/error/generated/schema/error.go b/model/error/generated/schema/error.go index aa9c1be5605..6132874b4fb 100644 --- a/model/error/generated/schema/error.go +++ b/model/error/generated/schema/error.go @@ -176,10 +176,10 @@ const ModelSchema = `{ "$id": "doc/spec/tags.json", "title": "Tags", "type": ["object", "null"], - "description": "A flat mapping of user-defined tags with string values.", + "description": "A flat mapping of user-defined tags with string, boolean or number values.", "patternProperties": { "^[^.*\"]*$": { - "type": ["string", "null"], + "type": ["string", "boolean", "number", "null"], "maxLength": 1024 } }, diff --git a/model/error/generated/schema/payload.go b/model/error/generated/schema/payload.go index 88651d1bd27..e01772c9e9a 100644 --- a/model/error/generated/schema/payload.go +++ b/model/error/generated/schema/payload.go @@ -296,10 +296,10 @@ const PayloadSchema = `{ "$id": "doc/spec/tags.json", "title": "Tags", "type": ["object", "null"], - "description": "A flat mapping of user-defined tags with string values.", + "description": "A flat mapping of user-defined tags with string, boolean or number values.", "patternProperties": { "^[^.*\"]*$": { - "type": ["string", "null"], + "type": ["string", "boolean", "number", "null"], "maxLength": 1024 } }, diff --git a/model/metricset/generated/schema/metricset.go b/model/metricset/generated/schema/metricset.go index d9d3b1aafed..3788127a51b 100644 --- a/model/metricset/generated/schema/metricset.go +++ b/model/metricset/generated/schema/metricset.go @@ -46,15 +46,17 @@ const ModelSchema = `{ "additionalProperties": false }, "tags": { - "type": ["object", "null"], - "description": "A flat mapping of user-defined tags with string values.", - "patternProperties": { - "^[^*\"]*$": { - "type": ["string", "null"], - "maxLength": 1024 - } - }, - "additionalProperties": false + "$id": "doc/spec/tags.json", + "title": "Tags", + "type": ["object", "null"], + "description": "A flat mapping of user-defined tags with string, boolean or number values.", + "patternProperties": { + "^[^.*\"]*$": { + "type": ["string", "boolean", "number", "null"], + "maxLength": 1024 + } + }, + "additionalProperties": false } }, "required": ["samples"] }, diff --git a/model/metricset/generated/schema/payload.go b/model/metricset/generated/schema/payload.go index 35173711b00..d92f6e785bd 100644 --- a/model/metricset/generated/schema/payload.go +++ b/model/metricset/generated/schema/payload.go @@ -55,15 +55,17 @@ const PayloadSchema = `{ "additionalProperties": false }, "tags": { - "type": ["object", "null"], - "description": "A flat mapping of user-defined tags with string values.", - "patternProperties": { - "^[^*\"]*$": { - "type": ["string", "null"], - "maxLength": 1024 - } - }, - "additionalProperties": false + "$id": "doc/spec/tags.json", + "title": "Tags", + "type": ["object", "null"], + "description": "A flat mapping of user-defined tags with string, boolean or number values.", + "patternProperties": { + "^[^.*\"]*$": { + "type": ["string", "boolean", "number", "null"], + "maxLength": 1024 + } + }, + "additionalProperties": false } }, "required": ["samples"] }, diff --git a/model/span/generated/schema/span.go b/model/span/generated/schema/span.go index 45e7d4984d7..528a9a16cc1 100644 --- a/model/span/generated/schema/span.go +++ b/model/span/generated/schema/span.go @@ -74,10 +74,10 @@ const ModelSchema = `{ "$id": "doc/spec/tags.json", "title": "Tags", "type": ["object", "null"], - "description": "A flat mapping of user-defined tags with string values.", + "description": "A flat mapping of user-defined tags with string, boolean or number values.", "patternProperties": { "^[^.*\"]*$": { - "type": ["string", "null"], + "type": ["string", "boolean", "number", "null"], "maxLength": 1024 } }, diff --git a/model/transaction/generated/schema/payload.go b/model/transaction/generated/schema/payload.go index f5cc0a90065..6db6f690ce3 100644 --- a/model/transaction/generated/schema/payload.go +++ b/model/transaction/generated/schema/payload.go @@ -322,10 +322,10 @@ const PayloadSchema = `{ "$id": "doc/spec/tags.json", "title": "Tags", "type": ["object", "null"], - "description": "A flat mapping of user-defined tags with string values.", + "description": "A flat mapping of user-defined tags with string, boolean or number values.", "patternProperties": { "^[^.*\"]*$": { - "type": ["string", "null"], + "type": ["string", "boolean", "number", "null"], "maxLength": 1024 } }, @@ -478,10 +478,10 @@ const PayloadSchema = `{ "$id": "doc/spec/tags.json", "title": "Tags", "type": ["object", "null"], - "description": "A flat mapping of user-defined tags with string values.", + "description": "A flat mapping of user-defined tags with string, boolean or number values.", "patternProperties": { "^[^.*\"]*$": { - "type": ["string", "null"], + "type": ["string", "boolean", "number", "null"], "maxLength": 1024 } }, diff --git a/model/transaction/generated/schema/transaction.go b/model/transaction/generated/schema/transaction.go index b4585cc8025..2e8eedcf991 100644 --- a/model/transaction/generated/schema/transaction.go +++ b/model/transaction/generated/schema/transaction.go @@ -175,10 +175,10 @@ const ModelSchema = `{ "$id": "doc/spec/tags.json", "title": "Tags", "type": ["object", "null"], - "description": "A flat mapping of user-defined tags with string values.", + "description": "A flat mapping of user-defined tags with string, boolean or number values.", "patternProperties": { "^[^.*\"]*$": { - "type": ["string", "null"], + "type": ["string", "boolean", "number", "null"], "maxLength": 1024 } }, diff --git a/processor/error/package_tests/attrs_common.go b/processor/error/package_tests/attrs_common.go index 908a1eceea0..5943f327d42 100644 --- a/processor/error/package_tests/attrs_common.go +++ b/processor/error/package_tests/attrs_common.go @@ -183,11 +183,11 @@ func schemaTestData(td []tests.SchemaTestData) []tests.SchemaTestData { {Key: "errors.context.request.cookies", Valid: val{obj{}}, Invalid: []tests.Invalid{{Msg: `/context/properties/request/properties/cookies/type`, Values: val{102, "a"}}}}, {Key: "errors.context.tags", - Valid: val{obj{tests.Str1024Special: tests.Str1024Special}}, + Valid: val{obj{tests.Str1024Special: tests.Str1024Special}, obj{tests.Str1024: 123.45}, obj{tests.Str1024: true}}, Invalid: []tests.Invalid{ - {Msg: `context/properties/tags/type`, Values: val{"tags"}}, - {Msg: `context/properties/tags/patternproperties`, Values: val{obj{"invalid": tests.Str1025}, obj{tests.Str1024: 123}, obj{tests.Str1024: obj{}}}}, - {Msg: `context/properties/tags/additionalproperties`, Values: val{obj{"invali*d": "hello"}, obj{"invali\"d": "hello"}, obj{"invali.d": "hello"}}}}}, + {Msg: `tags/type`, Values: val{"tags"}}, + {Msg: `tags/patternproperties`, Values: val{obj{"invalid": tests.Str1025}, obj{tests.Str1024: obj{}}}}, + {Msg: `tags/additionalproperties`, Values: val{obj{"invali*d": "hello"}, obj{"invali\"d": "hello"}, obj{"invali.d": "hello"}}}}}, {Key: "errors.context.user.id", Valid: val{123, tests.Str1024Special}, Invalid: []tests.Invalid{ {Msg: `context/properties/user/properties/id/type`, Values: val{obj{}}}, diff --git a/processor/metricset/package_tests/TestProcessMetricset.approved.json b/processor/metricset/package_tests/TestProcessMetricset.approved.json index cad3d00ba34..e9a922ea035 100644 --- a/processor/metricset/package_tests/TestProcessMetricset.approved.json +++ b/processor/metricset/package_tests/TestProcessMetricset.approved.json @@ -34,8 +34,9 @@ "platform": "darwin" }, "tags": { - "code": "200", - "some.other.code": "abc" + "code": 200, + "key": "value", + "success": true } }, "dotted": { @@ -47,8 +48,9 @@ "float_gauge": 9.16, "integer_gauge": 42767, "labels": { - "code": "200", - "some.other.code": "abc" + "code": 200, + "key": "value", + "success": true }, "long_gauge": 3147483648, "negative": { diff --git a/processor/metricset/package_tests/json_schema_test.go b/processor/metricset/package_tests/json_schema_test.go index 7c40a2b330c..ed5078d720c 100644 --- a/processor/metricset/package_tests/json_schema_test.go +++ b/processor/metricset/package_tests/json_schema_test.go @@ -56,12 +56,11 @@ func TestInvalidPayloads(t *testing.T) { {Msg: `timestamp/format`, Values: val{"2017-05-30T18:53Z", "2017-05-30T18:53:27.Z", "2017-05-30T18:53:27a123Z"}}, {Msg: `timestamp/pattern`, Values: val{"2017-05-30T18:53:27.000+00:20", "2017-05-30T18:53:27ZNOTCORRECT"}}}}, {Key: "metrics.tags", - Valid: val{obj{tests.Str1024Special: tests.Str1024Special}}, + Valid: val{obj{tests.Str1024Special: tests.Str1024Special}, obj{tests.Str1024: 123.45}, obj{tests.Str1024: true}}, Invalid: []tests.Invalid{ {Msg: `tags/type`, Values: val{"tags"}}, - {Msg: `tags/patternproperties`, Values: val{obj{"invalid": tests.Str1025}, obj{tests.Str1024: 123}, obj{tests.Str1024: obj{}}}}, - {Msg: `tags/additionalproperties`, Values: val{obj{"invali*d": "hello"}, obj{"invali\"d": "hello"}}}}, - }, + {Msg: `tags/patternproperties`, Values: val{obj{"invalid": tests.Str1025}, obj{tests.Str1024: obj{}}}}, + {Msg: `tags/additionalproperties`, Values: val{obj{"invali*d": "hello"}, obj{"invali\"d": "hello"}, obj{"invali.d": "hello"}}}}}, { Key: "metrics.samples", Valid: val{ diff --git a/processor/stream/approved-es-documents/testV2IntakeIntegrationMetricsets.approved.json b/processor/stream/approved-es-documents/testV2IntakeIntegrationMetricsets.approved.json index 310f1c6d0f0..5cadfa8de58 100644 --- a/processor/stream/approved-es-documents/testV2IntakeIntegrationMetricsets.approved.json +++ b/processor/stream/approved-es-documents/testV2IntakeIntegrationMetricsets.approved.json @@ -18,8 +18,9 @@ "name": "1234_service-12a3" }, "tags": { - "code": "200", - "some.other.code": "abc" + "code": 200, + "some": "abc", + "success": true } }, "dotted": { @@ -31,8 +32,9 @@ "float_gauge": 9.16, "integer_gauge": 42767, "labels": { - "code": "200", - "some.other.code": "abc" + "code": 200, + "some": "abc", + "success": true }, "long_gauge": 3147483648, "negative": { diff --git a/processor/stream/approved-es-documents/testV2IntakeIntegrationSpans.approved.json b/processor/stream/approved-es-documents/testV2IntakeIntegrationSpans.approved.json index 6119fbc20f2..6ea8c41f6ac 100644 --- a/processor/stream/approved-es-documents/testV2IntakeIntegrationSpans.approved.json +++ b/processor/stream/approved-es-documents/testV2IntakeIntegrationSpans.approved.json @@ -90,7 +90,10 @@ "name": "backendspans" }, "tags": { - "tag1": "value1" + "tag1": "value1", + "tag2": 123, + "tag3": 12.34, + "tag4": true } }, "parent": { diff --git a/processor/stream/approved-es-documents/testV2IntakeIntegrationTransactions.approved.json b/processor/stream/approved-es-documents/testV2IntakeIntegrationTransactions.approved.json index e4ae91e348c..640e2403ac9 100644 --- a/processor/stream/approved-es-documents/testV2IntakeIntegrationTransactions.approved.json +++ b/processor/stream/approved-es-documents/testV2IntakeIntegrationTransactions.approved.json @@ -183,7 +183,10 @@ "platform": "darwin" }, "tags": { - "organization_uuid": "9f0e9d64-c185-4d21-a6f4-4673ed561ec8" + "organization_uuid": "9f0e9d64-c185-4d21-a6f4-4673ed561ec8", + "tag2": 12, + "tag3": 12.45, + "tag4": false }, "user": { "email": "foo@example.com", diff --git a/processor/stream/package_tests/error_attrs_test.go b/processor/stream/package_tests/error_attrs_test.go index 7768cd9e5f5..d59e9070488 100644 --- a/processor/stream/package_tests/error_attrs_test.go +++ b/processor/stream/package_tests/error_attrs_test.go @@ -223,10 +223,10 @@ func TestPayloadDataForError(t *testing.T) { {Key: "error.context.request.cookies", Valid: val{obj{}}, Invalid: []tests.Invalid{{Msg: `/context/properties/request/properties/cookies/type`, Values: val{102, "a"}}}}, {Key: "error.context.tags", - Valid: val{obj{tests.Str1024Special: tests.Str1024Special}}, + Valid: val{obj{tests.Str1024Special: tests.Str1024Special}, obj{tests.Str1024: 123.45}, obj{tests.Str1024: true}}, Invalid: []tests.Invalid{ {Msg: `context/properties/tags/type`, Values: val{"tags"}}, - {Msg: `context/properties/tags/patternproperties`, Values: val{obj{"invalid": tests.Str1025}, obj{tests.Str1024: 123}, obj{tests.Str1024: obj{}}}}, + {Msg: `context/properties/tags/patternproperties`, Values: val{obj{"invalid": tests.Str1025}, obj{tests.Str1024: obj{}}}}, {Msg: `context/properties/tags/additionalproperties`, Values: val{obj{"invali*d": "hello"}, obj{"invali\"d": "hello"}, obj{"invali.d": "hello"}}}}}, {Key: "error.context.user.id", Valid: val{123, tests.Str1024Special}, Invalid: []tests.Invalid{ diff --git a/processor/stream/package_tests/metricset_attrs_test.go b/processor/stream/package_tests/metricset_attrs_test.go index 7666587594c..c7e5121f0e0 100644 --- a/processor/stream/package_tests/metricset_attrs_test.go +++ b/processor/stream/package_tests/metricset_attrs_test.go @@ -63,10 +63,10 @@ func TestInvalidPayloads(t *testing.T) { Invalid: []tests.Invalid{ {Msg: `timestamp/type`, Values: val{"1496170422281000"}}}}, {Key: "metricset.tags", - Valid: val{obj{tests.Str1024Special: tests.Str1024Special}}, + Valid: val{obj{tests.Str1024Special: tests.Str1024Special}, obj{tests.Str1024: 123.45}, obj{tests.Str1024: true}}, Invalid: []tests.Invalid{ {Msg: `tags/type`, Values: val{"tags"}}, - {Msg: `tags/patternproperties`, Values: val{obj{"invalid": tests.Str1025}, obj{tests.Str1024: 123}, obj{tests.Str1024: obj{}}}}, + {Msg: `tags/patternproperties`, Values: val{obj{"invalid": tests.Str1025}, obj{tests.Str1024: obj{}}}}, {Msg: `tags/additionalproperties`, Values: val{obj{"invali*d": "hello"}, obj{"invali\"d": "hello"}}}}, }, { diff --git a/processor/stream/package_tests/span_attrs_test.go b/processor/stream/package_tests/span_attrs_test.go index 93e30d49ded..92580304542 100644 --- a/processor/stream/package_tests/span_attrs_test.go +++ b/processor/stream/package_tests/span_attrs_test.go @@ -74,7 +74,7 @@ func spanPayloadAttrsNotInJsonSchema() *tests.Set { return tests.NewSet( "span", "span.stacktrace.vars.key", - "span.context.tags.tag1", + tests.Group("span.context.tags.tag"), ) } @@ -173,10 +173,10 @@ func TestPayloadDataForSpans(t *testing.T) { spanProcSetup().DataValidation(t, []tests.SchemaTestData{ {Key: "span.context.tags", - Valid: val{obj{tests.Str1024Special: tests.Str1024Special}}, + Valid: val{obj{tests.Str1024Special: tests.Str1024Special}, obj{tests.Str1024: 123.45}, obj{tests.Str1024: true}}, Invalid: []tests.Invalid{ {Msg: `tags/type`, Values: val{"tags"}}, - {Msg: `tags/patternproperties`, Values: val{obj{"invalid": tests.Str1025}, obj{tests.Str1024: 123}, obj{tests.Str1024: obj{}}}}, + {Msg: `tags/patternproperties`, Values: val{obj{"invalid": tests.Str1025}, obj{tests.Str1024: obj{}}}}, {Msg: `tags/additionalproperties`, Values: val{obj{"invali*d": "hello"}, obj{"invali\"d": "hello"}, obj{"invali.d": "hello"}}}}, }, {Key: "span.timestamp", diff --git a/processor/stream/package_tests/transaction_attrs_test.go b/processor/stream/package_tests/transaction_attrs_test.go index 7e9be1c45ab..4796df7001d 100644 --- a/processor/stream/package_tests/transaction_attrs_test.go +++ b/processor/stream/package_tests/transaction_attrs_test.go @@ -202,10 +202,10 @@ func TestPayloadDataForTransaction(t *testing.T) { Valid: []interface{}{obj{}}, Invalid: []tests.Invalid{{Msg: `context/properties/request/properties/cookies/type`, Values: val{123, ""}}}}, {Key: "transaction.context.tags", - Valid: val{obj{tests.Str1024Special: tests.Str1024Special}}, + Valid: val{obj{tests.Str1024Special: tests.Str1024Special}, obj{tests.Str1024: 123.45}, obj{tests.Str1024: true}}, Invalid: []tests.Invalid{ {Msg: `tags/type`, Values: val{"tags"}}, - {Msg: `tags/patternproperties`, Values: val{obj{"invalid": tests.Str1025}, obj{tests.Str1024: 123}, obj{tests.Str1024: obj{}}}}, + {Msg: `tags/patternproperties`, Values: val{obj{"invalid": tests.Str1025}, obj{tests.Str1024: obj{}}}}, {Msg: `tags/additionalproperties`, Values: val{obj{"invali*d": "hello"}, obj{"invali\"d": "hello"}, obj{"invali.d": "hello"}}}}}, {Key: "transaction.context.user.id", Valid: val{123, tests.Str1024Special}, diff --git a/processor/transaction/package_tests/TestProcessTransactionFull.approved.json b/processor/transaction/package_tests/TestProcessTransactionFull.approved.json index a586d108ab0..1096dd9f1a6 100644 --- a/processor/transaction/package_tests/TestProcessTransactionFull.approved.json +++ b/processor/transaction/package_tests/TestProcessTransactionFull.approved.json @@ -102,6 +102,8 @@ "platform": "darwin" }, "tags": { + "bool_error": false, + "number_code": 2, "organization_uuid": "9f0e9d64-c185-4d21-a6f4-4673ed561ec8" }, "user": { @@ -166,6 +168,8 @@ "name": "1234_service-12a3" }, "tags": { + "code": 200, + "error": false, "span_tag": "something" } }, diff --git a/processor/transaction/package_tests/attrs_common.go b/processor/transaction/package_tests/attrs_common.go index 0e6c800fe86..a497b24a95e 100644 --- a/processor/transaction/package_tests/attrs_common.go +++ b/processor/transaction/package_tests/attrs_common.go @@ -198,17 +198,18 @@ func schemaTestData(td []tests.SchemaTestData) []tests.SchemaTestData { Valid: []interface{}{obj{}}, Invalid: []tests.Invalid{{Msg: `context/properties/request/properties/cookies/type`, Values: val{123, ""}}}}, {Key: "transactions.context.tags", - Valid: val{obj{tests.Str1024Special: tests.Str1024Special}}, + Valid: val{obj{tests.Str1024Special: tests.Str1024Special}, obj{tests.Str1024: 123.45}, obj{tests.Str1024: true}}, Invalid: []tests.Invalid{ {Msg: `tags/type`, Values: val{"tags"}}, - {Msg: `tags/patternproperties`, Values: val{obj{"invalid": tests.Str1025}, obj{tests.Str1024: 123}, obj{tests.Str1024: obj{}}}}, + {Msg: `tags/patternproperties`, Values: val{obj{"invalid": tests.Str1025}, obj{tests.Str1024: obj{}}}}, {Msg: `tags/additionalproperties`, Values: val{obj{"invali*d": "hello"}, obj{"invali\"d": "hello"}, obj{"invali.d": "hello"}}}}}, {Key: "transactions.spans.context.tags", - Valid: val{obj{tests.Str1024Special: tests.Str1024Special}}, + Valid: val{obj{tests.Str1024Special: tests.Str1024Special}, obj{tests.Str1024: 123.45}, obj{tests.Str1024: true}}, Invalid: []tests.Invalid{ {Msg: `tags/type`, Values: val{"tags"}}, - {Msg: `tags/patternproperties`, Values: val{obj{"invalid": tests.Str1025}, obj{tests.Str1024: 123}, obj{tests.Str1024: obj{}}}}, - {Msg: `tags/additionalproperties`, Values: val{obj{"invali*d": "hello"}, obj{"invali\"d": "hello"}, obj{"invali.d": "hello"}}}}}, + {Msg: `tags/patternproperties`, Values: val{obj{"invalid": tests.Str1025}, obj{tests.Str1024: obj{}}}}, + {Msg: `tags/additionalproperties`, Values: val{obj{"invali*d": "hello"}, obj{"invali\"d": "hello"}, obj{"invali.d": "hello"}}}}, + }, {Key: "transactions.context.user.id", Valid: val{123, tests.Str1024Special}, Invalid: []tests.Invalid{ diff --git a/testdata/intake-v2/invalid-json-metadata.ndjson b/testdata/intake-v2/invalid-json-metadata.ndjson index ab7d9652c4f..e52e4296f9f 100644 --- a/testdata/intake-v2/invalid-json-metadata.ndjson +++ b/testdata/intake-v2/invalid-json-metadata.ndjson @@ -1,2 +1,2 @@ {"metadata": {"invalid-json"}} -{"metricset": { "samples": { "byte_counter": { "value": 1 }, "short_counter": { "value": 227 }, "integer_gauge": { "value": 42767 }, "long_gauge": { "value": 3147483648 }, "float_gauge": { "value": 9.16 }, "double_gauge": { "value": 3.141592653589793 }, "dotted.float.gauge": { "value": 6.12 }, "negative.d.o.t.t.e.d": { "value": -1022 } }, "tags": { "code": "200", "some.other.code": "abc" }, "timestamp": 1496170422281000 }} +{"metricset": { "samples": { "byte_counter": { "value": 1 }, "short_counter": { "value": 227 }, "integer_gauge": { "value": 42767 }, "long_gauge": { "value": 3147483648 }, "float_gauge": { "value": 9.16 }, "double_gauge": { "value": 3.141592653589793 }, "dotted.float.gauge": { "value": 6.12 }, "negative.d.o.t.t.e.d": { "value": -1022 } }, "tags": { "code": "200", "code": "abc" }, "timestamp": 1496170422281000 }} diff --git a/testdata/intake-v2/invalid-metadata-2.ndjson b/testdata/intake-v2/invalid-metadata-2.ndjson index f70755d45be..729f30e7823 100644 --- a/testdata/intake-v2/invalid-metadata-2.ndjson +++ b/testdata/intake-v2/invalid-metadata-2.ndjson @@ -1,3 +1,3 @@ {"not": "metadata"} -{"metricset": { "samples": { "byte_counter": { "value": 1 }, "short_counter": { "value": 227 }, "integer_gauge": { "value": 42767 }, "long_gauge": { "value": 3147483648 }, "float_gauge": { "value": 9.16 }, "double_gauge": { "value": 3.141592653589793 }, "dotted.float.gauge": { "value": 6.12 }, "negative.d.o.t.t.e.d": { "value": -1022 } }, "tags": { "code": "200", "some.other.code": "abc" }, "timestamp": 1496170422281000 }} +{"metricset": { "samples": { "byte_counter": { "value": 1 }, "short_counter": { "value": 227 }, "integer_gauge": { "value": 42767 }, "long_gauge": { "value": 3147483648 }, "float_gauge": { "value": 9.16 }, "double_gauge": { "value": 3.141592653589793 }, "dotted.float.gauge": { "value": 6.12 }, "negative.d.o.t.t.e.d": { "value": -1022 } }, "tags": { "code": "200", "key": "abc" }, "timestamp": 1496170422281000 }} diff --git a/testdata/intake-v2/invalid-metadata.ndjson b/testdata/intake-v2/invalid-metadata.ndjson index 139c1f03259..f2a61edb225 100644 --- a/testdata/intake-v2/invalid-metadata.ndjson +++ b/testdata/intake-v2/invalid-metadata.ndjson @@ -1,3 +1,3 @@ {"metadata": {"user": null}} -{"metricset": { "samples": { "byte_counter": { "value": 1 }, "short_counter": { "value": 227 }, "integer_gauge": { "value": 42767 }, "long_gauge": { "value": 3147483648 }, "float_gauge": { "value": 9.16 }, "double_gauge": { "value": 3.141592653589793 }, "dotted.float.gauge": { "value": 6.12 }, "negative.d.o.t.t.e.d": { "value": -1022 } }, "tags": { "code": "200", "some.other.code": "abc" }, "timestamp": 1496170422281000 }} +{"metricset": { "samples": { "byte_counter": { "value": 1 }, "short_counter": { "value": 227 }, "integer_gauge": { "value": 42767 }, "long_gauge": { "value": 3147483648 }, "float_gauge": { "value": 9.16 }, "double_gauge": { "value": 3.141592653589793 }, "dotted.float.gauge": { "value": 6.12 }, "negative.d.o.t.t.e.d": { "value": -1022 } }, "tags": { "code": "200", "some": "abc" }, "timestamp": 1496170422281000 }} diff --git a/testdata/intake-v2/metricsets.ndjson b/testdata/intake-v2/metricsets.ndjson index a7a5ac6b67a..a6ebbc52f67 100644 --- a/testdata/intake-v2/metricsets.ndjson +++ b/testdata/intake-v2/metricsets.ndjson @@ -1,3 +1,3 @@ {"metadata": {"user": null, "process": {"ppid": null, "pid": 1234, "argv": null, "title": null}, "system": null, "service": {"name": "1234_service-12a3", "language": {"version": null, "name":"ecmascript"}, "agent": {"version": "3.14.0", "name": "elastic-node"}, "environment": null, "framework": null,"version": null, "runtime": null}}} -{"metricset": { "samples": { "byte_counter": { "value": 1 }, "short_counter": { "value": 227 }, "integer_gauge": { "value": 42767 }, "long_gauge": { "value": 3147483648 }, "float_gauge": { "value": 9.16 }, "double_gauge": { "value": 3.141592653589793 }, "dotted.float.gauge": { "value": 6.12 }, "negative.d.o.t.t.e.d": { "value": -1022 } }, "tags": { "code": "200", "some.other.code": "abc" }, "timestamp": 1496170422281000 }} +{"metricset": { "samples": { "byte_counter": { "value": 1 }, "short_counter": { "value": 227 }, "integer_gauge": { "value": 42767 }, "long_gauge": { "value": 3147483648 }, "float_gauge": { "value": 9.16 }, "double_gauge": { "value": 3.141592653589793 }, "dotted.float.gauge": { "value": 6.12 }, "negative.d.o.t.t.e.d": { "value": -1022 } }, "tags": { "some": "abc", "code": 200, "success": true }, "timestamp": 1496170422281000 }} { "metricset": { "samples": { "go.memstats.heap.sys.bytes": { "value": 6.520832e+06 } }, "timestamp": 1496170422281000 }} diff --git a/testdata/intake-v2/spans.ndjson b/testdata/intake-v2/spans.ndjson index 4d98291ce67..8b747030f07 100644 --- a/testdata/intake-v2/spans.ndjson +++ b/testdata/intake-v2/spans.ndjson @@ -1,6 +1,6 @@ {"metadata": {"user": {"id": "123", "email": "s@test.com", "username": "john"}, "process": {"ppid": 6789, "pid": 1234,"argv": ["node", "server.js"], "title": "node"}, "system": {"platform": "darwin", "hostname": "prod1.example.com", "architecture": "x64", "container": {"id": "container-id"}, "kubernetes": {"namespace": "namespace1", "pod": {"uid": "pod-uid", "name": "pod-name"}, "node": {"name": "node-name"}}}, "service": {"name": "backendspans", "language": {"version": "8", "name": "ecmascript"}, "agent": {"version": "3.14.0", "name": "elastic-node"}, "environment": "staging", "framework": {"version": "1.2.3", "name": "Express"}, "version": "5.1.3", "runtime": {"version": "8.0.0", "name": "node"}}}} {"span": {"trace_id": "fdedef0123456789abcdef9876543210", "parent_id": "abcdef0123456789", "id": "abcdef01234567", "transaction_id": "01af25874dec69dd", "name": "GET /api/types", "type": "request","start": null, "duration": 141.581, "timestamp": 1532976822281000}} { "span": {"trace_id": "abcdef0123456789abcdef9876543210", "parent_id": "0000000011111111", "id": "1234abcdef567895", "transaction_id": "ab45781d265894fe", "name": "GET /api/types", "type": "request", "start": 22, "duration": 32.592981, "timestamp": 1532976822281000} } -{ "span": {"trace_id": "abcdef0123456789abcdef9876543210", "parent_id": "abcdefabcdef7890", "id": "0123456a89012345", "transaction_id": "ab23456a89012345", "name": "GET /api/types", "type": "request", "start": 1.845, "duration": 3.5642981, "stacktrace": [], "context": {"tags": {"tag1": "value1"}} }} +{ "span": {"trace_id": "abcdef0123456789abcdef9876543210", "parent_id": "abcdefabcdef7890", "id": "0123456a89012345", "transaction_id": "ab23456a89012345", "name": "GET /api/types", "type": "request", "start": 1.845, "duration": 3.5642981, "stacktrace": [], "context": {"tags": {"tag1": "value1", "tag2": 123, "tag3": 12.34, "tag4": true, "tag5": null}} }} { "span": {"trace_id": "abcdef0123456789abcdef9876543210", "parent_id": "ababcdcdefefabde", "id": "abcde56a89012345", "transaction_id": "bed3456a89012345", "name": "get /api/types", "sync": false, "type": "request", "subtype": "http", "action": "call", "start": 0, "duration": 13.9802981, "stacktrace": null, "context": null }} { "span": {"trace_id": "abcdef0123456789abcdef9876543210", "parent_id": "abcdef0123456789", "id": "1234567890aaaade","transaction_id": "aff4567890aaaade", "sync": true, "name": "SELECT FROM product_types", "type": "db", "subtype": "postgresql", "action": "query", "start": 2.83092, "duration": 3.781912, "stacktrace": [{ "filename": "net.js", "lineno": 547},{"filename": "file2.js", "lineno": 12, "post_context": [ " ins.currentTransaction = prev", "}"]}, { "function": "onread", "abs_path": "net.js", "filename": "net.js", "lineno": 547, "library_frame": true, "vars": { "key": "value" }, "module": "some module", "colno": 4, "context_line": "line3", "pre_context": [ " var trans = this.currentTransaction", "" ], "post_context": [ " ins.currentTransaction = prev", " return result"] }], "context": { "db": { "instance": "customers", "statement": "SELECT * FROM product_types WHERE user_id=?", "type": "sql", "user": "readonly_user" }, "http": { "url": "http://localhost:8000", "status_code": 200, "method": "GET" } } }} diff --git a/testdata/intake-v2/transactions.ndjson b/testdata/intake-v2/transactions.ndjson index b5fcdf7c045..c86a055a68d 100644 --- a/testdata/intake-v2/transactions.ndjson +++ b/testdata/intake-v2/transactions.ndjson @@ -1,4 +1,4 @@ {"metadata": {"service": {"name": "1234_service-12a3","version": "5.1.3","environment": "staging","language": {"name": "ecmascript","version": "8"},"runtime": {"name": "node","version": "8.0.0"},"framework": {"name": "Express","version": "1.2.3"},"agent": {"name": "elastic-node","version": "3.14.0"}},"process": {"pid": 1234,"ppid": 6789,"title": "node","argv": ["node","server.js"]},"system": {"hostname": "prod1.example.com","architecture": "x64","platform": "darwin", "container": {"id": "container-id"}, "kubernetes": {"namespace": "namespace1", "pod": {"uid": "pod-uid", "name": "pod-name"}, "node": {"name": "node-name"}}}}} { "transaction": { "id": "945254c567a5417e", "trace_id": "0123456789abcdef0123456789abcdef", "parent_id": "abcdefabcdef01234567", "type": "request", "duration": 32.592981, "span_count": { "started": 43 }} } -{"transaction": {"id": "4340a8e0df1906ecbfa9", "trace_id": "0acd456789abcdef0123456789abcdef", "name": "GET /api/types","type": "request","duration": 32.592981,"result": "success", "timestamp": 1496170407154000, "sampled": true, "span_count": {"started": 17},"context": {"request": {"socket": {"remote_address": "12.53.12.1","encrypted": true},"http_version": "1.1","method": "POST","url": {"protocol": "https:","full": "https://www.example.com/p/a/t/h?query=string#hash","hostname": "www.example.com","port": "8080","pathname": "/p/a/t/h","search": "?query=string","hash": "#hash","raw": "/p/a/t/h?query=string#hash"},"headers": {"user-agent": "Mozilla Chrome Edge","content-type": "text/html","cookie": "c1=v1; c2=v2","some-other-header": "foo","array": ["foo","bar","baz"]},"cookies": {"c1": "v1","c2": "v2"},"env": {"SERVER_SOFTWARE": "nginx","GATEWAY_INTERFACE": "CGI/1.1"},"body": {"str": "hello world","additional": { "foo": {},"bar": 123,"req": "additional information"}}},"response": {"status_code": 200,"headers": {"content-type": "application/json"},"headers_sent": true,"finished": true}, "user": {"id": "99","username": "foo","email": "foo@example.com"},"tags": {"organization_uuid": "9f0e9d64-c185-4d21-a6f4-4673ed561ec8"},"custom": {"my_key": 1,"some_other_value": "foo bar","and_objects": {"foo": ["bar","baz"]},"(": "not a valid regex and that is fine"}}}} +{"transaction": {"id": "4340a8e0df1906ecbfa9", "trace_id": "0acd456789abcdef0123456789abcdef", "name": "GET /api/types","type": "request","duration": 32.592981,"result": "success", "timestamp": 1496170407154000, "sampled": true, "span_count": {"started": 17},"context": {"request": {"socket": {"remote_address": "12.53.12.1","encrypted": true},"http_version": "1.1","method": "POST","url": {"protocol": "https:","full": "https://www.example.com/p/a/t/h?query=string#hash","hostname": "www.example.com","port": "8080","pathname": "/p/a/t/h","search": "?query=string","hash": "#hash","raw": "/p/a/t/h?query=string#hash"},"headers": {"user-agent": "Mozilla Chrome Edge","content-type": "text/html","cookie": "c1=v1; c2=v2","some-other-header": "foo","array": ["foo","bar","baz"]},"cookies": {"c1": "v1","c2": "v2"},"env": {"SERVER_SOFTWARE": "nginx","GATEWAY_INTERFACE": "CGI/1.1"},"body": {"str": "hello world","additional": { "foo": {},"bar": 123,"req": "additional information"}}},"response": {"status_code": 200,"headers": {"content-type": "application/json"},"headers_sent": true,"finished": true}, "user": {"id": "99","username": "foo","email": "foo@example.com"},"tags": {"organization_uuid": "9f0e9d64-c185-4d21-a6f4-4673ed561ec8", "tag2": 12, "tag3": 12.45, "tag4": false, "tag5": null },"custom": {"my_key": 1,"some_other_value": "foo bar","and_objects": {"foo": ["bar","baz"]},"(": "not a valid regex and that is fine"}}}} {"transaction": { "id": "cdef4340a8e0df19", "trace_id": "0acd456789abcdef0123456789abcdef", "type": "request", "duration": 13.980558, "timestamp": 1532976822281000, "sampled": null, "span_count": { "dropped": 55, "started": 436 }, "marks": {"navigationTiming": {"appBeforeBootstrap": 608.9300000000001,"navigationStart": -21},"another_mark": {"some_long": 10,"some_float": 10.0}, "performance": {}}, "context": { "request": { "socket": { "remote_address": null, "encrypted": null }, "method": "POST", "headers": { "user-agent": null, "content-type": null, "cookie": null }, "url": { "protocol": null, "full": null, "hostname": null, "port": null, "pathname": null, "search": null, "hash": null, "raw": null } }, "response": { "headers": { "content-type": null } } }} } diff --git a/testdata/intake-v2/transactions_spans.ndjson b/testdata/intake-v2/transactions_spans.ndjson new file mode 100644 index 00000000000..44c6ffa3e40 --- /dev/null +++ b/testdata/intake-v2/transactions_spans.ndjson @@ -0,0 +1,10 @@ +{"metadata":{"service":{"name":"1234_service-12a3","version":"5.1.3","environment":"staging","language":{"name":"ecmascript","version":"8"},"runtime":{"name":"node","version":"8.0.0"},"framework":{"name":"Express","version":"1.2.3"},"agent":{"name":"elastic-node","version":"3.14.0"}},"process":{"pid":1234,"ppid":6789,"title":"node","argv":["node","server.js"]},"system":{"hostname":"prod1.example.com","architecture":"x64","platform":"darwin"}}} +{"transaction":{"id":"945254c567a5417e","name":"GET /api/types","type":"request","duration":32.592981,"result":"success","timestamp":1496170407154000,"sampled":true,"span_count":{"dropped":2,"started":4},"context":{"request":{"socket":{"remote_address":"12.53.12.1","encrypted":true},"http_version":"1.1","method":"POST","url":{"protocol":"https:","full":"https://www.example.com/p/a/t/h?query=string#hash","hostname":"www.example.com","port":"8080","pathname":"/p/a/t/h","search":"?query=string","hash":"#hash","raw":"/p/a/t/h?query=string#hash"},"headers":{"user-agent":"Mozilla Chrome Edge","content-type":"text/html","cookie":"c1=v1; c2=v2","some-other-header":"foo","array":["foo","bar","baz"]},"cookies":{"c1":"v1","c2":"v2"},"env":{"SERVER_SOFTWARE":"nginx","GATEWAY_INTERFACE":"CGI/1.1"},"body":{"str":"hello world","additional":{"foo":{},"bar":123,"req":"additional information"}}},"response":{"status_code":200,"headers":{"content-type":"application/json"},"headers_sent":true,"finished":true},"user":{"id":"99","username":"foo","email":"foo@example.com"},"tags":{"organization_uuid":"9f0e9d64-c185-4d21-a6f4-4673ed561ec8", "number_code": 2, "bool_error": false},"custom":{"my_key":1,"some_other_value":"foo bar","and_objects":{"foo":["bar","baz"]},"(":"not a valid regex and that is fine"}},"marks":{"navigationTiming":{"appBeforeBootstrap":608.9300000000001,"navigationStart":-21},"another_mark":{"some_long":10,"some_float":10.0},"performance":{}},"trace_id":"945254c567a5417eaaaaaaaaaaaaaaaa"}} +{"span":{"id":"0aaaaaaaaaaaaaaa","timestamp":1496170407154000,"parent":null,"name":"SELECT FROM product_types","type":"db.postgresql.query","start":2.83092,"duration":3.781912,"sync":false,"stacktrace":[{"function":"onread","abs_path":"net.js","filename":"net.js","lineno":547,"library_frame":true,"vars":{"key":"value"},"module":"some module","colno":4,"context_line":"line3","pre_context":[" var trans = this.currentTransaction",""],"post_context":[" ins.currentTransaction = prev"," return result","}"]},{"filename":"my2file.js","lineno":10}],"context":{"db":{"instance":"customers","statement":"SELECT * FROM product_types WHERE user_id=?","type":"sql","user":"readonly_user"},"http":{"url":"http://localhost:8000","status_code":200,"method":"GET"},"tags":{"span_tag":"something"}},"transaction_id":"945254c567a5417e","parent_id":"945254c567a5417e","trace_id":"945254c567a5417eaaaaaaaaaaaaaaaa"}} +{"span":{"id":"1aaaaaaaaaaaaaaa","timestamp":1496170407154000,"parent":0,"name":"GET /api/types","type":"request","start":0,"duration":32.592981,"transaction_id":"945254c567a5417e","parent_id":"945254c567a5417e","trace_id":"945254c567a5417eaaaaaaaaaaaaaaaa"}} +{"span":{"id":"2aaaaaaaaaaaaaaa","timestamp":1496170407154000,"parent":1,"name":"GET /api/types","type":"request","start":1.845,"duration":3.5642981,"stacktrace":[],"context":{},"transaction_id":"945254c567a5417e","parent_id":"945254c567a5417e","trace_id":"945254c567a5417eaaaaaaaaaaaaaaaa"}} +{"span":{"id":"3aaaaaaaaaaaaaaa","timestamp":1496170407154000,"parent":2,"name":"GET /api/types","type":"request","start":0,"duration":13.9802981,"stacktrace":null,"context":null,"transaction_id":"945254c567a5417e","parent_id":"945254c567a5417e","trace_id":"945254c567a5417eaaaaaaaaaaaaaaaa"}} +{"transaction":{"id":"85925e55b43f4340","name":"GET /api/types","type":"request","duration":13.980558,"result":"failure","timestamp":1496170422281000,"sampled":true,"trace_id":"85925e55b43f4340aaaaaaaaaaaaaaaa","span_count":{"started":0}}} +{"transaction":{"id":"85925e55b43f4341","name":"GET /api/types","type":"request","duration":13.980558,"result":"200","timestamp":1496170422000000,"sampled":false,"trace_id":"85925e55b43f4341aaaaaaaaaaaaaaaa","span_count":{"started":0}}} +{"transaction":{"id":"85925e55b43f4342","name":"GET /api/types","type":"request","duration":13.980558,"result":"200","timestamp":1496170422281999,"sampled":true,"span_count":{"dropped":258,"started":1},"trace_id":"85925e55b43f4342aaaaaaaaaaaaaaaa"}} +{"span":{"id":"15aaaaaaaaaaaaaa","timestamp":1496170422281000,"name":"SELECT FROM product_types","type":"db.postgresql.query","start":2.83092,"duration":3.781912,"stacktrace":[],"context":{"db":{"instance":"customers","statement":"SELECT * FROM product_types WHERE user_id=?","type":"sql","user":"readonly_user"}},"transaction_id":"85925e55b43f4342","parent_id":"85925e55b43f4342","trace_id":"85925e55b43f4342aaaaaaaaaaaaaaaa"}} diff --git a/testdata/metricset/payload.json b/testdata/metricset/payload.json index 25ec0583ac6..233b83f80f5 100644 --- a/testdata/metricset/payload.json +++ b/testdata/metricset/payload.json @@ -54,8 +54,9 @@ } }, "tags": { - "code": "200", - "some.other.code": "abc" + "code": 200, + "key": "value", + "success": true }, "timestamp": "2017-05-30T18:53:42.281Z" }] diff --git a/testdata/transaction/payload.json b/testdata/transaction/payload.json index 25bc4fb4f96..bf28d00c744 100644 --- a/testdata/transaction/payload.json +++ b/testdata/transaction/payload.json @@ -108,7 +108,9 @@ "email": "foo@example.com" }, "tags": { - "organization_uuid": "9f0e9d64-c185-4d21-a6f4-4673ed561ec8" + "organization_uuid": "9f0e9d64-c185-4d21-a6f4-4673ed561ec8", + "number_code": 2, + "bool_error": false }, "custom": { "my_key": 1, @@ -172,7 +174,9 @@ "method": "GET" }, "tags": { - "span_tag": "something" + "span_tag": "something", + "code": 200, + "error": false } } }, diff --git a/tests/fields.go b/tests/fields.go index ca11aa809c2..2a9216ffed6 100644 --- a/tests/fields.go +++ b/tests/fields.go @@ -48,6 +48,7 @@ func (ps *ProcessorSetup) PayloadAttrsMatchFields(t *testing.T, payloadAttrsNotI "context.tags.span_tag", "labels.organization_uuid", "labels.span_tag", + Group("context.tags."), //known not-indexed fields: Group("context.custom"), Group("context.db"), diff --git a/tests/system/spans.approved.json b/tests/system/spans.approved.json index a6a6a804ffc..4ab3fee2b97 100644 --- a/tests/system/spans.approved.json +++ b/tests/system/spans.approved.json @@ -212,7 +212,9 @@ } }, "tags": { - "span_tag": "something" + "span_tag": "something", + "code": 200, + "error": false } }, "processor": { diff --git a/tests/system/test_integration.py b/tests/system/test_integration.py index 93a6478f81c..d0a9d0da529 100644 --- a/tests/system/test_integration.py +++ b/tests/system/test_integration.py @@ -78,6 +78,22 @@ def test_mark_navigation_timing(self): mtype = mapping["type"] assert mtype == "scaled_float", name + " mapped as " + mtype + ", not scaled_float" + def test_tags_type(self): + self.load_docs_with_template(self.get_payload_path("transactions_spans.ndjson"), + self.intake_url, 'transaction', 9) + self.assert_no_logged_warnings() + mappings = self.es.indices.get_field_mapping(index=self.index_name, fields="context.tags.*") + for name, metric in mappings[self.index_name]["mappings"]["_doc"].items(): + fullname = metric["full_name"] + for mapping in metric["mapping"].values(): + mtype = mapping["type"] + if fullname.startswith("context.tags.bool"): + assert mtype == "boolean", name + " mapped as " + mtype + ", not boolean" + elif fullname.startswith("context.tags.number"): + assert mtype == "scaled_float", name + " mapped as " + mtype + ", not scaled_float" + else: + assert mtype == "keyword", name + " mapped as " + mtype + ", not keyword" + @unittest.skipUnless(INTEGRATION_TESTS, "integration test") def test_load_docs_with_template_and_add_error(self): """ diff --git a/tests/system/transaction.approved.json b/tests/system/transaction.approved.json index 5f9b98670b8..8f42bfcc00f 100644 --- a/tests/system/transaction.approved.json +++ b/tests/system/transaction.approved.json @@ -106,7 +106,9 @@ } }, "tags": { - "organization_uuid": "9f0e9d64-c185-4d21-a6f4-4673ed561ec8" + "organization_uuid": "9f0e9d64-c185-4d21-a6f4-4673ed561ec8", + "number_code": 2, + "bool_error": false }, "response": { "headers": {