Skip to content

Commit 7a2db6b

Browse files
authored
Replace the use of model/converter/thrift/zipkin (jaegertracing#6879)
## Which problem is this PR solving? - Resolves jaegertracing#6859 ## Description of the changes - Changed the all imports of "github.com/jaegertracing/jaeger/model/converter/thrift/zipkin" to "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin/zipkinthriftconverter". - Deleted model/converter/thrift/zipkin package as we don't use it. ## How was this change tested? - Successfully tested by running make test ## Checklist - [ ✔] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [ ✔ ] I have signed all commits - [ ✔] I have run lint and test steps successfully Signed-off-by: Mohammed Shuraih Shaikh <[email protected]>
1 parent fbfa28e commit 7a2db6b

20 files changed

+13
-1227
lines changed

cmd/collector/app/handler/thrift_span_handler.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ package handler
77
import (
88
"context"
99

10+
zipkin "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin/zipkinthriftconverter"
1011
"go.uber.org/zap"
1112

1213
"github.com/jaegertracing/jaeger-idl/model/v1"
@@ -15,7 +16,6 @@ import (
1516
"github.com/jaegertracing/jaeger/cmd/collector/app/processor"
1617
zipkinS "github.com/jaegertracing/jaeger/cmd/collector/app/sanitizer/zipkin"
1718
jConv "github.com/jaegertracing/jaeger/model/converter/thrift/jaeger"
18-
"github.com/jaegertracing/jaeger/model/converter/thrift/zipkin"
1919
)
2020

2121
// SubmitBatchOptions are passed to Submit methods of the handlers.

cmd/collector/app/handler/zipkin_receiver_test.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515

1616
gogojsonpb "github.com/gogo/protobuf/jsonpb"
1717
gogoproto "github.com/gogo/protobuf/proto"
18+
zipkinthrift "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin/zipkinthriftconverter"
1819
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver"
1920
"github.com/stretchr/testify/assert"
2021
"github.com/stretchr/testify/require"
@@ -26,7 +27,6 @@ import (
2627
"github.com/jaegertracing/jaeger/cmd/collector/app/flags"
2728
"github.com/jaegertracing/jaeger/cmd/collector/app/processor"
2829
"github.com/jaegertracing/jaeger/internal/testutils"
29-
zipkinthrift "github.com/jaegertracing/jaeger/model/converter/thrift/zipkin"
3030
"github.com/jaegertracing/jaeger/pkg/tenancy"
3131
zipkin_proto3 "github.com/jaegertracing/jaeger/proto-gen/zipkin"
3232
)
@@ -54,7 +54,9 @@ func TestZipkinReceiver(t *testing.T) {
5454
makeThrift := func(data []byte) []byte {
5555
var spans []*zipkincore.Span
5656
require.NoError(t, json.Unmarshal(data, &spans))
57-
return zipkinthrift.SerializeThrift(context.Background(), spans)
57+
out, err := zipkinthrift.SerializeThrift(context.Background(), spans)
58+
require.NoError(t, err)
59+
return out
5860
}
5961

6062
makeProto := func(data []byte) []byte {

go.mod

+1-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ require (
1919
github.com/gogo/protobuf v1.3.2
2020
github.com/gorilla/handlers v1.5.2
2121
github.com/gorilla/mux v1.8.1
22-
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.1
2322
github.com/jaegertracing/jaeger-idl v0.5.0
2423
github.com/kr/pretty v0.3.1
2524
github.com/olivere/elastic v6.2.37+incompatible
@@ -208,7 +207,7 @@ require (
208207
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/status v0.122.0 // indirect
209208
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/azure v0.122.0 // indirect
210209
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus v0.122.0 // indirect
211-
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.122.0 // indirect
210+
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.122.0
212211
github.com/opentracing/opentracing-go v1.2.0 // indirect
213212
github.com/openzipkin/zipkin-go v0.4.3 // indirect
214213
github.com/pelletier/go-toml/v2 v2.2.3 // indirect

go.sum

-2
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,6 @@ github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWm
284284
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
285285
github.com/grafana/regexp v0.0.0-20240518133315-a468a5bfb3bc h1:GN2Lv3MGO7AS6PrRoT6yV5+wkrOpcszoIsO4+4ds248=
286286
github.com/grafana/regexp v0.0.0-20240518133315-a468a5bfb3bc/go.mod h1:+JKpmjMGhpgPL+rXZ5nsZieVzvarn86asRlBg4uNGnk=
287-
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.1 h1:KcFzXwzM/kGhIRHvc8jdixfIJjVzuUJdnv+5xsPutog=
288-
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.1/go.mod h1:qOchhhIlmRcqk/O9uCo/puJlyo07YINaIqdZfZG3Jkc=
289287
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.1 h1:e9Rjr40Z98/clHv5Yg79Is0NtosR5LXRvdr7o/6NwbA=
290288
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.1/go.mod h1:tIxuGz/9mpox++sgp9fJjHO0+q1X9/UOWd798aAm22M=
291289
github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed h1:5upAirOpQc1Q53c0bnx2ufif5kANL7bfZWcc6VJWJd8=

internal/storage/v1/kafka/marshalling_test.go

+6-4
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ import (
77
"context"
88
"testing"
99

10+
zipkin "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin/zipkinthriftconverter"
1011
"github.com/stretchr/testify/assert"
1112
"github.com/stretchr/testify/require"
1213

1314
"github.com/jaegertracing/jaeger-idl/thrift-gen/zipkincore"
14-
"github.com/jaegertracing/jaeger/model/converter/thrift/zipkin"
1515
)
1616

1717
func TestProtobufMarshallerAndUnmarshaller(t *testing.T) {
@@ -36,7 +36,7 @@ func testMarshallerAndUnmarshaller(t *testing.T, marshaller Marshaller, unmarsha
3636

3737
func TestZipkinThriftUnmarshaller(t *testing.T) {
3838
operationName := "foo"
39-
bytes := zipkin.SerializeThrift(context.Background(), []*zipkincore.Span{
39+
bytes, err := zipkin.SerializeThrift(context.Background(), []*zipkincore.Span{
4040
{
4141
ID: 12345,
4242
Name: operationName,
@@ -45,6 +45,7 @@ func TestZipkinThriftUnmarshaller(t *testing.T) {
4545
},
4646
},
4747
})
48+
require.NoError(t, err)
4849
unmarshaller := NewZipkinThriftUnmarshaller()
4950
resultSpan, err := unmarshaller.Unmarshal(bytes)
5051

@@ -53,14 +54,15 @@ func TestZipkinThriftUnmarshaller(t *testing.T) {
5354
}
5455

5556
func TestZipkinThriftUnmarshallerErrorNoService(t *testing.T) {
56-
bytes := zipkin.SerializeThrift(context.Background(), []*zipkincore.Span{
57+
bytes, err := zipkin.SerializeThrift(context.Background(), []*zipkincore.Span{
5758
{
5859
ID: 12345,
5960
Name: "foo",
6061
},
6162
})
63+
require.NoError(t, err)
6264
unmarshaller := NewZipkinThriftUnmarshaller()
63-
_, err := unmarshaller.Unmarshal(bytes)
65+
_, err = unmarshaller.Unmarshal(bytes)
6466
require.Error(t, err)
6567
}
6668

internal/storage/v1/kafka/unmarshaller.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import (
99

1010
"github.com/gogo/protobuf/jsonpb"
1111
"github.com/gogo/protobuf/proto"
12+
zipkin "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin/zipkinthriftconverter"
1213

1314
"github.com/jaegertracing/jaeger-idl/model/v1"
14-
"github.com/jaegertracing/jaeger/model/converter/thrift/zipkin"
1515
)
1616

1717
// Unmarshaller decodes a byte array to a span

model/converter/thrift/zipkin/deserialize.go

-50
This file was deleted.

model/converter/thrift/zipkin/deserialize_test.go

-36
This file was deleted.

model/converter/thrift/zipkin/doc.go

-6
This file was deleted.

model/converter/thrift/zipkin/fixtures/domain_01.json

-102
This file was deleted.

model/converter/thrift/zipkin/fixtures/domain_02.json

-34
This file was deleted.

0 commit comments

Comments
 (0)