-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Only support the Kafka storage in Collector #1231
Only support the Kafka storage in Collector #1231
Conversation
00e967c
to
19c6433
Compare
a3812e7
to
3cc4298
Compare
Signed-off-by: Louis-Etienne Dorval <louis-etienne.dorval@ticketmaster.com>
3cc4298
to
4da81ba
Compare
cmd/all-in-one/main.go
Outdated
@@ -76,7 +76,8 @@ func main() { | |||
if os.Getenv(storage.SpanStorageTypeEnvVar) == "" { | |||
os.Setenv(storage.SpanStorageTypeEnvVar, "memory") // other storage types default to SpanStorage | |||
} | |||
storageFactory, err := storage.NewFactory(storage.FactoryConfigFromEnvAndCLI(os.Args, os.Stderr)) | |||
storageFactory, err := storage.NewFactory(storage.FactoryConfigFromEnvAndCLI(os.Args, os.Stderr), | |||
[]string{storage.KafkaStorageType}) |
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.
if we want to introduce optional params, we should switch to passing an Options struct instead of positional args.
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 choose to make it an optional parameter as the FactoryConfig is currently only for config from the Cobra, but I could indeed add an Options struct inside the same package and use that!
Codecov Report
@@ Coverage Diff @@
## master #1231 +/- ##
======================================
Coverage 100% 100%
======================================
Files 159 159
Lines 7145 7152 +7
======================================
+ Hits 7145 7152 +7
Continue to review full report at Codecov.
|
Signed-off-by: Louis-Etienne Dorval <louis-etienne.dorval@ticketmaster.com>
278a4de
to
80b6a82
Compare
The design of this fix doesn't sit well with me. Right now the details of the storage are fully abstracted from the binaries, but here we're introducing some very specific & peculiar dependency that they have to declare Kafka as unsuitable storage. The reason Kafka doesn't work for all-in-one is because it does not implement the SpanReader. The reason it does not work for ingester is because the flags are clashing (aside from the flags issue, however, there's no strong reason why ingester wouldn't do Kafka->Kafka, e.g. as a form of replicating data to another topic). If we somehow solved the clash of flags issue, then I assume all-in-one would've exited with a better error message like "reader not implemented", and we wouldn't need to do any changes. Alternatively, if we did want to handle it more explicitly, then the storage factory could expose metadata methods like |
@yurishkuro if we want to support that, maybe we could have a set of flags for the consumer and another set of flags for the producer. Something like this:
And:
This way you can both replicate from one topic to another, but we can also replicate to one cluster to another cluster. This would also get around the flags being declared twice. |
@ledor473 do you plan to finish this one? |
@yurishkuro I was waiting for a confirmation on the latest suggestion (renaming the flags to avoid the exception and to allow the use of multiples brokers/topics). I might have missed the 👍 on it, but yes I plan to fix this PR. |
cool. I think GitHub doesn't notify of reactions via +1 button, I'll make sure to comment explicitly in the future. |
@yurishkuro the change is mostly done in another branch but I see that we do not pass the I see 2 options to log the current flag as deprecated:
|
I would go with option 2, much fewer changes this way |
#1360 is merged, closing this one |
Which problem is this PR solving?
Short description of the changes