Skip to content

Commit

Permalink
implemented support for incomplete spans
Browse files Browse the repository at this point in the history
- span types have a new attribute incomplete
- spans without given incomplete attribute will default to false
- backwards compatible with old clients
- breaking change for es and cassandra schemas
- generated thrift types are up to date in this pr
- detailled concept described in jaegertracing#729
- based on pull request jaegertracing#728

Signed-off-by: Martin Foerster <martin@atroo.de>
  • Loading branch information
phal0r committed Jul 30, 2018
1 parent f6d115a commit baccbe4
Show file tree
Hide file tree
Showing 15 changed files with 130 additions and 23 deletions.
2 changes: 1 addition & 1 deletion jaeger-ui
Submodule jaeger-ui updated 93 files
+4 −4 .flowconfig
+0 −27 CHANGELOG.md
+0 −21 config-overrides-ant-variables.less
+0 −33 config-overrides.js
+9 −13 package.json
+103 −0 src/components/App/App.css
+10 −4 src/components/App/NotFound.js
+5 −8 src/components/App/Page.css
+5 −12 src/components/App/Page.js
+12 −11 src/components/App/TopNav.css
+52 −56 src/components/App/TopNav.js
+19 −9 src/components/App/TopNav.test.js
+0 −19 src/components/App/TraceIDSearchInput.css
+23 −26 src/components/App/TraceIDSearchInput.js
+3 −2 src/components/App/index.js
+0 −9 src/components/DependencyGraph/DependencyGraph.css
+48 −29 src/components/DependencyGraph/index.js
+13 −9 src/components/DependencyGraph/index.test.js
+82 −0 src/components/SearchTracePage/SearchDropdownInput.js
+71 −0 src/components/SearchTracePage/SearchDropdownInput.test.js
+0 −44 src/components/SearchTracePage/SearchForm.css
+0 −49 src/components/SearchTracePage/SearchResults/ResultItem.css
+0 −91 src/components/SearchTracePage/SearchResults/ResultItem.js
+0 −16 src/components/SearchTracePage/SearchResults/ResultItem.markers.js
+0 −35 src/components/SearchTracePage/SearchResults/index.css
+0 −127 src/components/SearchTracePage/SearchResults/index.js
+0 −16 src/components/SearchTracePage/SearchResults/index.markers.js
+0 −59 src/components/SearchTracePage/SearchResults/index.test.js
+0 −1 src/components/SearchTracePage/SearchResults/react-vis.css
+0 −0 src/components/SearchTracePage/TraceResultsScatterPlot.css
+9 −9 src/components/SearchTracePage/TraceResultsScatterPlot.js
+3 −3 src/components/SearchTracePage/TraceResultsScatterPlot.test.js
+8 −6 src/components/SearchTracePage/TraceSearchForm.css
+138 −185 src/components/SearchTracePage/TraceSearchForm.js
+20 −35 src/components/SearchTracePage/TraceSearchForm.test.js
+12 −8 src/components/SearchTracePage/TraceSearchResult.css
+83 −0 src/components/SearchTracePage/TraceSearchResult.js
+10 −12 src/components/SearchTracePage/TraceSearchResult.test.js
+14 −17 src/components/SearchTracePage/TraceServiceTag.js
+18 −2 src/components/SearchTracePage/TraceServiceTag.test.js
+0 −38 src/components/SearchTracePage/index.css
+126 −50 src/components/SearchTracePage/index.js
+33 −6 src/components/SearchTracePage/index.test.js
+1 −0 src/components/SearchTracePage/react-vis.css
+1 −7 src/components/TracePage/KeyboardShortcutsHelp.css
+32 −43 src/components/TracePage/KeyboardShortcutsHelp.js
+2 −2 src/components/TracePage/SpanGraph/TickLabels.css
+2 −2 src/components/TracePage/SpanGraph/index.js
+0 −33 src/components/TracePage/TracePageHeader.css
+69 −86 src/components/TracePage/TracePageHeader.js
+0 −16 src/components/TracePage/TracePageHeader.markers.js
+5 −6 src/components/TracePage/TracePageHeader.test.js
+3 −8 src/components/TracePage/TraceTimelineViewer/SpanBar.css
+7 −63 src/components/TracePage/TraceTimelineViewer/SpanBarRow.css
+5 −7 src/components/TracePage/TraceTimelineViewer/SpanBarRow.js
+15 −17 src/components/TracePage/TraceTimelineViewer/SpanDetail/AccordianKeyValues.css
+11 −10 src/components/TracePage/TraceTimelineViewer/SpanDetail/AccordianKeyValues.js
+0 −16 src/components/TracePage/TraceTimelineViewer/SpanDetail/AccordianKeyValues.markers.js
+2 −3 src/components/TracePage/TraceTimelineViewer/SpanDetail/AccordianKeyValues.test.js
+4 −19 src/components/TracePage/TraceTimelineViewer/SpanDetail/AccordianLogs.css
+7 −11 src/components/TracePage/TraceTimelineViewer/SpanDetail/AccordianLogs.js
+7 −12 src/components/TracePage/TraceTimelineViewer/SpanDetail/KeyValuesTable.css
+2 −2 src/components/TracePage/TraceTimelineViewer/SpanDetail/KeyValuesTable.js
+0 −4 src/components/TracePage/TraceTimelineViewer/SpanDetail/index.css
+19 −24 src/components/TracePage/TraceTimelineViewer/SpanDetail/index.js
+17 −12 src/components/TracePage/TraceTimelineViewer/SpanDetail/index.test.js
+5 −7 src/components/TracePage/TraceTimelineViewer/SpanDetailRow.css
+1 −1 src/components/TracePage/TraceTimelineViewer/SpanDetailRow.js
+10 −5 src/components/TracePage/TraceTimelineViewer/SpanTreeOffset.css
+7 −7 src/components/TracePage/TraceTimelineViewer/SpanTreeOffset.js
+4 −8 src/components/TracePage/TraceTimelineViewer/Ticks.css
+4 −4 src/components/TracePage/TraceTimelineViewer/TimelineHeaderRow/TimelineHeaderRow.css
+1 −1 src/components/TracePage/TraceTimelineViewer/TimelineRow.js
+3 −3 src/components/TracePage/TraceTimelineViewer/VirtualizedTraceView.css
+3 −3 src/components/TracePage/TraceTimelineViewer/VirtualizedTraceView.js
+20 −1 src/components/TracePage/TraceTimelineViewer/index.css
+2 −1 src/components/TracePage/TraceTimelineViewer/index.js
+13 −2 src/components/TracePage/index.css
+25 −8 src/components/TracePage/index.js
+4 −5 src/components/TracePage/index.test.js
+2 −6 src/components/common/ErrorMessage.css
+11 −16 src/components/common/ErrorMessage.js
+0 −53 src/components/common/LabeledList.js
+0 −56 src/components/common/VirtSelect.css
+0 −93 src/components/common/VirtSelect.js
+0 −73 src/components/common/utils.css
+10 −8 src/index.js
+3 −3 src/reducers/services.js
+0 −22 src/utils/date.js
+0 −35 src/utils/redux-form-field-adapter.js
+5 −1 src/utils/sort.js
+5 −4 src/utils/sort.test.js
+855 −1,627 yarn.lock
15 changes: 10 additions & 5 deletions model/converter/json/fixtures/ui_01.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
}
],
"processID": "p1",
"warnings": null
"warnings": null,
"incomplete": false
},
{
"traceID": "1",
Expand Down Expand Up @@ -70,7 +71,8 @@
],
"logs": [],
"processID": "p1",
"warnings": null
"warnings": null,
"incomplete": false
},
{
"traceID": "1",
Expand All @@ -88,7 +90,8 @@
"tags": [],
"logs": [],
"processID": "p2",
"warnings": null
"warnings": null,
"incomplete": false
},
{
"traceID": "1",
Expand Down Expand Up @@ -118,7 +121,8 @@
"processID": "p2",
"warnings": [
"some span warning"
]
],
"incomplete": false
},
{
"traceID": "1",
Expand All @@ -138,7 +142,8 @@
"processID": "p2",
"warnings": [
"some span warning"
]
],
"incomplete": false
}
],
"processes": {
Expand Down
1 change: 1 addition & 0 deletions model/converter/json/from_domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ func (fd fromDomain) convertSpanInternal(span *model.Span) json.Span {
Duration: model.DurationAsMicroseconds(span.Duration),
Tags: fd.convertKeyValuesFunc(span.Tags),
Logs: fd.convertLogs(span.Logs),
Incomplete: span.Incomplete,
}
}

