Plugin integration with NRE fails to return values
See original GitHub issueWhile extending Nile with plugins works well with CLI, one issue I’ve stumbled upon is returning values in the NRE. For simplicity, consider this plugin example:
# plugins/do_something.py
@click.command()
def do_something():
click.echo("AHHHHHHHH")
return 5
And let’s say we have this script:
# scripts/do_something.py
def run(nre):
x = nre.do_something()
print(x)
Running the script will print AHHHHHHHH but the expected return value 5 is returned as None; therefore, the logic is being executed, but the values are not being returned.
Issue Analytics
- State:
- Created a year ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Integration plugin installed but no metrics come through and ...
I have configured NR on one of my environments. K8s metrics come through fine. Have configured elastic search and rabbitmq using the nri- ......
Read more >maven-failsafe-plugin Errors and BUILD SUCCESS?
The Failsafe Plugin will not fail the build during the integration-test phase, thus enabling the post-integration-test phase to execute. I was able to...
Read more >New Relic Infrastructure Database Integration - GitHub
For Kubernetes deployments, a Helm chart is provided to install a deployment and the supporting Kubernetes resources required to run nri-db in a...
Read more >Unit and integration testing for Node.js apps - LogRocket Blog
This post teaches you how to perform unit and integration testing for ... function() { it('should return -1 when the value is not...
Read more >nri-bundle 5.0.2 · helm/newrelic - Artifact Hub
This chart does not deploy anything by itself but has many charts as ... helm upgrade --reuse-values -f values.yaml [RELEASE] newrelic/nri-bundle.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Yes, definitely. It is possible to inject the parameter in the command call that happens underneath I think. It should be very straightforward. I will open a PR to handle this 😃
Hi @andrew-fleming !
Glad to see you are using plugins. I reproduced the error you are having and diving into the NRE and how the plugins work there does not seem to be anything wrong.
Then, I looked at how click works internally for handling commands and… that’s where the issue is. If you check the click documentation about Command Return Values you will see something like this:
So, how to solve the issue? When you are using the plugin in a programmatic way with the
NREyou have to pass thestandalone_modeargument like this in order to retrieve the return value from the click command:Just tried it and it works as expected. Hope it helps 😃