Skip to content

Commit

Permalink
Add missing rank tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pellared committed Dec 22, 2023
1 parent 5429c66 commit 5b45512
Showing 1 changed file with 27 additions and 13 deletions.
40 changes: 27 additions & 13 deletions exporters/zipkin/model_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1091,12 +1091,12 @@ func TestRemoteEndpointTransformation(t *testing.T) {
want: nil,
},
{
name: "peer-service-rank",
name: "peer.service-rank",
data: tracetest.SpanStub{
SpanKind: trace.SpanKindProducer,
Attributes: []attribute.KeyValue{
semconv.PeerService("peer-service-test"),
semconv.ServerAddress("peer-name-test"),
semconv.ServerAddress("server-address-test"),
semconv.NetworkPeerAddress("10.1.2.80"),
},
},
Expand All @@ -1105,33 +1105,34 @@ func TestRemoteEndpointTransformation(t *testing.T) {
},
},
{
name: "network-peer-rank",
name: "server.address-rank",
data: tracetest.SpanStub{
SpanKind: trace.SpanKindProducer,
Attributes: []attribute.KeyValue{
semconv.ServerAddress("server-address-test"),
semconv.NetworkPeerAddress("10.1.2.80"),
semconv.DBName("db-name-test"),
},
},
want: &zkmodel.Endpoint{
IPv4: net.ParseIP("10.1.2.80"),
ServiceName: "server-address-test",
},
},
{
name: "db-name-rank",
name: "network.peer.address-rank",
data: tracetest.SpanStub{
SpanKind: trace.SpanKindProducer,
Attributes: []attribute.KeyValue{
attribute.String("foo", "bar"),
keyPeerHostname.String("peer-hostname-test"),
semconv.NetworkPeerAddress("10.1.2.80"),
semconv.DBName("db-name-test"),
},
},
want: &zkmodel.Endpoint{
ServiceName: "db-name-test",
IPv4: net.ParseIP("10.1.2.80"),
},
},
{
name: "peer-hostname-rank",
name: "peer.hostname-rank",
data: tracetest.SpanStub{
SpanKind: trace.SpanKindProducer,
Attributes: []attribute.KeyValue{
Expand All @@ -1145,7 +1146,7 @@ func TestRemoteEndpointTransformation(t *testing.T) {
},
},
{
name: "peer-address-rank",
name: "peer.address-rank",
data: tracetest.SpanStub{
SpanKind: trace.SpanKindProducer,
Attributes: []attribute.KeyValue{
Expand All @@ -1158,7 +1159,20 @@ func TestRemoteEndpointTransformation(t *testing.T) {
},
},
{
name: "net-peer-invalid-ip",
name: "db.name-rank",
data: tracetest.SpanStub{
SpanKind: trace.SpanKindProducer,
Attributes: []attribute.KeyValue{
attribute.String("foo", "bar"),
semconv.DBName("db-name-test"),
},
},
want: &zkmodel.Endpoint{
ServiceName: "db-name-test",
},
},
{
name: "network.peer.address-invalid-ip",
data: tracetest.SpanStub{
SpanKind: trace.SpanKindProducer,
Attributes: []attribute.KeyValue{
Expand All @@ -1168,7 +1182,7 @@ func TestRemoteEndpointTransformation(t *testing.T) {
want: nil,
},
{
name: "net-peer-ipv6-no-port",
name: "network.peer.address-ipv6-no-port",
data: tracetest.SpanStub{
SpanKind: trace.SpanKindProducer,
Attributes: []attribute.KeyValue{
Expand All @@ -1180,7 +1194,7 @@ func TestRemoteEndpointTransformation(t *testing.T) {
},
},
{
name: "net-peer-ipv4-port",
name: "network.peer.address-ipv4-port",
data: tracetest.SpanStub{
SpanKind: trace.SpanKindProducer,
Attributes: []attribute.KeyValue{
Expand Down

0 comments on commit 5b45512

Please sign in to comment.