Expand Down
1 change: 1 addition & 0 deletions model/converter/json/to_domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ func (td toDomain) spanToDomain(dbSpan *json.Span) (*model.Span, error) {
Tags: tags,
Logs: logs,
Process: process,
Incomplete: dbSpan.Incomplete,
}
return span, nil
}
Expand Down
21 changes: 20 additions & 1 deletion model/converter/thrift/jaeger/fixtures/model_02.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,24 @@
"process":{
"serviceName":"api"
}
},
{
"traceID":"52969a8955571a3f",
"spanID":"647d98",
"parentSpanID":"68c4e3",
"operationName":"get",
"startTime":"2017-01-26T16:46:31.639875-05:00",
"duration":22938000,
"tags":[
{
"key":"peer.service",
"vType":"binary",
"vBlob":"AAAAAAAAMDk="
}
],
"process":{
"serviceName":"api"
},
"incomplete": true
}
]
]
16 changes: 16 additions & 0 deletions model/converter/thrift/jaeger/fixtures/thrift_batch_02.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,22 @@
"vBinary": "AAAAAAAAMDk="
}
]
},
{
"traceIdLow": 5951113872249657919,
"spanId": 6585752,
"parentSpanId": 6866147,
"operationName": "get",
"startTime": 1485467191639875,
"duration": 22938,
"tags": [
{
"key": "peer.service",
"vType": "BINARY",
"vBinary": "AAAAAAAAMDk="
}
],
"incomplete": true
}
]
}
1 change: 1 addition & 0 deletions model/converter/thrift/jaeger/from_domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ func (d domainToJaegerTransformer) transformSpan(span *model.Span) *jaeger.Span
Duration: int64(model.DurationAsMicroseconds(span.Duration)),
Tags: tags,
Logs: logs,
Incomplete: &span.Incomplete,
}
return jaegerSpan
}
8 changes: 8 additions & 0 deletions model/converter/thrift/jaeger/to_domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,17 @@ func (td toDomain) transformSpan(jSpan *jaeger.Span, mProcess *model.Process) *m
Tags: tags,
Logs: td.getLogs(jSpan.Logs),
Process: mProcess,
Incomplete: td.checkIncomplete(jSpan.Incomplete),
}
}

