-
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
Run OTEL collector without configuration file #2148
Conversation
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
@annanay25 would you like to take this one? |
Codecov Report
@@ Coverage Diff @@
## master #2148 +/- ##
==========================================
+ Coverage 96.12% 96.14% +0.02%
==========================================
Files 218 219 +1
Lines 10577 10585 +8
==========================================
+ Hits 10167 10177 +10
+ Misses 354 352 -2
Partials 56 56
Continue to review full report at Codecov.
|
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.
LGTM
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
} else if storage == "kafka" { | ||
kaf := factories.Exporters[kafka.TypeStr].CreateDefaultConfig() | ||
exporters[kafka.TypeStr] = kaf | ||
} |
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.
Can we use a switch case here and error out on a bad storage type here, instead of passing it down to main.go
and handling it in storageFlags()
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.
+1 on the switch, the storageFlags
from main also parses the variable but it has a different functionality
func createProcessors(factories config.Factories) configmodels.Processors { | ||
batch := factories.Processors["batch"].CreateDefaultConfig().(*batchprocessor.Config) | ||
return map[string]configmodels.Processor{ | ||
"batch": batch, |
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 did we decide this list of default processors? I'd like to think queued_retry
is also part of this list as it reduces data loss. Which brings about a more important question of - what are the use cases of running the otel-collector without a configuration file? In what scenario would we want to do that?
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.
Good point - the other reason for using queued_retry
is that it will have some of the metrics we are interested in using.
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 have used the batch as a starting point since there has to be at least one processor. In the production-ready settings we might run batch, retry and memory limiter. Let's handle this in a separate task.
Which brings about a more important question of - what are the use cases of running the otel-collector without a configuration file? In what scenario would we want to do that?
The highest priority we had was to be a drop-in replacement for the current collector. The OTEL collector fails without the config file which is not compatible behavior with our collector.
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.
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.
there has to be at least one processor
IIRC, this is no longer true, but yes I agree, let's start with the batch processor and merge this soon.
storageType := os.Getenv(storage.SpanStorageTypeEnvVar) | ||
if storageType == "" { | ||
storageType = "cassandra" | ||
} | ||
|
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.
Seems like it belongs better in the config file.
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 would like to keep the parsing of flags and getting the settings from the environment in the main - in one place.
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
SPAN_STORAGE_TYPE
env variable and by default Cassandra implementation is used.Signed-off-by: Pavol Loffay ploffay@redhat.com