Skip to content

Commit

Permalink
[kafka-consumer] Set the RackID in consumer config (#5374)
Browse files Browse the repository at this point in the history
## Which problem is this PR solving?
RackID option was exposed in
[this](#3395) PR but it was
not properly parsed from passed flags and set on Sarama client

## Description of the changes
- configures Parsed RackID on ConsumerConfig
- Fix failing lint issues

## How was this change tested?
- Tested by printing the config passed to sarama client

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

Signed-off-by: Saketh kappala <[email protected]>
  • Loading branch information
sappusaketh authored Apr 20, 2024
1 parent 5434892 commit 466e105
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions cmd/ingester/app/builder/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ func CreateConsumer(logger *zap.Logger, metricsFactory metrics.Factory, spanWrit
ClientID: options.ClientID,
ProtocolVersion: options.ProtocolVersion,
AuthenticationConfig: options.AuthenticationConfig,
RackID: options.RackID,
FetchMaxMessageBytes: options.FetchMaxMessageBytes,
}
saramaConsumer, err := consumerConfig.NewConsumer(logger)
Expand Down
3 changes: 1 addition & 2 deletions pkg/config/tlscfg/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,10 @@ func (p *Options) Config(logger *zap.Logger) (*tls.Config, error) {
}
}

// #nosec G402
tlsCfg := &tls.Config{
RootCAs: certPool,
ServerName: p.ServerName,
InsecureSkipVerify: p.SkipHostVerify,
InsecureSkipVerify: p.SkipHostVerify, /* #nosec G402*/
CipherSuites: cipherSuiteIds,
MinVersion: minVersionId,
MaxVersion: maxVersionId,
Expand Down
2 changes: 2 additions & 0 deletions storage/spanstore/downsampling_writer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ func TestDownSamplingWriter_hashBytes(t *testing.T) {
}
c := NewDownsamplingWriter(&noopWriteSpanStore{}, downsamplingOptions)
h := c.sampler.hasherPool.Get().(*hasher)
//nolint:testifylint
assert.Equal(t, h.hashBytes(), h.hashBytes())
c.sampler.hasherPool.Put(h)
trace := model.TraceID{
Expand All @@ -81,6 +82,7 @@ func TestDownSamplingWriter_hashBytes(t *testing.T) {
}
_, _ = span.TraceID.MarshalTo(h.buffer)
// Same traceID should always be hashed to same uint64 in DownSamplingWriter.
//nolint:testifylint
assert.Equal(t, h.hashBytes(), h.hashBytes())
}

Expand Down

0 comments on commit 466e105

Please sign in to comment.