Skip to content

Commit

Permalink
Export OTLP->Jaeger conversion func for use with GRPC
Browse files Browse the repository at this point in the history
  • Loading branch information
benkeith-splunk committed Sep 23, 2021
1 parent 73d99a1 commit 63dcbba
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion otlp/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ func ParseRequest(req *http.Request) (*splunksapm.PostSpansRequest, error) {
if err := sapmprotocol.ParseSapmRequest(req, &otlp); err != nil {
return nil, err
}
return otlpToSAPM(otlp)
return OTLPToSAPM(otlp)
}
4 changes: 2 additions & 2 deletions otlp/translator.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import (
otlptrace "github.com/signalfx/sapm-proto/gen/otlp/trace/v1"
)

// otlpToSAPM translates otlp trace proto into the SAPM Proto.
func otlpToSAPM(td otlpcoltrace.ExportTraceServiceRequest) (*splunksapm.PostSpansRequest, error) {
// OTLPToSAPM translates otlp trace proto into the SAPM Proto.
func OTLPToSAPM(td otlpcoltrace.ExportTraceServiceRequest) (*splunksapm.PostSpansRequest, error) {
sapm := &splunksapm.PostSpansRequest{}
if len(td.ResourceSpans) == 0 {
return sapm, nil
Expand Down
4 changes: 2 additions & 2 deletions otlp/translator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ func TestInternalTracesToJaegerProto(t *testing.T) {

for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
jbs, err := otlpToSAPM(test.td)
jbs, err := OTLPToSAPM(test.td)
if test.hasErr {
assert.Error(t, err)
assert.Nil(t, jbs)
Expand Down Expand Up @@ -770,7 +770,7 @@ func BenchmarkInternalTracesToJaegerProto(b *testing.B) {

b.ResetTimer()
for n := 0; n < b.N; n++ {
_, err := otlpToSAPM(td)
_, err := OTLPToSAPM(td)
assert.NoError(b, err)
}
}
Expand Down

0 comments on commit 63dcbba

Please sign in to comment.