From 4b10302d5859c2a22aa9fc7fe0b35671275b89fe Mon Sep 17 00:00:00 2001 From: simitt Date: Thu, 31 Jan 2019 14:51:14 +0100 Subject: [PATCH] Remove storing `context` in ES. fixes #411 --- model/error/event.go | 10 +--------- model/error/event_test.go | 3 ++- model/span/event.go | 4 ---- model/span/event_test.go | 1 - model/transaction/event.go | 10 +--------- model/transaction/event_test.go | 8 ++++---- .../testIntakeIntegrationRumErrors.approved.json | 11 ----------- testdata/intake-v2/errors_2.ndjson | 2 +- testdata/intake-v2/transactions_spans.ndjson | 4 ++-- 9 files changed, 11 insertions(+), 42 deletions(-) diff --git a/model/error/event.go b/model/error/event.go index 21bf3f5b0eb..27f80688617 100644 --- a/model/error/event.go +++ b/model/error/event.go @@ -128,7 +128,6 @@ func DecodeEvent(input interface{}, err error) (transform.Transformable, error) } if labels, ok := e.Context["tags"].(map[string]interface{}); ok { - delete(e.Context, "tags") e.Labels = labels } @@ -203,21 +202,14 @@ func (e *Event) Transform(tctx *transform.Context) []beat.Event { "error": e.fields(tctx), "processor": processorEntry, } - delete(e.Context, "page") - delete(e.Context, "custom") - delete(e.Context, "user") utility.Add(fields, "user", e.User.Fields()) utility.Add(fields, "client", e.User.ClientFields()) utility.Add(fields, "user_agent", e.User.UserAgentFields()) utility.Add(fields, "labels", e.Labels) - tctx.Metadata.Merge(fields) - utility.Add(fields, "http", m.HttpFields(e.Context)) utility.Add(fields, "url", m.UrlFields(e.Context)) - delete(e.Context, "request") - delete(e.Context, "response") - utility.Add(fields, "context", e.Context) + tctx.Metadata.Merge(fields) // sampled and type is nil if an error happens outside a transaction or an (old) agent is not sending sampled info // agents must send semantically correct data diff --git a/model/error/event_test.go b/model/error/event_test.go index eb005b2dfb6..aa9d5b58e6c 100644 --- a/model/error/event_test.go +++ b/model/error/event_test.go @@ -204,6 +204,7 @@ func TestErrorEventDecode(t *testing.T) { Page: &m.Page{Url: &url, Referer: &referer}, Context: map[string]interface{}{"a": "b", "user": map[string]interface{}{ "username": name, "email": email, "ip": userIp, "id": userId}, + "tags": map[string]interface{}{"ab": "c"}, "page": map[string]interface{}{"url": url, "referer": referer}}, Exception: &Exception{ Message: &exMsg, @@ -274,7 +275,7 @@ func TestEventFields(t *testing.T) { LoggerName: &loggerName, } - context := common.MapStr{"user": common.MapStr{"id": "888"}, "c1": "val"} + context := common.MapStr{"a": "b", "user": common.MapStr{"id": "888"}, "c1": "val"} baseExceptionHash := md5.New() io.WriteString(baseExceptionHash, *baseException().Message) diff --git a/model/span/event.go b/model/span/event.go index feaedc32358..c790a11645c 100644 --- a/model/span/event.go +++ b/model/span/event.go @@ -194,7 +194,6 @@ func DecodeEvent(input interface{}, err error) (transform.Transformable, error) } if labels, ok := event.Context["tags"].(map[string]interface{}); ok { - delete(event.Context, "tags") event.Labels = labels } @@ -247,10 +246,7 @@ func (e *Event) Transform(tctx *transform.Context) []beat.Event { "processor": processorEntry, spanDocType: e.fields(tctx), } - delete(e.Context, "http") - delete(e.Context, "db") utility.Add(fields, "labels", e.Labels) - utility.Add(fields, "context", e.Context) utility.AddId(fields, "parent", &e.ParentId) utility.AddId(fields, "trace", &e.TraceId) utility.AddId(fields, "transaction", &e.TransactionId) diff --git a/model/span/event_test.go b/model/span/event_test.go index d9a3203c70d..849b14668bf 100644 --- a/model/span/event_test.go +++ b/model/span/event_test.go @@ -245,7 +245,6 @@ func TestSpanTransform(t *testing.T) { "method": "get", }, }, - "context": common.MapStr{"key": "val"}, "labels": common.MapStr{"label.a": 12}, "processor": common.MapStr{"event": "span", "name": "transaction"}, "service": common.MapStr{"name": "myService"}, diff --git a/model/transaction/event.go b/model/transaction/event.go index 32c2bcbfd1b..5da074c848f 100644 --- a/model/transaction/event.go +++ b/model/transaction/event.go @@ -114,7 +114,6 @@ func DecodeEvent(input interface{}, err error) (transform.Transformable, error) } if labels, ok := e.Context["tags"].(map[string]interface{}); ok { - delete(e.Context, "tags") e.Labels = labels } @@ -182,24 +181,17 @@ func (e *Event) Transform(tctx *transform.Context) []beat.Event { "processor": processorEntry, transactionDocType: e.fields(tctx), } - delete(e.Context, "custom") - delete(e.Context, "user") utility.Add(fields, "user", e.User.Fields()) - delete(e.Context, "page") utility.AddId(fields, "parent", e.ParentId) utility.AddId(fields, "trace", &e.TraceId) utility.Add(fields, "timestamp", utility.TimeAsMicros(e.Timestamp)) utility.Add(fields, "client", e.User.ClientFields()) utility.Add(fields, "user_agent", e.User.UserAgentFields()) utility.Add(fields, "labels", e.Labels) - tctx.Metadata.Merge(fields) - utility.Add(fields, "http", m.HttpFields(e.Context)) utility.Add(fields, "url", m.UrlFields(e.Context)) - delete(e.Context, "request") - delete(e.Context, "response") - utility.Add(fields, "context", e.Context) + tctx.Metadata.Merge(fields) events = append(events, beat.Event{Fields: fields, Timestamp: e.Timestamp}) diff --git a/model/transaction/event_test.go b/model/transaction/event_test.go index f543efcfacc..2165645d668 100644 --- a/model/transaction/event_test.go +++ b/model/transaction/event_test.go @@ -80,7 +80,8 @@ func TestTransactionEventDecode(t *testing.T) { "id": id, "type": trType, "name": name, "result": result, "duration": duration, "timestamp": timestampEpoch, "context": map[string]interface{}{"a": "b", "user": map[string]interface{}{ - "username": name, "email": email, "ip": userIp, "id": userId}, "tags": map[string]interface{}{"foo": "bar"}, + "username": name, "email": email, "ip": userIp, "id": userId}, + "tags": map[string]interface{}{"foo": "bar"}, "page": map[string]interface{}{"url": url, "referer": referer}}, "marks": marks, "sampled": sampled, "parent_id": parentId, "trace_id": traceId, @@ -106,6 +107,7 @@ func TestTransactionEventDecode(t *testing.T) { Page: &model.Page{Url: &url, Referer: &referer}, Context: map[string]interface{}{"a": "b", "user": map[string]interface{}{ "username": name, "email": email, "ip": userIp, "id": userId}, + "tags": map[string]interface{}{"foo": "bar"}, "page": map[string]interface{}{"url": url, "referer": referer}}, }, }, @@ -241,8 +243,6 @@ func TestEventMoveContext(t *testing.T) { "response": common.MapStr{"status_code": 200}, }, result[0].Fields["http"]) assert.Equal(t, common.MapStr{"original": "http://www.elastic.co"}, result[0].Fields["url"]) - assert.Nil(t, event.Context["request"]) - assert.Nil(t, event.Context["response"]) assert.NotNil(t, event.Context["db"]) portMapping := []struct { @@ -326,7 +326,7 @@ func TestEventsTransformWithMetadata(t *testing.T) { } txWithContext := Event{ Timestamp: timestamp, - Context: common.MapStr{"custom": common.MapStr{"foo": "bar"}}, + Context: common.MapStr{"foo": "bar", "custom": common.MapStr{"foo": "bar"}}, User: &user, Labels: common.MapStr{"a": "b"}, Page: &model.Page{Url: &url, Referer: &referer}, diff --git a/processor/stream/test_approved_es_documents/testIntakeIntegrationRumErrors.approved.json b/processor/stream/test_approved_es_documents/testIntakeIntegrationRumErrors.approved.json index e426e6377ae..ee2449a6b27 100644 --- a/processor/stream/test_approved_es_documents/testIntakeIntegrationRumErrors.approved.json +++ b/processor/stream/test_approved_es_documents/testIntakeIntegrationRumErrors.approved.json @@ -9,17 +9,6 @@ "client": { "ip": "192.0.0.1" }, - "context": { - "environment": { - "browserHeight": 726, - "browserWidth": 150, - "language": "en-US", - "platform": "MacIntel", - "screenHeight": 800, - "screenWidth": 1280, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36" - } - }, "error": { "culprit": "test/e2e/general-usecase/bundle.js.map", "exception": [ diff --git a/testdata/intake-v2/errors_2.ndjson b/testdata/intake-v2/errors_2.ndjson index f9631b9d2ed..9486a5b3a36 100644 --- a/testdata/intake-v2/errors_2.ndjson +++ b/testdata/intake-v2/errors_2.ndjson @@ -1,5 +1,5 @@ {"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":7788,"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"}}}}} -{"error":{"id":"5f0e9d64c1854d21a6f44673ed561ec8","timestamp":1494342245999999,"culprit":"my.module.function_name","log":{"message":"My service could not talk to the database named foobar","param_message":"My service could not talk to the database named %s","logger_name":"my.logger.name","level":"warning","stacktrace":[{"abs_path":"/real/file/name.py","filename":"/webpack/file/name.py","function":"foo","vars":{"key":"value"},"pre_context":["line1","line2"],"context_line":"line3","library_frame":false,"lineno":3,"module":"App::MyModule","colno":4,"post_context":["line4","line5"]},{"filename":"lib/instrumentation/index.js","lineno":102,"function":"instrumented","abs_path":"/Users/watson/code/node_modules/elastic/lib/instrumentation/index.js","vars":{"key":"value"},"pre_context":[" var trans = this.currentTransaction",""," return instrumented",""," function instrumented () {"," var prev = ins.currentTransaction"," ins.currentTransaction = trans"],"context_line":" var result = original.apply(this, arguments)","post_context":[" ins.currentTransaction = prev"," return result","}","}","","Instrumentation.prototype._recoverTransaction = function (trans) {"," if (this.currentTransaction === trans) return"]}]},"exception":{"message":"The username root is unknown","type":"DbError","module":"__builtins__","code":42,"handled":false,"attributes":{"foo":"bar"},"stacktrace":[{"abs_path":"/real/file/name.py","filename":"file/name.py","function":"foo","vars":{"key":"value"},"pre_context":["line1","line2"],"context_line":"line3","library_frame":true,"lineno":3,"module":"App::MyModule","colno":4,"post_context":["line4","line5"]},{"filename":"lib/instrumentation/index.js","lineno":102,"function":"instrumented","abs_path":"/Users/watson/code/node_modules/elastic/lib/instrumentation/index.js","vars":{"key":"value"},"pre_context":[" var trans = this.currentTransaction",""," return instrumented",""," function instrumented () {"," var prev = ins.currentTransaction"," ins.currentTransaction = trans"],"context_line":" var result = original.apply(this, arguments)","post_context":[" ins.currentTransaction = prev"," return result","}","}","","Instrumentation.prototype._recoverTransaction = function (trans) {"," if (this.currentTransaction === trans) return"]}]},"context":{"page":{"referer":"http://localhost:8000/test/e2e/","url":"http://localhost:8000/test/e2e/general-usecase/"},"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":"Hello World"},"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"]}}},"transaction":{"id":"945254c5-67a5-417e-8a4e-aa29efcbfb79"}}} +{"error":{"id":"5f0e9d64c1854d21a6f44673ed561ec8","timestamp":1494342245999999,"culprit":"my.module.function_name","log":{"message":"My service could not talk to the database named foobar","param_message":"My service could not talk to the database named %s","logger_name":"my.logger.name","level":"warning","stacktrace":[{"abs_path":"/real/file/name.py","filename":"/webpack/file/name.py","function":"foo","vars":{"key":"value"},"pre_context":["line1","line2"],"context_line":"line3","library_frame":false,"lineno":3,"module":"App::MyModule","colno":4,"post_context":["line4","line5"]},{"filename":"lib/instrumentation/index.js","lineno":102,"function":"instrumented","abs_path":"/Users/watson/code/node_modules/elastic/lib/instrumentation/index.js","vars":{"key":"value"},"pre_context":[" var trans = this.currentTransaction",""," return instrumented",""," function instrumented () {"," var prev = ins.currentTransaction"," ins.currentTransaction = trans"],"context_line":" var result = original.apply(this, arguments)","post_context":[" ins.currentTransaction = prev"," return result","}","}","","Instrumentation.prototype._recoverTransaction = function (trans) {"," if (this.currentTransaction === trans) return"]}]},"exception":{"message":"The username root is unknown","type":"DbError","module":"__builtins__","code":42,"handled":false,"attributes":{"foo":"bar"},"stacktrace":[{"abs_path":"/real/file/name.py","filename":"file/name.py","function":"foo","vars":{"key":"value"},"pre_context":["line1","line2"],"context_line":"line3","library_frame":true,"lineno":3,"module":"App::MyModule","colno":4,"post_context":["line4","line5"]},{"filename":"lib/instrumentation/index.js","lineno":102,"function":"instrumented","abs_path":"/Users/watson/code/node_modules/elastic/lib/instrumentation/index.js","vars":{"key":"value"},"pre_context":[" var trans = this.currentTransaction",""," return instrumented",""," function instrumented () {"," var prev = ins.currentTransaction"," ins.currentTransaction = trans"],"context_line":" var result = original.apply(this, arguments)","post_context":[" ins.currentTransaction = prev"," return result","}","}","","Instrumentation.prototype._recoverTransaction = function (trans) {"," if (this.currentTransaction === trans) return"]}]},"context":{"page":{"referer":"http://localhost:8000/test/e2e/","url":"http://localhost:8000/test/e2e/general-usecase/"},"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":"Hello World"},"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"},"foo": "bar","custom":{"my_key":1,"some_other_value":"foo bar","and_objects":{"foo":["bar","baz"]}}},"transaction":{"id":"945254c5-67a5-417e-8a4e-aa29efcbfb79"}}} {"error":{"id":"8f0e9d68c1854d21a6f44673ed561ec8","timestamp":1494342245000000,"exception":{"message":"foo is not defined","code":"35"}}} {"error":{"id":"7f0e9d68c1854d21a6f44673ed561ec8","timestamp":1494342245000000,"exception":{"type":"connection error"}}} {"error":{"id":"0f0e9d67c1854d21a6f44673ed561ec8","timestamp":1494342245999000,"log":{"level":"custom log level","message":"Cannot read property 'baz' of undefined"}}} diff --git a/testdata/intake-v2/transactions_spans.ndjson b/testdata/intake-v2/transactions_spans.ndjson index 62bad07eea4..f0eb30c6a95 100644 --- a/testdata/intake-v2/transactions_spans.ndjson +++ b/testdata/intake-v2/transactions_spans.ndjson @@ -1,5 +1,5 @@ {"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"}}},"user": {"id": "123user", "username": "foo", "email": "foo@bar.com"}}} -{"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":{ "page":{"referer":"http://localhost:8000/test/e2e/","url":"http://localhost:8000/test/e2e/general-usecase/"},"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","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"}} +{"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":{"foo": "bar", "page":{"referer":"http://localhost:8000/test/e2e/","url":"http://localhost:8000/test/e2e/general-usecase/"},"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","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.external","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","subtype":"http","action":"post","start":1.845,"duration":3.5642981,"stacktrace":[],"context":{},"transaction_id":"945254c567a5417e","parent_id":"945254c567a5417e","trace_id":"945254c567a5417eaaaaaaaaaaaaaaaa"}} @@ -7,4 +7,4 @@ {"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","subtype":"postgresql","action":"query.custom","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"}} +{"span":{"id":"15aaaaaaaaaaaaaa","timestamp":1496170422281000,"name":"SELECT FROM product_types","type":"db.postgresql.query","subtype":"postgresql","action":"query.custom","start":2.83092,"duration":3.781912,"stacktrace":[],"context":{"foo": "bar","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"}}