newrelic-telemetry-sdk-java
newrelic-telemetry-sdk-java copied to clipboard
Impossible to provide executor for scheduler for TelemetryClient
User can provide Dispatcher(ExecutorService) to OkHttpClient, but TelemetryClient forcibly creates another one with Executors.newSingleThreadScheduledExecutor
in constructor.
(Migrate to Jira)
@clayly thanks for letting us know about this issue but can you provide a bit more detail? What's the impact of the issue for you (eg: are you not able to generate telemetry for your application, etc?
Any chance you have a sample app/code that demonstrates the problem you're encountering?
Hi! Issue is performance and predictability / uniformity:
- Performance: if it's possible better reuse threads via thread pool, especially in something like k8s and reactive applications. If for example all you want in your library is tasks scheduling then there is no reason to own a whole thread.
- Predictability / uniformity: user already can provide ExecutorService to client, but third-party threads are created anyway, which is unpredictable by itself.
@kford-newrelic mention just in case!
@clayly thanks for this additional information - we can't commit on if/when we would act on this but our engineers will definitely discuss it (and if you want to submit a PR for this, it certainly wouldn't hurt!)
https://issues.newrelic.com/browse/NEWRELIC-4092