Skip to content

Commit

Permalink
Make transaction.name optional. (elastic#554)
Browse files Browse the repository at this point in the history
Remove attribute from minimal testfiles.
implements elastic#425
  • Loading branch information
simitt committed Jan 29, 2018
1 parent a9c2bf7 commit 4c07603
Show file tree
Hide file tree
Showing 53 changed files with 19 additions and 80 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ https://github.com/elastic/apm-server/compare/71df0d96445df35afe27f38bcf734a0828
- Increase default 'ConcurrentRequests' from 20 to 40 {pull}492[492]
- Change config option `frontend.sourcemapping.index` to `frontend.source_mapping.index_pattern` and remove adding a '*' by default.{pull}492[492].
- Add Config option for excluding stack trace frames from `grouping_key` calculation {pull}482[482]
- Expose expvar {pull}509[509]
- Add `process.ppid` as optional field {pull}564[564]
- Change `error.culprit` after successfully applying sourcemapping {pull}520[520]
- Make `transaction.name` optional {pull}554[554]

==== Deprecated

Expand Down
1 change: 0 additions & 1 deletion docs/data/intake-api/generated/transaction/frontend.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
{
"id": "611f4fa9-50f0-4631-9306-43399c0dc3db",
"timestamp": "2017-12-08T12:52:53.681Z",
"name": "Unknown",
"type": "page-load",
"duration": 643,
"spans": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@
"transactions": [
{
"id": "945254c5-67a5-417e-8a4e-aa29efcbfb79",
"name": "GET /api/types",
"type": "request",
"duration": 32.592981,
"timestamp": "2017-05-09T15:04:05.999999Z"
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"transactions": [
{
"id": "945254c5-67a5-417e-8a4e-aa29efcbfb79",
"name": "GET /api/types",
"type": "request",
"duration": 32.592981,
"timestamp": "2017-05-30T18:53:27.154Z"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@
"transactions": [
{
"id": "945254c5-67a5-417e-8a4e-aa29efcbfb79",
"name": "GET /api/types",
"type": "request",
"duration": 32.592981,
"timestamp": "2017-05-30T18:53:27.154Z"
}
]
}
}
3 changes: 1 addition & 2 deletions docs/data/intake-api/generated/transaction/minimal_span.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"transactions": [
{
"id": "945254c5-67a5-417e-8a4e-aa29efcbfb79",
"name": "GET /api/types",
"type": "request",
"duration": 32.592981,
"timestamp": "2017-05-30T18:53:27.154Z",
Expand All @@ -23,4 +22,4 @@
]
}
]
}
}
4 changes: 0 additions & 4 deletions docs/data/intake-api/generated/transaction/null_values.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"transactions": [
{
"id": "945254c5-67a5-417e-8a4e-aa29efcbfb79",
"name": "GET /api/types",
"type": "request",
"duration": 32.592981,
"timestamp": "2017-05-30T18:53:27.154Z",
Expand All @@ -38,7 +37,6 @@
},
{
"id": "85925e55-b43f-4340-a8e0-df1906ecbf78",
"name": "GET /api/types",
"type": "request",
"duration": 13.980558,
"timestamp": "2017-05-30T18:53:42Z",
Expand All @@ -54,7 +52,6 @@
},
{
"id": "85925e55-b43f-4340-a8e0-df1906ecbfa9",
"name": "GET /api/types",
"type": "request",
"duration": 13.980558,
"timestamp": "2017-05-30T18:53:42.281999Z",
Expand Down Expand Up @@ -98,7 +95,6 @@
},
{
"id": "85925e55-b43f-4340-a8e0-df1906ecbf7a",
"name": "GET /api/types",
"type": "request",
"duration": 13.980558,
"timestamp": "2017-05-30T18:53:42.281Z",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"transactions": [
{
"id": "945254c5-67a5-417e-8a4e-aa29efcbfb79",
"name": "GET /api/types",
"type": "request",
"duration": 32.592981,
"timestamp": "2017-05-09T15:04:05.999999Z",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"transactions": [
{
"id": "945254c5-67a5-417e-8a4e-aa29efcbfb79",
"name": "GET /api/types",
"type": "request",
"duration": 32.592981,
"timestamp": "2017-05-09T15:04:05.999999Z",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@
"transactions": [
{
"id": "945254c5-67a5-417e-8a4e-aa29efcbfb79",
"name": "GET /api/types",
"type": "request",
"duration": 32.592981,
"start": 24.01,
"timestamp": "2017-05-09T15:04:05.999999Z",
"spans": []
}
]
}
}
4 changes: 2 additions & 2 deletions docs/spec/transactions/transaction.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"name": {
"type": "string",
"type": ["string","null"],
"description": "Generic designation of a transaction in the scope of a single service (eg: 'GET /users/:id')",
"maxLength": 1024
},
Expand Down Expand Up @@ -75,5 +75,5 @@
}
}
},
"required": ["id", "name", "duration", "type", "timestamp"]
"required": ["id", "duration", "type", "timestamp"]
}
2 changes: 1 addition & 1 deletion processor/transaction/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

type Event struct {
Id string
Name string
Name *string
Type string
Result *string
Duration float64
Expand Down
4 changes: 2 additions & 2 deletions processor/transaction/event_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ func TestEventTransform(t *testing.T) {
result := "tx result"
sampled := false
dropped := 5
name := "mytransaction"

tests := []struct {
Event Event
Expand All @@ -28,7 +29,6 @@ func TestEventTransform(t *testing.T) {
Event: Event{},
Output: common.MapStr{
"id": "",
"name": "",
"type": "",
"duration": common.MapStr{"us": 0},
"sampled": true,
Expand All @@ -38,7 +38,7 @@ func TestEventTransform(t *testing.T) {
{
Event: Event{
Id: id,
Name: "mytransaction",
Name: &name,
Type: "tx",
Result: &result,
Timestamp: time.Now(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"us": 32592
},
"id": "945254c5-67a5-417e-8a4e-aa29efcbfb79",
"name": "GET /api/types",
"sampled": true,
"type": "request"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"us": 32592
},
"id": "945254c5-67a5-417e-8a4e-aa29efcbfb79",
"name": "GET /api/types",
"sampled": true,
"type": "request"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"us": 32592
},
"id": "945254c5-67a5-417e-8a4e-aa29efcbfb79",
"name": "GET /api/types",
"sampled": true,
"type": "request"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
"us": 643000
},
"id": "611f4fa9-50f0-4631-9306-43399c0dc3db",
"name": "Unknown",
"sampled": true,
"type": "page-load"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"us": 32592
},
"id": "945254c5-67a5-417e-8a4e-aa29efcbfb79",
"name": "GET /api/types",
"sampled": true,
"type": "request"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"us": 32592
},
"id": "945254c5-67a5-417e-8a4e-aa29efcbfb79",
"name": "GET /api/types",
"sampled": true,
"type": "request"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
"us": 32592
},
"id": "945254c5-67a5-417e-8a4e-aa29efcbfb79",
"name": "GET /api/types",
"sampled": true,
"type": "request"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"us": 32592
},
"id": "945254c5-67a5-417e-8a4e-aa29efcbfb79",
"name": "GET /api/types",
"sampled": true,
"type": "request"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"us": 32592
},
"id": "945254c5-67a5-417e-8a4e-aa29efcbfb79",
"name": "GET /api/types",
"result": "200",
"sampled": true,
"type": "request"
Expand Down Expand Up @@ -59,7 +58,6 @@
"us": 13980
},
"id": "85925e55-b43f-4340-a8e0-df1906ecbf78",
"name": "GET /api/types",
"sampled": true,
"type": "request"
}
Expand Down Expand Up @@ -119,7 +117,6 @@
"us": 13980
},
"id": "85925e55-b43f-4340-a8e0-df1906ecbfa9",
"name": "GET /api/types",
"sampled": true,
"type": "request"
}
Expand Down Expand Up @@ -179,7 +176,6 @@
"us": 13980
},
"id": "85925e55-b43f-4340-a8e0-df1906ecbf7a",
"name": "GET /api/types",
"sampled": true,
"type": "request"
}
Expand Down
3 changes: 0 additions & 3 deletions processor/transaction/payload_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ func TestPayloadTransform(t *testing.T) {
"transaction": common.MapStr{
"duration": common.MapStr{"us": 0},
"id": "",
"name": "",
"type": "",
"sampled": true,
},
Expand All @@ -55,7 +54,6 @@ func TestPayloadTransform(t *testing.T) {
"transaction": common.MapStr{
"duration": common.MapStr{"us": 0},
"id": "",
"name": "",
"type": "",
"sampled": true,
},
Expand All @@ -80,7 +78,6 @@ func TestPayloadTransform(t *testing.T) {
"transaction": common.MapStr{
"duration": common.MapStr{"us": 0},
"id": "",
"name": "",
"type": "",
"sampled": true,
},
Expand Down
4 changes: 2 additions & 2 deletions processor/transaction/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ var transactionSchema = `{
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
},
"name": {
"type": "string",
"type": ["string","null"],
"description": "Generic designation of a transaction in the scope of a single service (eg: 'GET /users/:id')",
"maxLength": 1024
},
Expand Down Expand Up @@ -539,7 +539,7 @@ var transactionSchema = `{
}
}
},
"required": ["id", "name", "duration", "type", "timestamp"]
"required": ["id", "duration", "type", "timestamp"]
},
"minItems": 1
}
Expand Down
1 change: 0 additions & 1 deletion tests/data/invalid/transaction/invalid_id.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"id": "85925e55-b483f-7340-a8e0-df1906ecbfa9",
"name": "GET /api/types",
"type": "request",
"duration": 1.0,
"timestamp": "2017-05-30T18:53:27.154Z",
Expand Down
1 change: 0 additions & 1 deletion tests/data/invalid/transaction/invalid_mark_asterisk.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"id": "85915e55-b43f-4340-a8e0-df1906ecbfa9",
"name": "GET /api/types",
"type": "request",
"duration": 1.0,
"timestamp": "2017-05-30T18:53:27.154Z",
Expand Down
1 change: 0 additions & 1 deletion tests/data/invalid/transaction/invalid_mark_dot.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"id": "85915e55-b43f-4340-a8e0-df1906ecbfa9",
"name": "GET /api/types",
"type": "request",
"duration": 1.0,
"timestamp": "2017-05-30T18:53:27.154Z",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"id": "85915e55-b43f-4340-a8e0-df1906ecbfa9",
"name": "GET /api/types",
"type": "request",
"duration": 1.0,
"timestamp": "2017-05-30T18:53:27.154Z",
Expand Down
1 change: 0 additions & 1 deletion tests/data/invalid/transaction/invalid_mark_group_dot.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"id": "85915e55-b43f-4340-a8e0-df1906ecbfa9",
"name": "GET /api/types",
"type": "request",
"duration": 1.0,
"timestamp": "2017-05-30T18:53:27.154Z",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"id": "85915e55-b43f-4340-a8e0-df1906ecbfa9",
"name": "GET /api/types",
"type": "request",
"duration": 1.0,
"timestamp": "2017-05-30T18:53:27.154Z",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"id": "85915e55-b43f-4340-a8e0-df1906ecbfa9",
"name": "GET /api/types",
"type": "request",
"duration": 1.0,
"timestamp": "2017-05-30T18:53:27.154Z",
Expand Down
1 change: 0 additions & 1 deletion tests/data/invalid/transaction/invalid_mark_quote.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"id": "85915e55-b43f-4340-a8e0-df1906ecbfa9",
"name": "GET /api/types",
"type": "request",
"duration": 1.0,
"timestamp": "2017-05-30T18:53:27.154Z",
Expand Down
1 change: 0 additions & 1 deletion tests/data/invalid/transaction/invalid_mark_type.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"id": "85915e55-b43f-4340-a8e0-df1906ecbfa9",
"name": "GET /api/types",
"type": "request",
"duration": 1.0,
"timestamp": "2017-05-30T18:53:27.154Z",
Expand Down
1 change: 0 additions & 1 deletion tests/data/invalid/transaction/invalid_timestamp.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"id": "85915e55-b43f-4340-a8e0-df1906ecbfa9",
"name": "GET /api/types",
"type": "request",
"duration": 2.0,
"timestamp": "2017-05-30T18:53Z",
Expand Down
1 change: 0 additions & 1 deletion tests/data/invalid/transaction/invalid_timestamp2.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

{
"id": "85915e55-b43f-4340-a8e0-df1906ecbfa9",
"name": "GET /api/types",
"type": "request",
"duration": 2.0,
"timestamp": "2017-05-30T18:53:27.000+00:20",
Expand Down
Loading

0 comments on commit 4c07603

Please sign in to comment.