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 in_app to library_frame, reversing meaning #385

Merged
merged 2 commits into from
Dec 8, 2017
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 CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
https://github.com/elastic/apm-server/compare/71df0d96445df35afe27f38bcf734a0828e0761d\...master[View commits]

==== Breaking changes
- Renaming and reverse boolean `in_app` to `library_frame` {pull}385[385].
- Renaming `app` to `service` {pull}377[377]
- Move `trace.transaction_id` to `transaction.id` {pull}345[345], {pull}347[347], {pull}371[371]
- Renaming `trace` to `span` {pull}352[352].
Expand Down
8 changes: 4 additions & 4 deletions docs/data/elasticsearch/error.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
},
"filename": "file/name.py",
"function": "foo",
"in_app": false,
"library_frame": true,
"line": {
"column": 4,
"context": "line3",
Expand Down Expand Up @@ -155,7 +155,7 @@
},
"filename": "lib/instrumentation/index.js",
"function": "instrumented",
"in_app": false,
"library_frame": true,
"line": {
"context": " var result = original.apply(this, arguments)",
"number": 102
Expand Down Expand Up @@ -190,7 +190,7 @@
},
"filename": "file/name.py",
"function": "foo",
"in_app": false,
"library_frame": true,
"line": {
"column": 4,
"context": "line3",
Expand Down Expand Up @@ -225,7 +225,7 @@
},
"filename": "lib/instrumentation/index.js",
"function": "instrumented",
"in_app": false,
"library_frame": true,
"line": {
"context": " var result = original.apply(this, arguments)",
"number": 102
Expand Down
2 changes: 1 addition & 1 deletion docs/data/elasticsearch/span.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
},
"filename": "net.js",
"function": "onread",
"in_app": false,
"library_frame": true,
"line": {
"column": 4,
"context": "line3",
Expand Down
8 changes: 4 additions & 4 deletions docs/data/intake-api/generated/error/payload.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"line2"
],
"context_line": "line3",
"in_app": false,
"library_frame": true,
"lineno": 3,
"module": "App::MyModule",
"colno": 4,
Expand All @@ -67,7 +67,7 @@
"filename": "lib/instrumentation/index.js",
"lineno": 102,
"function": "instrumented",
"in_app": false,
"library_frame": true,
"abs_path": "/Users/watson/code/node_modules/elastic/lib/instrumentation/index.js",
"vars": {
"key": "value"
Expand Down Expand Up @@ -116,7 +116,7 @@
"line2"
],
"context_line": "line3",
"in_app": false,
"library_frame": true,
"lineno": 3,
"module": "App::MyModule",
"colno": 4,
Expand All @@ -129,7 +129,7 @@
"filename": "lib/instrumentation/index.js",
"lineno": 102,
"function": "instrumented",
"in_app": false,
"library_frame": true,
"abs_path": "/Users/watson/code/node_modules/elastic/lib/instrumentation/index.js",
"vars": {
"key": "value"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
"context_line": null,
"filename": "myfile",
"function": null,
"in_app": null,
"library_frame": null,
"lineno": 1,
"module": null,
"post_context": null,
Expand Down
2 changes: 1 addition & 1 deletion docs/data/intake-api/generated/transaction/payload.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
"abs_path": "net.js",
"filename": "net.js",
"lineno": 547,
"in_app": false,
"library_frame": true,
"vars": {
"key": "value"
},
Expand Down
2 changes: 1 addition & 1 deletion docs/spec/stacktrace_frame.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"description": "The function involved in the stack frame",
"type": ["string", "null"]
},
"in_app": {
"library_frame": {
"type": ["boolean", "null"]
},
"lineno": {
Expand Down
24 changes: 12 additions & 12 deletions model/stacktrace_frame.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ import (
)

type StacktraceFrame struct {
AbsPath *string `mapstructure:"abs_path"`
Filename string
Lineno int
Colno *int
ContextLine *string `mapstructure:"context_line"`
Module *string
Function *string
InApp *bool `mapstructure:"in_app"`
Vars common.MapStr
PreContext []string `mapstructure:"pre_context"`
PostContext []string `mapstructure:"post_context"`
AbsPath *string `mapstructure:"abs_path"`
Filename string
Lineno int
Colno *int
ContextLine *string `mapstructure:"context_line"`
Module *string
Function *string
LibraryFrame *bool `mapstructure:"library_frame"`
Vars common.MapStr
PreContext []string `mapstructure:"pre_context"`
PostContext []string `mapstructure:"post_context"`
}

type TransformStacktraceFrame func(s *StacktraceFrame) common.MapStr
Expand All @@ -30,7 +30,7 @@ func (s *StacktraceFrame) Transform() common.MapStr {
enhancer.Add(m, "module", s.Module)
enhancer.Add(m, "function", s.Function)
enhancer.Add(m, "vars", s.Vars)
enhancer.Add(m, "in_app", s.InApp)
enhancer.Add(m, "library_frame", s.LibraryFrame)

context := common.MapStr{}
enhancer.Add(context, "pre", s.PreContext)
Expand Down
36 changes: 18 additions & 18 deletions model/stacktrace_frame_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func TestStacktraceFrameTransform(t *testing.T) {
context := "context"
fct := "st function"
module := "some_module"
inApp := true
libraryFrame := true
tests := []struct {
StFrame StacktraceFrame
Output common.MapStr
Expand All @@ -33,25 +33,25 @@ func TestStacktraceFrameTransform(t *testing.T) {
},
{
StFrame: StacktraceFrame{
AbsPath: &path,
Filename: filename,
Lineno: lineno,
Colno: &colno,
ContextLine: &context,
Module: &module,
Function: &fct,
InApp: &inApp,
Vars: map[string]interface{}{"k1": "v1", "k2": "v2"},
PreContext: []string{"prec1", "prec2"},
PostContext: []string{"postc1", "postc2"},
AbsPath: &path,
Filename: filename,
Lineno: lineno,
Colno: &colno,
ContextLine: &context,
Module: &module,
Function: &fct,
LibraryFrame: &libraryFrame,
Vars: map[string]interface{}{"k1": "v1", "k2": "v2"},
PreContext: []string{"prec1", "prec2"},
PostContext: []string{"postc1", "postc2"},
},
Output: common.MapStr{
"abs_path": "~/some/abs_path",
"filename": "some file",
"function": "st function",
"module": "some_module",
"in_app": true,
"vars": common.MapStr{"k1": "v1", "k2": "v2"},
"abs_path": "~/some/abs_path",
"filename": "some file",
"function": "st function",
"module": "some_module",
"library_frame": true,
"vars": common.MapStr{"k1": "v1", "k2": "v2"},
"context": common.MapStr{
"pre": []string{"prec1", "prec2"},
"post": []string{"postc1", "postc2"},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
},
"filename": "file/name.py",
"function": "foo",
"in_app": false,
"library_frame": true,
"line": {
"column": 4,
"context": "line3",
Expand Down Expand Up @@ -158,7 +158,7 @@
},
"filename": "lib/instrumentation/index.js",
"function": "instrumented",
"in_app": false,
"library_frame": true,
"line": {
"context": " var result = original.apply(this, arguments)",
"number": 102
Expand Down Expand Up @@ -193,7 +193,7 @@
},
"filename": "file/name.py",
"function": "foo",
"in_app": false,
"library_frame": true,
"line": {
"column": 4,
"context": "line3",
Expand Down Expand Up @@ -228,7 +228,7 @@
},
"filename": "lib/instrumentation/index.js",
"function": "instrumented",
"in_app": false,
"library_frame": true,
"line": {
"context": " var result = original.apply(this, arguments)",
"number": 102
Expand Down
4 changes: 2 additions & 2 deletions processor/error/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ var errorSchema = `{
"description": "The function involved in the stack frame",
"type": ["string", "null"]
},
"in_app": {
"library_frame": {
"type": ["boolean", "null"]
},
"lineno": {
Expand Down Expand Up @@ -432,7 +432,7 @@ var errorSchema = `{
"description": "The function involved in the stack frame",
"type": ["string", "null"]
},
"in_app": {
"library_frame": {
"type": ["boolean", "null"]
},
"lineno": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,6 @@
{
"@timestamp": "2017-05-30T18:53:27.154Z",
"context": {
"service": {
"agent": {
"name": "elastic-node",
"version": "3.14.0"
},
"argv": [
"node",
"server.js"
],
"environment": "staging",
"framework": {
"name": "Express",
"version": "1.2.3"
},
"language": {
"name": "ecmascript",
"version": "8"
},
"name": "1234_service-12a3",
"pid": 1234,
"process_title": "node",
"runtime": {
"name": "node",
"version": "8.0.0"
},
"version": "5.1.3"
},
"custom": {
"and_objects": {
"foo": [
Expand Down Expand Up @@ -85,6 +58,33 @@
"headers_sent": true,
"status_code": 200
},
"service": {
"agent": {
"name": "elastic-node",
"version": "3.14.0"
},
"argv": [
"node",
"server.js"
],
"environment": "staging",
"framework": {
"name": "Express",
"version": "1.2.3"
},
"language": {
"name": "ecmascript",
"version": "8"
},
"name": "1234_service-12a3",
"pid": 1234,
"process_title": "node",
"runtime": {
"name": "node",
"version": "8.0.0"
},
"version": "5.1.3"
},
"system": {
"architecture": "x64",
"hostname": "prod1.example.com",
Expand Down Expand Up @@ -116,18 +116,18 @@
{
"@timestamp": "2017-05-30T18:53:27.154Z",
"context": {
"db": {
"instance": "customers",
"statement": "SELECT * FROM product_types WHERE user_id=?",
"type": "sql",
"user": "readonly_user"
},
"service": {
"agent": {
"name": "elastic-node",
"version": "3.14.0"
},
"name": "1234_service-12a3"
},
"db": {
"instance": "customers",
"statement": "SELECT * FROM product_types WHERE user_id=?",
"type": "sql",
"user": "readonly_user"
}
},
"processor": {
Expand Down Expand Up @@ -156,7 +156,7 @@
},
"filename": "net.js",
"function": "onread",
"in_app": false,
"library_frame": true,
"line": {
"column": 4,
"context": "line3",
Expand Down Expand Up @@ -429,18 +429,18 @@
{
"@timestamp": "2017-05-30T18:53:42.281999Z",
"context": {
"db": {
"instance": "customers",
"statement": "SELECT * FROM product_types WHERE user_id=?",
"type": "sql",
"user": "readonly_user"
},
"service": {
"agent": {
"name": "elastic-node",
"version": "3.14.0"
},
"name": "1234_service-12a3"
},
"db": {
"instance": "customers",
"statement": "SELECT * FROM product_types WHERE user_id=?",
"type": "sql",
"user": "readonly_user"
}
},
"processor": {
Expand All @@ -462,4 +462,4 @@
}
}
]
}
}
Loading