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

Instrumentation configuration values not being properly preserved #2893

Closed
fallwith opened this issue Oct 7, 2024 · 2 comments · Fixed by #2914
Closed

Instrumentation configuration values not being properly preserved #2893

fallwith opened this issue Oct 7, 2024 · 2 comments · Fixed by #2914
Assignees
Labels

Comments

@fallwith
Copy link
Contributor

fallwith commented Oct 7, 2024

Updated 2024-10-11 As per Tanna's commented note below, this issue seems be related to an existing chain or prepend configuration setting being changed to unsatisfied incorrectly. This can convey incorrect information to the csec agent about what the APM agent did with a given instrumentation, but it does not impact regular APM usage of the instrumentation.

At this time it is hypothesized that only Padrino and the two forms of Dalli instrumentation are impacted.

The agent has offered support for module chaining based instrumentation installation dating back to a time before Ruby itself supported module prepending. Support for chaining has been retained primarily as a means to avoid colliding with other software that may itself be using module prepending.

Unfortunately it has been reported (internally) that agent's chain functionality is currently unreachable due to an apparent bug in the processing of the related configuration options.

Setting instrumentation.<library>: chain in the config file will see the agent not respect the chain value and use prepend instead.

developer notes: the issue seems to stem from DependencyDetection's use_prepend? method making calls to prepend_configured? - a method that does not exist.

@workato-integration
Copy link

@tannalynn tannalynn changed the title Chain based instrumentation configuration not being respected Instrumentation configuration values not being properly preserved Oct 7, 2024
@tannalynn
Copy link
Contributor

After looking into this a bit, the scope is different than initially reported to us. Chain instrumentation configuration is being used and installed just fine.

The prepend_configured? method is dynamically defined by the code here https://github.com/newrelic/newrelic-ruby-agent/blob/dev/lib/new_relic/dependency_detection.rb#L169 and there are no issues with the way it's being called.

The primary problem reported seems to actually be that

On passing instrumentation.sinatra: chain in newrelic.yml, config value is set as : :"instrumentation.sinatra"=>:unsatisfied"

I tested this with roda and found that when using this config as chain, chain is initially correctly used and installed, and that later after the agent is no longer using these values, there is some issue related to preserving the values of the configuration originally used by the agent.
This isn't behavior that was originally part of the ruby agent, and was instead introduced to support the security agent, so it seems there may be a bug related to that newer code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants