Skip to content

Commit

Permalink
Remove HAProxy zipkin check (#554)
Browse files Browse the repository at this point in the history
  • Loading branch information
black-adder authored Nov 21, 2017
1 parent e018d3e commit 3136216
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 19 deletions.
8 changes: 2 additions & 6 deletions cmd/collector/app/zipkin/annotation.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
package zipkin

import (
"strings"

"github.com/jaegertracing/jaeger/thrift-gen/zipkincore"
)

Expand All @@ -42,10 +40,8 @@ func FindServiceName(span *zipkincore.Span) string {
if endpoint == nil {
continue
}
if IsCore(anno.Value) || strings.Index(anno.Value, "haproxy.") == 0 {
if endpoint.GetServiceName() != "" {
return endpoint.GetServiceName()
}
if IsCore(anno.Value) && endpoint.GetServiceName() != "" {
return endpoint.GetServiceName()
}
}
return ""
Expand Down
9 changes: 0 additions & 9 deletions cmd/collector/app/zipkin/annotation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,6 @@ func TestFindServiceName(t *testing.T) {
span.Annotations = append(span.Annotations, anno)
assert.Equal(t, "zoidberg", FindServiceName(span), "first suitable annotation is picked")

anno = &zc.Annotation{
Value: "haproxy.Tr",
Host: &zc.Endpoint{
ServiceName: "tracegen",
},
}
span.Annotations = []*zc.Annotation{anno}
assert.Equal(t, "tracegen", FindServiceName(span), "haproxy annotations also count")

anno = &zc.Annotation{
Value: "random event",
Host: &zc.Endpoint{
Expand Down
2 changes: 1 addition & 1 deletion model/converter/thrift/jaeger/fixtures/model_01.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"vNum":53931
},
{
"key":"haproxy.sa",
"key":"someBool",
"vType":"bool",
"vNum":1
},
Expand Down
4 changes: 2 additions & 2 deletions model/converter/thrift/jaeger/fixtures/model_03.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"vNum":53931
},
{
"key":"haproxy.sa",
"key":"someBool",
"vType":"bool",
"vNum":1
},
Expand Down Expand Up @@ -121,7 +121,7 @@
"vNum":53931
},
{
"key":"haproxy.sa",
"key":"someBool",
"vType":"bool",
"vNum":1
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"vLong": 53931
},
{
"key": "haproxy.sa",
"key": "someBool",
"vType": "BOOL",
"vBool": true
},
Expand Down

0 comments on commit 3136216

Please sign in to comment.