func (td toDomain) checkIncomplete(incomplete *bool) bool {
if incomplete == nil {
return false
}
return *incomplete
}

func (td toDomain) getReferences(jRefs []*jaeger.SpanRef) []model.SpanRef {
if len(jRefs) == 0 {
return nil
Expand Down
1 change: 1 addition & 0 deletions model/converter/thrift/zipkin/to_domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ func (td toDomain) transformSpan(zSpan *zipkincore.Span) []*model.Span {
Duration: model.MicrosecondsAsDuration(uint64(zSpan.GetDuration())),
Tags: tags,
Logs: td.getLogs(zSpan.Annotations),
Incomplete: false,
}}

cs := td.findAnnotation(zSpan, zipkincore.CLIENT_SEND)
Expand Down
9 changes: 6 additions & 3 deletions model/json/fixture.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"tags": null,
"logs": null,
"processID": "p1",
"warnings": null
"warnings": null,
"incomplete": false
},
{
"traceID": "abc0",
Expand Down Expand Up @@ -61,7 +62,8 @@
}
],
"processID": "p2",
"warnings": null
"warnings": null,
"incomplete": false
},
{
"traceID": "abc0",
Expand All @@ -79,7 +81,8 @@
"tags": null,
"logs": null,
"processID": "p2",
"warnings": null
"warnings": null,
"incomplete": false
}
],
"processes": {
Expand Down
1 change: 1 addition & 0 deletions model/json/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ type Span struct {
ProcessID ProcessID `json:"processID"`
Process *Process `json:"process,omitempty"`
Warnings []string `json:"warnings"`
Incomplete bool `json:"incomplete"`
}

// Reference is a reference from one span to another
Expand Down
1 change: 1 addition & 0 deletions model/span.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ type Span struct {
Logs []Log `json:"logs,omitempty"`
Process *Process `json:"process"`
Warnings []string `json:"warnings,omitempty"`
Incomplete bool `json:"incomplete"`
}

// Hash implements Hash from Hashable.
Expand Down
27 changes: 14 additions & 13 deletions plugin/storage/cassandra/schema/v001.cql.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,12 @@ CREATE TABLE IF NOT EXISTS ${keyspace}.traces (
logs list<frozen<log>>,
refs list<frozen<span_ref>>,
process frozen<process>,
incomplete boolean,
PRIMARY KEY (trace_id, span_id, span_hash)
)
WITH compaction = {
'compaction_window_size': '1',
'compaction_window_unit': 'HOURS',
'compaction_window_size': '1',
'compaction_window_unit': 'HOURS',
'class': 'org.apache.cassandra.db.compaction.TimeWindowCompactionStrategy'
}
AND dclocal_read_repair_chance = 0.0
Expand All @@ -83,7 +84,7 @@ CREATE TABLE IF NOT EXISTS ${keyspace}.service_names (
WITH compaction = {
'min_threshold': '4',
'max_threshold': '32',
'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy'
'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy'
}
AND dclocal_read_repair_chance = 0.0
AND default_time_to_live = ${trace_ttl}
Expand Down Expand Up @@ -114,8 +115,8 @@ CREATE TABLE IF NOT EXISTS ${keyspace}.service_operation_index (
PRIMARY KEY ((service_name, operation_name), start_time)
) WITH CLUSTERING ORDER BY (start_time DESC)
AND compaction = {
'compaction_window_size': '1',
'compaction_window_unit': 'HOURS',
'compaction_window_size': '1',
'compaction_window_unit': 'HOURS',
'class': 'org.apache.cassandra.db.compaction.TimeWindowCompactionStrategy'
}
AND dclocal_read_repair_chance = 0.0
Expand All @@ -131,8 +132,8 @@ CREATE TABLE IF NOT EXISTS ${keyspace}.service_name_index (
PRIMARY KEY ((service_name, bucket), start_time)
) WITH CLUSTERING ORDER BY (start_time DESC)
AND compaction = {
'compaction_window_size': '1',
'compaction_window_unit': 'HOURS',
'compaction_window_size': '1',
'compaction_window_unit': 'HOURS',
'class': 'org.apache.cassandra.db.compaction.TimeWindowCompactionStrategy'
}
AND dclocal_read_repair_chance = 0.0
Expand All @@ -150,8 +151,8 @@ CREATE TABLE IF NOT EXISTS ${keyspace}.duration_index (
PRIMARY KEY ((service_name, operation_name, bucket), duration, start_time, trace_id)
) WITH CLUSTERING ORDER BY (duration DESC, start_time DESC)
AND compaction = {
'compaction_window_size': '1',
'compaction_window_unit': 'HOURS',
'compaction_window_size': '1',
'compaction_window_unit': 'HOURS',
'class': 'org.apache.cassandra.db.compaction.TimeWindowCompactionStrategy'
}
AND dclocal_read_repair_chance = 0.0
Expand All @@ -172,8 +173,8 @@ CREATE TABLE IF NOT EXISTS ${keyspace}.tag_index (
)
WITH CLUSTERING ORDER BY (start_time DESC)
AND compaction = {
'compaction_window_size': '1',
'compaction_window_unit': 'HOURS',
'compaction_window_size': '1',
'compaction_window_unit': 'HOURS',
'class': 'org.apache.cassandra.db.compaction.TimeWindowCompactionStrategy'
}
AND dclocal_read_repair_chance = 0.0
Expand Down Expand Up @@ -202,6 +203,6 @@ CREATE TABLE IF NOT EXISTS ${keyspace}.dependencies (
}
AND default_time_to_live = ${dependencies_ttl};

CREATE CUSTOM INDEX ON ${keyspace}.dependencies (ts_index)
USING 'org.apache.cassandra.index.sasi.SASIIndex'
CREATE CUSTOM INDEX ON ${keyspace}.dependencies (ts_index)
USING 'org.apache.cassandra.index.sasi.SASIIndex'
WITH OPTIONS = {'mode': 'SPARSE'};
3 changes: 3 additions & 0 deletions plugin/storage/es/spanstore/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ var (
"flags":{
"type":"integer"
},
"incomplete":{
"type":"boolean"
},
"logs":{
"properties":{
"timestamp":{
Expand Down
46 changes: 46 additions & 0 deletions thrift-gen/jaeger/ttypes.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit baccbe4

Please sign in to comment.