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

feat: allow disabling of install messages #831

Merged
merged 5 commits into from
Jun 23, 2021

Conversation

robertlaurin
Copy link
Contributor

@robertlaurin robertlaurin commented Jun 22, 2021

Allows controlling the severity of the opentelemetry log messages emitted independently of the logger supplied.

This still allows for a user to override the OpenTelemetry.logger entirely via the accessor OpenTelemetry.logger =, if you wish to supply a logger and still respect the OTEL_LOG_LEVEL supplied environment variable this is done through the configuration.

OpenTelemetry::SDK.configure { |c| c.logger = Logger.new(....) }

@robertlaurin robertlaurin self-assigned this Jun 22, 2021
@ahayworth
Copy link
Contributor

OTEL_RUBY_INSTRUMENTATION_INSTALL_MESSAGES

Is there a general log-level argument we could use instead? OTEL_DEBUG=1 or OTEL_LOG_LEVEL=debug or something - I would expect this would be off by default (as an end user) but be something I could opt into when needed.

(Unless this is required by the spec, of course).

@robertlaurin
Copy link
Contributor Author

OTEL_RUBY_INSTRUMENTATION_INSTALL_MESSAGES

Is there a general log-level argument we could use instead? OTEL_DEBUG=1 or OTEL_LOG_LEVEL=debug or something - I would expect this would be off by default (as an end user) but be something I could opt into when needed.

(Unless this is required by the spec, of course).

Hmm, we do have OTEL_LOG_LEVEL

@logger ||= Logger.new(STDOUT, level: ENV['OTEL_LOG_LEVEL'] || Logger::INFO)
so that could be a better choice here.

The context for this change is around users getting tired of the install message log spam, previously they would use OTEL_LOG_LEVEL but we're now setting the OpenTelemetry logger to use the Rails.logger as part of our railtie so that env var isn't working the same.

I was already a little apprehensive to add a one off config for this.

@robertlaurin robertlaurin force-pushed the feat-instrumentation-install-messages branch from 0af9935 to 306e169 Compare June 23, 2021 16:30
@robertlaurin robertlaurin marked this pull request as ready for review June 23, 2021 16:30
@robertlaurin robertlaurin requested a review from ahayworth June 23, 2021 16:30
Copy link
Contributor

@ahayworth ahayworth left a comment

Choose a reason for hiding this comment

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

This looks great!

@robertlaurin robertlaurin merged commit 62d6ee5 into main Jun 23, 2021
@robertlaurin robertlaurin deleted the feat-instrumentation-install-messages branch June 23, 2021 17:13
Copy link

@amomchilov amomchilov left a comment

Choose a reason for hiding this comment

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

This is neat, thanks!

hartsick added a commit to meedan/pender that referenced this pull request Oct 6, 2022
This is mainly to help us suppress the verbose output on enabling
different instrumentations on startup in test environments, but
also could be generally useful. More on the PR to enable it:
open-telemetry/opentelemetry-ruby#831
hartsick added a commit to meedan/pender that referenced this pull request Oct 6, 2022
This is mainly to help us suppress the verbose output on enabling
different instrumentations on startup in test environments, but
also could be generally useful. More on the PR to enable it:
open-telemetry/opentelemetry-ruby#831
hartsick added a commit to meedan/pender that referenced this pull request Oct 6, 2022
This is mainly to help us suppress the verbose output on enabling
different instrumentations on startup in test environments, but
also could be generally useful. More on the PR to enable it:
open-telemetry/opentelemetry-ruby#831
hartsick added a commit to meedan/pender that referenced this pull request Oct 6, 2022
This is mainly to help us suppress the verbose output on enabling
different instrumentations on startup in test environments, but
also could be generally useful. More on the PR to enable it:
open-telemetry/opentelemetry-ruby#831
hartsick added a commit to meedan/pender that referenced this pull request Oct 6, 2022
This is mainly to help us suppress the verbose output on enabling
different instrumentations on startup in test environments, but
also could be generally useful. More on the PR to enable it:
open-telemetry/opentelemetry-ruby#831

Also updates encrypted config.yml for test runs on CI with 
new test configuration keys to lower Otel log level in test
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.

4 participants