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

Add stall detection #1536

Closed
wants to merge 6 commits into from
Closed

Conversation

jack-berg
Copy link
Contributor

Resolves #1527.

Some notes:

  • Adds a feature which detects slow transactions and reports as SlowTransaction analytic events
  • Implementation hooks into transaction listener to maintain map of open transactions. Before harvest, it scans the map of open transactions and identifies the slowest that has been open longer than a threshold. It extracts metadata about that transaction, notably including the stacktrace of the thread that initialized it, and emits an event.
  • The implementation has a mechanism preventing the same transaction to be reported multiple times.
  • Disabled by default
  • Threshold is configurable, and defaults to 1s (i.e. any transaction open for longer than 1s is a candidate to be reported).

@codecov-commenter
Copy link

Codecov Report

Merging #1536 (b58cfd2) into main (2c20813) will increase coverage by 0.01%.
Report is 25 commits behind head on main.
The diff coverage is 84.68%.

@@             Coverage Diff              @@
##               main    #1536      +/-   ##
============================================
+ Coverage     70.60%   70.61%   +0.01%     
- Complexity     9745     9778      +33     
============================================
  Files           813      816       +3     
  Lines         39264    39411     +147     
  Branches       5962     5975      +13     
============================================
+ Hits          27723    27832     +109     
- Misses         8856     8879      +23     
- Partials       2685     2700      +15     
Files Coverage Δ
...ava/com/newrelic/agent/config/AgentConfigImpl.java 87.13% <100.00%> (+0.11%) ⬆️
...relic/agent/config/SlowTransactionsConfigImpl.java 100.00% <100.00%> (ø)
...com/newrelic/agent/service/ServiceManagerImpl.java 77.85% <100.00%> (-0.13%) ⬇️
...rvice/slowtransactions/SlowTransactionService.java 82.65% <82.65%> (ø)

... and 19 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@jack-berg
Copy link
Contributor Author

The build failures appear to be test flakes?

@jtduffy
Copy link
Contributor

jtduffy commented Oct 6, 2023

Duplicated this PR in #1542.

@jtduffy jtduffy closed this Oct 6, 2023
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.

Add stall detection to the NR java agent
5 participants