Closed waymondo closed 1 month ago
Hey! Thanks for reaching out on this.
I actually think we started down this path but at that time there was some concurrent work ongoing and we ended up not finishing it completely...
Specifically in #3036 we added a better detection for development environments and in #3062 we extended it to check RAILS_ENV
for test
. At the time we discussed using this new detection code for the environment logger: https://github.com/DataDog/dd-trace-rb/pull/3036#issuecomment-1672268140 and didn't touch it to avoid other conflicts.
@marcotc any concerns on doing it now?
Btw @waymondo as a temporary workaround, you should be able to use the DD_TRACE_STARTUP_LOGS
environment variable to "shut up" the logs, and this setting is (as other environment variables) picked up right from the first second the library gets loaded.
I think merging both the development environment detection from telemetry and startup logs is indeed the solution here. We'll work on that.
👋 @waymondo 2.3.0
is just released. Give it a try.
👋 @waymondo
2.3.0
is just released. Give it a try.
sweet, will do!
when running tests, we get a lot of startup diagnostic logging that is unimportant/noisy. because the gem gets required before rails initializers are loaded, we can't seem to set
Datadog.configuration.diagnostics.startup_logs.enabled
to false in time before the output occurs.when looking at the source, it seems what i'm desiring happens when running a program name ending in
rspec
.checking
$PROGRAM_NAME
doesn't exactly work though for running rails tests the built-in way. when runningbin/rails t
, the program name isbin/rails
. but you can also run an individual minitest withbundle exec ruby ...
, in which case program name would beruby
.would there be any gotchas in just checking
ENV["RAILS_ENV"] == "test"
?