Skip to content

Commit

Permalink
More tests for remote endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
matej-g committed Apr 7, 2021
1 parent a3ed80c commit 3b78eab
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions exporters/trace/zipkin/model_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,61 @@ func TestRemoteEndpointTransformation(t *testing.T) {
ServiceName: "peer-service-test",
},
},
{
name: "http-host-rank",
data: &export.SpanSnapshot{
SpanKind: trace.SpanKindProducer,
Attributes: []attribute.KeyValue{
semconv.HTTPHostKey.String("http-host-test"),
semconv.DBNameKey.String("db-name-test"),
},
},
want: &zkmodel.Endpoint{
ServiceName: "http-host-test",
},
},
{
name: "db-name-rank",
data: &export.SpanSnapshot{
SpanKind: trace.SpanKindProducer,
Attributes: []attribute.KeyValue{
attribute.String("foo", "bar"),
semconv.DBNameKey.String("db-name-test"),
},
},
want: &zkmodel.Endpoint{
ServiceName: "db-name-test",
},
},
{
name: "peer-hostname-rank",
data: &export.SpanSnapshot{
SpanKind: trace.SpanKindProducer,
Attributes: []attribute.KeyValue{
keyPeerHostname.String("peer-hostname-test"),
keyPeerAddress.String("peer-address-test"),
semconv.HTTPHostKey.String("http-host-test"),
semconv.DBNameKey.String("http-host-test"),
},
},
want: &zkmodel.Endpoint{
ServiceName: "peer-hostname-test",
},
},
{
name: "peer-address-rank",
data: &export.SpanSnapshot{
SpanKind: trace.SpanKindProducer,
Attributes: []attribute.KeyValue{
keyPeerAddress.String("peer-address-test"),
semconv.HTTPHostKey.String("http-host-test"),
semconv.DBNameKey.String("http-host-test"),
},
},
want: &zkmodel.Endpoint{
ServiceName: "peer-address-test",
},
},
{
name: "net-peer-invalid-ip",
data: &export.SpanSnapshot{
Expand Down

0 comments on commit 3b78eab

Please sign in to comment.