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

[RPM/MSI] Enable logging level #2255

Closed
wyTrivail opened this issue Dec 4, 2020 · 9 comments
Closed

[RPM/MSI] Enable logging level #2255

wyTrivail opened this issue Dec 4, 2020 · 9 comments
Assignees
Labels

Comments

@wyTrivail
Copy link

Is your feature request related to a problem? Please describe.
No, it's not a problem but a pain point for linux/windows instance customers who are installing rpm/msi, i find no way to enable the logging level since the collector is running within service. no parameters can be sent into it.

Describe the solution you'd like
I'd like to have a unified solution for both msi and rpm/deb so that customers can enable debug logging level.

One way i can think of is to ask customer to touch a file named debug, so that collector can read it and change the logging level.

Describe alternatives you've considered

I have been thinking about using env var, however the ways to set up env var for linux service and windows service are different, so that it's not a unified solution.

Additional context

I'm happy to implement this feature if it's reasonable to you.

@jpkrohling
Copy link
Member

Do you want to change the log-level for a running instance, or do you want to change the service configuration?

@wyTrivail
Copy link
Author

wyTrivail commented Dec 9, 2020

@jpkrohling thx for response!

we have logging level config in the yaml just for the logging exporter, for that, yes we can configure it, i'm pointing this out just in case we are confused with the logging exporter.

today, we can use command line --log-level to change the logging level while starting collector. However, if customers install collector via rpm, collector will be running as a service in linux, in this case, do we expect customers to directly change the service config to add the --log-level into it?

This feature request is assuming we are not expecting customers to touch the service config, and trying to figure out a way for customers to config the log level.

@jpkrohling
Copy link
Member

Agree that we should allow CLI flags to be specified externally. For the moment, you can create a /etc/collector.conf with env vars like LOG_LEVEL=debug and set your unit file as:

EnvironmentFile=/etc/collector.conf
ExecStart=/usr/bin/otelcol --log-level=$LOG_LEVEL

@wyTrivail
Copy link
Author

@jpkrohling thx for the suggestion! it's doable.

maybe better to build EnvironmentFile=/etc/collector.conf into https://github.com/open-telemetry/opentelemetry-collector/blob/master/internal/buildscripts/packaging/fpm/otel-collector.service#L12 ?

For long-term, do you have any idea?

@jpkrohling
Copy link
Member

For the long term, we should consider using another instance of viper, to bind env vars to flags.

@jrcamp jrcamp added the priority:p3 Lowest label Mar 10, 2021
MovieStoreGuy pushed a commit to atlassian-forks/opentelemetry-collector that referenced this issue Nov 11, 2021
* chore: adds vanity import check.

* chore: runs vanity import check on ci.

* fix: set right target on CI.

* fix: fixes install for porto.

* fix: install right proto bin.

* chore: list all files insides the tools directory.

* fix: fixes vanity import target

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* chore(vanity-imports): adds vanity import support.

* fix: fixes internal generation.

* chore: runs go mod tidy in tools.

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
@niemyjski
Copy link

niemyjski commented Dec 6, 2022

Just upgraded from 0.56 to 0.66 docker images (get this is different from this issue but related) and noticed that --log-level is no longer a thing but not documented breaking change (only saw this issue)

2022-12-06 11:24:27 Error: unknown flag: --log-level
2022-12-06 11:24:27 2022/12/06 17:24:27 collector server run finished with error: unknown flag: --log-level

@atoulme
Copy link
Contributor

atoulme commented Apr 13, 2023

@niemyjski this was deprecated and removed from the collector. This was done in #6334.

@atoulme
Copy link
Contributor

atoulme commented Apr 13, 2023

Closing this issue now as the original problem is fixed. Please consider opening a new issue if you see follow up work.

@atoulme atoulme closed this as completed Apr 13, 2023
@niemyjski
Copy link

@atoulme I saw that as well. For anyone reading this is there a better way to enable log level because I'm not seeing it.

Troels51 pushed a commit to Troels51/opentelemetry-collector that referenced this issue Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants