Skip to content
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

Merged
merged 7 commits into from
Apr 6, 2020

Conversation

pavolloffay
Copy link
Member

  • Run OTEL collector when OTEL configuration file is missing.
  • The storage exporter is chosen by SPAN_STORAGE_TYPE env variable and by default Cassandra implementation is used.
  • the value of storage type env var can contain a comma-separated list of backends.

Signed-off-by: Pavol Loffay ploffay@redhat.com

Signed-off-by: Pavol Loffay <ploffay@redhat.com>
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
@pavolloffay pavolloffay requested a review from a team as a code owner April 2, 2020 15:49
@pavolloffay
Copy link
Member Author

@annanay25 would you like to take this one?

Signed-off-by: Pavol Loffay <ploffay@redhat.com>
@codecov
Copy link

codecov bot commented Apr 2, 2020

Codecov Report

Merging #2148 into master will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            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              
Impacted Files Coverage Δ
plugin/storage/es/factory.go 100.00% <100.00%> (ø)
plugin/storage/es/options.go 100.00% <100.00%> (ø)
cmd/collector/app/server/grpc.go 65.38% <0.00%> (-1.29%) ⬇️
cmd/flags/admin.go 79.36% <0.00%> (ø)
cmd/flags/service.go 0.00% <0.00%> (ø)
cmd/collector/app/server/http.go 0.00% <0.00%> (ø)
cmd/collector/app/builder_flags.go 100.00% <0.00%> (ø)
cmd/collector/app/server/zipkin.go 0.00% <0.00%> (ø)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b1868a6...7cb3c60. Read the comment docs.

Copy link
Contributor

@objectiser objectiser left a 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>
cmd/opentelemetry-collector/app/defaults/default_config.go Outdated Show resolved Hide resolved
cmd/opentelemetry-collector/app/defaults/default_config.go Outdated Show resolved Hide resolved
} else if storage == "kafka" {
kaf := factories.Exporters[kafka.TypeStr].CreateDefaultConfig()
exporters[kafka.TypeStr] = kaf
}
Copy link
Member

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()

Copy link
Member Author

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,
Copy link
Member

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?

Copy link
Contributor

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.

Copy link
Member Author

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

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.

Comment on lines +55 to +59
storageType := os.Getenv(storage.SpanStorageTypeEnvVar)
if storageType == "" {
storageType = "cassandra"
}

Copy link
Member

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.

Copy link
Member Author

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>
@pavolloffay pavolloffay merged commit b8f6ac1 into jaegertracing:master Apr 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants