Skip to content

Conversation

@dhilpipre
Copy link
Collaborator

Provides instrumentation for Kotlin Coroutines from version 1.4 onwards.

@codecov-commenter
Copy link

codecov-commenter commented Aug 13, 2025

Codecov Report

❌ Patch coverage is 36.11111% with 69 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.33%. Comparing base (05d3dba) to head (e74a588).
⚠️ Report is 122 commits behind head on main.

Files with missing lines Patch % Lines
...relic/agent/config/KotlinCoroutinesConfigImpl.java 33.33% 39 Missing and 5 partials ⚠️
...gent/kotlincoroutines/KotlinCoroutinesService.java 29.03% 21 Missing and 1 partial ⚠️
...introspec/internal/IntrospectorServiceManager.java 0.00% 1 Missing ⚠️
...ava/com/newrelic/agent/service/ServiceFactory.java 0.00% 1 Missing ⚠️
...com/newrelic/agent/service/ServiceManagerImpl.java 80.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2454      +/-   ##
============================================
- Coverage     70.52%   70.33%   -0.19%     
- Complexity    10036    10056      +20     
============================================
  Files           844      847       +3     
  Lines         40642    40884     +242     
  Branches       6161     6196      +35     
============================================
+ Hits          28663    28756      +93     
- Misses         9194     9326     +132     
- Partials       2785     2802      +17     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kmudduluru kmudduluru moved this from Triage to Needs Review in Java Engineering Board Aug 18, 2025
@jtduffy
Copy link
Contributor

jtduffy commented Sep 8, 2025

Hey @dhilpipre, we had some thoughts on this PR and I figured I would consolidate everything into a single comment rather than over individual line comments.

Config

In general, our standard is our config keys are reverse name spaced. For example, this might be an alternative to what's present now:

kotlin:
  coroutines:
    continuations:
      ignore: #comma-separated-list-of-strings
    dispatched:
      ignore: #comma-separated-list-of-strings
    scopes:
      ignore: #comma-separated-list-of-strings

Do these need to be "hot" settings? This can probably be simplified if the config listeners can be removed. I don't think we have many (if any) module configs that can be modified at runtime.

For configurations, we normally create stand-alone config classes that integrate into our existing config service. An example is the JfrConfigImpl class.

Optimization

This is using matches(), which, under the covers, will recompile the regex every time it's executed. Maybe pre-compile the regexs or use contains() instead.

Verify Range

If possible, the module should use passesOnly rather than passes. We've had incidents in the past where two modules apply to the same library causing issues. passesOnly is able to catch this if a module applies outside it's targeted range.

@dhilpipre
Copy link
Collaborator Author

@jtduffy Hi Jerry,
I will look into to it and let you know.
I do want to make note of why the configuration is "hot" deploy and you can let me know what you think.
The reason for the configuration is that we can get some of each of the ones configured can be very fast and frequently invoked and tracking them can impact performance. Plus there can also be ones that the customer is not interested in tracking. With hot deploy, they can tune the configuration on the fly when they see something they want to eliminate from tracking.
Without hot deploy they would need to restart in order for the change to take effect.
If we eliminate hot deploy then we should add verbiage in the documentation that they should tune it in a non-production environment before deploying to production.

@dhilpipre
Copy link
Collaborator Author

@jtduffy Hi Jerry, I have made all of the requested changes with the exception of removing "hot deploy".
Not sure if you saw my comment above on it but I would prefer to keep it in.
If you still think I will remove it then I will remove it.

@jtduffy jtduffy merged commit e1fac66 into main Oct 8, 2025
439 of 442 checks passed
@jtduffy jtduffy deleted the kotlin-coroutines branch October 8, 2025 16:33
@kmudduluru kmudduluru moved this from Needs Review to Code Complete/Done in Java Engineering Board Oct 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants