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

Support for Zipkin Protobuf spans over HTTP #1695

Merged
merged 35 commits into from
Aug 16, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
9c9f4b2
WIP handle if block to handle zipkin proto v2
jan25 Jul 25, 2019
387049f
update deps
jan25 Jul 25, 2019
21c149b
WIP add proto to thrift convertor
jan25 Jul 25, 2019
3697be3
fix converter
jan25 Jul 25, 2019
993791c
wrap protoV2 to Thrift span convderter
jan25 Jul 26, 2019
ab51207
refactor http-handler for json and proto content type
jan25 Jul 26, 2019
df948d1
fix spanV2 tests
jan25 Jul 26, 2019
b42bd79
generate zipkin proto models
jan25 Jul 30, 2019
f949e74
convert proto spans to thrift
jan25 Jul 30, 2019
15f6434
remove zipkin-go dep
jan25 Jul 31, 2019
5bcfb2f
add fixture test
jan25 Aug 3, 2019
a04e8ba
refactor: detach fns from api handler
jan25 Aug 4, 2019
9252d9c
improve tests WIP
jan25 Aug 7, 2019
367fe5c
fix main fixture test
jan25 Aug 7, 2019
11901e4
add ids consts
jan25 Aug 7, 2019
65e9fe7
fix trace id high
jan25 Aug 7, 2019
23e5575
fix static checks
jan25 Aug 7, 2019
0c5d060
add http-handler tests for proto spans
jan25 Aug 8, 2019
b8bd828
rename zmodel->zipkinProto
jan25 Aug 8, 2019
397abc9
minor refactor
jan25 Aug 8, 2019
e032c40
fix static checks in CI
jan25 Aug 8, 2019
91acf48
go fmt
jan25 Aug 8, 2019
53b9b52
Merge branch 'master' into add-http-proto
jan25 Aug 10, 2019
933d373
Merge branch 'master' into add-http-proto
yurishkuro Aug 10, 2019
02a32cd
make fmt
Aug 10, 2019
68b2f34
bump idl with zipkin proto
jan25 Aug 10, 2019
9662b37
rebase idl fork to get zipkin.proto
jan25 Aug 10, 2019
df1d225
tests for proto span kind
jan25 Aug 10, 2019
8bf5cf8
rename zmodel->zipkinProto
jan25 Aug 10, 2019
8f5a824
Merge branch 'master' into add-http-proto
jan25 Aug 10, 2019
fdded94
add xdock proto
jan25 Aug 12, 2019
614a90c
minor: better error strs
jan25 Aug 12, 2019
380eeff
typo
jan25 Aug 13, 2019
de23c73
Merge branch 'master' into add-http-proto
jan25 Aug 15, 2019
e5168bb
rename zipkin-brave-proto-v2 -> zipkin-brave-proto
jan25 Aug 15, 2019
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
Prev Previous commit
Next Next commit
refactor: detach fns from api handler
Signed-off-by: Abhilash Gnan <abhilashgnan@gmail.com>
  • Loading branch information
jan25 committed Aug 4, 2019
commit a04e8ba1131a63e1b09599490ba694f4b35c20ac
10 changes: 5 additions & 5 deletions cmd/collector/app/zipkin/http_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ func (aH *APIHandler) saveSpansV2(w http.ResponseWriter, r *http.Request) {
var tSpans []*zipkincore.Span
switch contentType {
case "application/json":
tSpans, err = aH.jsonToThriftSpansV2(bodyBytes)
tSpans, err = jsonToThriftSpansV2(bodyBytes, aH.zipkinV2Formats)
case "application/x-protobuf":
tSpans, err = aH.protoToThriftSpansV2(bodyBytes)
tSpans, err = protoToThriftSpansV2(bodyBytes)
default:
http.Error(w, "Unsupported Content-Type", http.StatusBadRequest)
return
Expand All @@ -160,12 +160,12 @@ func (aH *APIHandler) saveSpansV2(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(operations.PostSpansAcceptedCode)
}

func (aH *APIHandler) jsonToThriftSpansV2(bodyBytes []byte) ([]*zipkincore.Span, error) {
func jsonToThriftSpansV2(bodyBytes []byte, zipkinV2Formats strfmt.Registry) ([]*zipkincore.Span, error) {
var spans models.ListOfSpans
if err := swag.ReadJSON(bodyBytes, &spans); err != nil {
return nil, err
}
if err := spans.Validate(aH.zipkinV2Formats); err != nil {
if err := spans.Validate(zipkinV2Formats); err != nil {
return nil, err
}

Expand All @@ -176,7 +176,7 @@ func (aH *APIHandler) jsonToThriftSpansV2(bodyBytes []byte) ([]*zipkincore.Span,
return tSpans, nil
}

func (aH *APIHandler) protoToThriftSpansV2(bodyBytes []byte) ([]*zipkincore.Span, error) {
func protoToThriftSpansV2(bodyBytes []byte) ([]*zipkincore.Span, error) {
var spans zmodel.ListOfSpans
if err := proto.Unmarshal(bodyBytes, &spans); err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion cmd/collector/app/zipkin/protov2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ func mockListOfSpans() zmodel.ListOfSpans {
ParentId: pid,
Name: "foo",
Debug: true,
Duration: d,
Timestamp: ts,
Duration: d,
LocalEndpoint: &zmodel.Endpoint{
ServiceName: "bar",
Ipv4: ipv4,
Expand Down