-
Notifications
You must be signed in to change notification settings - Fork 57
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
Can not stop DatadogInterceptor warnings #1313
Comments
Hello @amirziaratii! Thanks for your feedback. Indeed, we are aware about issues regarding the usage of OkHttp instrumentation in the Remote Config driven environment. We are currently in the process of creating the next major version of SDK, where we will try to improve this flow. |
as a temporary workaround i used a wrapper class that checks for datadog initialization on every request rather than only once during initialization.
|
Hello @amirziaratii. I believe the issue with log verbosity is fixed in ff28ff5, which will be a part of the SDK v2 release. Regarding the usage of OkHttp with Remote Config: we've improved some APIs, but still, for the case when Datadog SDK as a whole can be enabled or disabled, you better to use the solution you've posted, because in the SDK components we still want to notify the user if SDK is not initialized to avoid the issues with possible misconfigurations. I will keep this ticket opened, so that it can be reviewed with SDK v2 release. |
Hello @amirziaratii! The change mentioned above is now available in our first beta of SDK v2. Can you please try the new SDK version and let us know if the issue is solved for you? With SDK v2 we now support initialization of OkHttp instrumentation before Datadog SDK initialization - it will start working once SDK is ready. There is no way to turn it on/turn it off dynamically, however, but we are open to the discussion. |
Describe what happened
I want to use a feature flag to decide whether initialize Datadog or not. now the issue is when i simply dont initialize it, the Interceptor keeps printing the following warning in logcat on every request and there is no way to stop it. I tried
dataDogWrapper.setVerbosity(Log.ERROR)
but it doesnt work obviously because before initializing Datadog the value ofDataDog.globalSdkCore
is set toNoOpSdkCore()
which itssetVerbosity
method practically does nothing.You set up a DatadogInterceptor, but RUM features are disabled.Make sure you initialized the Datadog SDK with a valid Application Id, and that RUM features are enabled.
Important NOTE: Our FeatureFlags values are fetched from server so I need the OKHttpClient instance before even knowing if we need to initialize Datadog or not. there is no way that I can simply not add the interceptor based on feature flag (or even checking Datadog.isInitialized()).
Steps to reproduce the issue:
do not initialize the Datadog and add the datadog interceptor to your OkHttpClient
it keeps printing warning on every request and cant be stopped
Describe what you expected:
I expect be able to be able to set log level even if I hadnt initialized DataDog.
Additional context
The text was updated successfully, but these errors were encountered: