Skip to content

Commit

Permalink
Fix Zipkin spanFormat (#5261)
Browse files Browse the repository at this point in the history
<!--
!! Please DELETE this comment before posting.
We appreciate your contribution to the Jaeger project! πŸ‘‹πŸŽ‰
-->

## Which problem is this PR solving?
- <!-- Example: Resolves #123 -->
Resolves #5260
## Description of the changes
- 

## How was this change tested?
- 

## Checklist
- [ ] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [ ] I have signed all commits
- [ ] I have added unit tests for the new functionality
- [ ] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

Signed-off-by: Yuan Fang <yuanfang@alauda.io>
Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
  • Loading branch information
fyuan1316 and yurishkuro authored Mar 11, 2024
1 parent e6a6042 commit 0b87fa5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/collector/app/handler/zipkin_receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ func startZipkinReceiver(
}

consumerAdapter := newConsumerDelegate(logger, spanProcessor, tm)
// reset Zipkin spanFormat
consumerAdapter.batchConsumer.spanOptions.SpanFormat = processor.ZipkinSpanFormat

nextConsumer, err := newTraces(consumerAdapter.consume)
if err != nil {
return nil, fmt.Errorf("could not create Zipkin consumer: %w", err)
Expand Down
2 changes: 2 additions & 0 deletions cmd/collector/app/handler/zipkin_receiver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"go.opentelemetry.io/collector/receiver"

"github.com/jaegertracing/jaeger/cmd/collector/app/flags"
"github.com/jaegertracing/jaeger/cmd/collector/app/processor"
zipkinthrift "github.com/jaegertracing/jaeger/model/converter/thrift/zipkin"
"github.com/jaegertracing/jaeger/pkg/tenancy"
"github.com/jaegertracing/jaeger/pkg/testutils"
Expand Down Expand Up @@ -126,6 +127,7 @@ func TestZipkinReceiver(t *testing.T) {
t.Logf("response: %s %s", response.Status, string(bodyBytes))
}
require.NoError(t, response.Body.Close())
require.Equal(t, processor.ZipkinSpanFormat, spanProcessor.getSpanFormat())
})
}
}
Expand Down

0 comments on commit 0b87fa5

Please sign in to comment.