-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[jaeger-v2] Add support for artificial jaeger storage receiver #5242
[jaeger-v2] Add support for artificial jaeger storage receiver #5242
Conversation
Signed-off-by: James Ryans <[email protected]>
Signed-off-by: James Ryans <[email protected]>
Signed-off-by: James Ryans <[email protected]>
Signed-off-by: James Ryans <[email protected]>
Signed-off-by: James Ryans <[email protected]>
Signed-off-by: James Ryans <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5242 +/- ##
==========================================
- Coverage 95.09% 95.09% -0.01%
==========================================
Files 336 339 +3
Lines 16421 16502 +81
==========================================
+ Hits 15615 15692 +77
- Misses 618 621 +3
- Partials 188 189 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Hi @yurishkuro, I've implemented the Jaeger storage receiver as you stated it's better to separate this PR. There are still things to add here:
|
if ctx.Err() != nil { | ||
r.settings.Logger.Error("Consumer stopped", zap.Error(ctx.Err())) | ||
return ctx.Err() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this an error for the consumer?
I actually follow kafkareceiver from otelcol-contrib since they're both a "pull" strategy to retrieve traces. https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/3652b444802fad4819b50fbda41e0957000d8279/receiver/kafkareceiver/kafka_receiver.go#L171-L185
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's wrong to treat orderly shutdown as error and log all kinds of error messages. You can check Done instead
select {
case <-ctx.Done():
return
default:
time.Sleep(time.Second)
}
func (r *storageReceiver) consumeLoop(ctx context.Context) error { | ||
for { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how do we exit this loop? Should it be checking ctx.Done for that?
When the r.cancelConsumeLoop()
is called from Shutdown
, we can capture that with ctx.Err()
. Is it better to check with ctx.Done
? I followed kafkareceiver implementation from otelcol-contrib actually https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/3652b444802fad4819b50fbda41e0957000d8279/receiver/kafkareceiver/kafka_receiver.go#L171-L185
if ctx.Err() != nil { | ||
r.settings.Logger.Error("Consumer stopped", zap.Error(ctx.Err())) | ||
return ctx.Err() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's wrong to treat orderly shutdown as error and log all kinds of error messages. You can check Done instead
select {
case <-ctx.Done():
return
default:
time.Sleep(time.Second)
}
cmd/jaeger/integration/receivers/storagereceiver/receiver_test.go
Outdated
Show resolved
Hide resolved
cmd/jaeger/integration/receivers/storagereceiver/receiver_test.go
Outdated
Show resolved
Hide resolved
cmd/jaeger/integration/receivers/storagereceiver/receiver_test.go
Outdated
Show resolved
Hide resolved
Signed-off-by: James Ryans <[email protected]>
Signed-off-by: James Ryans <[email protected]>
Signed-off-by: James Ryans <[email protected]>
Signed-off-by: James Ryans <[email protected]>
Signed-off-by: James Ryans <[email protected]>
Signed-off-by: James Ryans <[email protected]>
Signed-off-by: James Ryans <[email protected]>
Signed-off-by: James Ryans <[email protected]>
Which problem is this PR solving?
Description of the changes
How was this change tested?
Checklist
jaeger
:make lint test
jaeger-ui
:yarn lint
andyarn test