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

Enable instrumentation.thread.tracing by default #1767

Merged
merged 14 commits into from
Jan 31, 2023

Conversation

tannalynn
Copy link
Contributor

Before contributing, please read our contributing guidelines and code of conduct.

Overview

Enabled the config option instrumentation.thread.tracing in the default config.
Updates tests that aren't expecting this config to be enabled.
closes #1089

Submitter Checklist:

  • Include a link to the related GitHub issue, if applicable
  • Include a security review link, if applicable

Testing

The agent includes a suite of unit and functional tests which should be used to
verify your changes don't break existing functionality. These tests will run with
GitHub Actions when a pull request is made. More details on running the tests locally can be found
here for our unit tests,
and here for our functional tests.
For most contributions it is strongly recommended to add additional tests which
exercise your changes.

Reviewer Checklist

  • Perform code review
  • Add performance label
  • Perform appropriate level of performance testing
  • Confirm all checks passed
  • Add version label prior to acceptance

@tannalynn tannalynn changed the base branch from dev to major-release-9 January 26, 2023 00:54
Copy link
Contributor

@kaylareopelle kaylareopelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is so exciting, Tanna! Could you run a workflow dispatch on JRuby and/or earlier Ruby versions? I feel like JRuby especially may reveal something to us, but I don't think it has the workflow dispatch set up yet.

CHANGELOG.md Outdated

- **Enabled Thread Instrumentation by default**

The configuration option `instrumentation.thread.tracing` is now enabled by default. Allowing the agent to properly monitor code that occurs inside of threads. If you are currently using custom instrumentation to start a new transaction inside of threads, this may be a breaking change, as it will no longer start a new transaction if one already exists.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sentence "Allowing the agent to properly monitor code that occurs inside of threads" seems like it's missing something? Did you mean to put a comma after default? Or could you something to the beginning, like "This instrumentation allows..."?

Also, could you start the description under the version number as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh yes, thank you! I missed that. I've changed both of these things in a33b7e9

@tannalynn
Copy link
Contributor Author

This is so exciting, Tanna! Could you run a workflow dispatch on JRuby and/or earlier Ruby versions? I feel like JRuby especially may reveal something to us, but I don't think it has the workflow dispatch set up yet.

Jruby does have it set up! 🎉 I included it when I first set it up because I figured there'd be situations like this that come up. They are both running right now
jruby ci
all ci

prereqs = self.prerequisite_tasks.map(&:name).join(", ")
if txn = ::NewRelic::Agent::Tracer.current_transaction
txn.current_segment.params[:statement] = NewRelic::Agent::Database.truncate_query("Couldn't trace concurrent prereq tasks: #{prereqs}")
end
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was able to be removed because this code is adding statements to the transaction saying that we can't trace the stuff happening in other threads. Since thread tracing is enabled by default, this is no longer true! We can now trace these tasks just like any other task.

@github-actions
Copy link

SimpleCov Report

Coverage Threshold
Line 93.21% 93%
Branch 84.82% 84%

@tannalynn
Copy link
Contributor Author

all ci
jruby

CHANGELOG.md Show resolved Hide resolved
test/multiverse/suites/rake/Rakefile Show resolved Hide resolved
CHANGELOG.md Show resolved Hide resolved
test/multiverse/suites/rake/Rakefile Show resolved Hide resolved
@tannalynn tannalynn merged commit 52ee350 into major-release-9 Jan 31, 2023
@tannalynn tannalynn deleted the enable_thread_tracing_default branch June 23, 2023 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable config instrumentation.thread.tracing by default
3 participants