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

User experience: starting the collector without config file yields a cryptic message #5648

Closed
jpkrohling opened this issue Jul 7, 2022 · 8 comments · Fixed by #5978
Closed
Assignees
Labels
bug Something isn't working easy Complexity: Easy good first issue Good for newcomers

Comments

@jpkrohling
Copy link
Member

When running the collector without specifying a config file, the error message that is returned doesn't immediately make it clear to users what the problem is:

$ ./bin/otelcorecol_linux_amd64 
Error: invalid map resolver config: no URIs
2022/07/07 16:08:11 collector server run finished with error: invalid map resolver config: no URIs

I would prefer to have a validation somewhere before this error, stating that a configuration file is required to run the collector. I believe we even had this a few releases ago.

@jpkrohling jpkrohling added bug Something isn't working good first issue Good for newcomers easy Complexity: Easy labels Jul 7, 2022
@josephwoodward
Copy link
Contributor

Feel free to assign this to me.

@svrnm
Copy link
Member

svrnm commented Jul 7, 2022

I am wondering if instead of throwing an error the collector could just start with a minimal configuration (otlp receivers, debug logging exporters for all signals)? Or would this be unexpected behavior / lead to more confusion ?

@mx-psi
Copy link
Member

mx-psi commented Jul 8, 2022

I am wondering if instead of throwing an error the collector could just start with a minimal configuration (otlp receivers, debug logging exporters for all signals)? Or would this be unexpected behavior / lead to more confusion ?

We have that on the Helm chart, and it seems to have mixed feedback: open-telemetry/opentelemetry-helm-charts#90. We also have it on the Docker images, for which I have heard anecdotal negative feedback when open-telemetry/opentelemetry-collector-releases/issues/59 happened (since the Collector did not fail to start, just started with a different configuration).

IMO it's hard to agree on what this minimal configuration should be: different people have different ideas and use cases in mind, and the official binaries should probably be neutral in this regard and just provide high-quality examples outside of the binary.

@svrnm
Copy link
Member

svrnm commented Jul 8, 2022

I share those mixed feeling, but I thought asking/exploring that would be helpful. From the perspective of a user that's just getting started having some easy defaults would be great, but for someone using the collector in production such a behavior might be harmful (especially what you said about the collector starting with a different/unexpected config vs just failing).

There are probably better ways to serve new comers (and I might raise another issue for that), so my question got answered. Thanks!

@josephwoodward
Copy link
Contributor

josephwoodward commented Aug 12, 2022

Started looking into this and can confirm it used to error with the following message:

$ ./otelcol-dev
Error: failed to get config: invalid configuration: no enabled receivers specified in config
2022/08/13 00:30:23 collector server run finished with error: failed to get config: invalid configuration: no enabled receivers specified in config

It looks like it fails the way it does because the error is returned when creating a new config provider before it's even able to try and validate the configuration and get the friendlier error message.

@TylerHelmuth
Copy link
Member

@jpkrohling when you said "configuration file is required to run the collector" do you mean an actual configuration file, or do you mean configuration provided via any valid source?

@TylerHelmuth
Copy link
Member

@josephwoodward I think we can check for the presence of a --config flag here, and if there are not any we can error accordingly. Let me know if you are still working on it. If not, I can pick this up.

@jpkrohling
Copy link
Member Author

Sorry, I meant a configuration provided from any valid source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working easy Complexity: Easy good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants