newrelic / node-newrelic-mysql Goto Github PK
View Code? Open in Web Editor NEWNew Relic MySQL instrumentation for the Node Agent
License: Apache License 2.0
New Relic MySQL instrumentation for the Node Agent
License: Apache License 2.0
Can grab from NR open source repo template
The setup for the node-agent should be used as a guide:
Would aim for all tests functioning for external PR's (forked repos) with these efforts.
Attempt to update tap to version 15.0.9 caused test failures because of extensive use of done
in before/after test setups. done
is called throughout the setup process. We suggest converting the setup to something more promise based and compatible with the tap setup and get rid of the async
usage.
Here's an example of the done being used as a callback in setup:
https://github.com/newrelic/node-newrelic-mysql/blob/main/tests/versioned/common/setup.js#L20-L42
This experimental repo needs to be brought up to current support standards.
See templates and decisions made in prior repos
Depending on the amount of content, may want to run by the docs team. They had a bit of consistency and branding changes to the main agent readme.
This package was experimental. All the functionality was folded into the agent in newrelic/node-newrelic#1136. We don't have any plans to add any functionality in this package. In fact it's causing us more headaches with snyk, and random CI updates.
A/C:
Ensure PR template up to expectations/standards.
We've been doing a bit of our own thing, so far. See other repos.
We are already in decent shape but do a pass for general things outlined in the Engineering Plan.
Helpful regex (ripgrep):
rg --pcre2 '(?<!SELECT)(// |^ *\*(?!/))(?! Copyright|.*Apache|.*eslint)'
As we configured our MySql RDS by using admin user , we're unable to deploy the agent since its asking for the Root credentials while deploying it ...
We have tried with creating the newrelic user by using the comment in new relic site , even though it asking for the same root credentials .. Please look in to this and advise at high priority ...
Also we're facing the issue in deploying the nginx agent , we stuck in this step and no idea how to proceed further to fix it while installing the ngnix agent .
NGINX status URL (default: http://127.0.0.1/status): http://127.0.0.1:8080/status
NGINX HTTP status page should be set up with a locally accessible URL in the conf server block.
See https://docs.newrelic.com/docs/integrations/host-integrations/host-integrations-list/nginx-monitoring-integration#config for more info.
==> Installing nginx-open-source-integration...failed.
One or more installations failed. Check the install log for more details: /home/ubuntu/.newrelic/newrelic-cli.log
New Relic installation complete!
Your data is available at https://one.newrelic.com/launcher/nr1-core.explorer?platform[filters]=&platform[accountId]=3271104
FATAL We encountered an error during the installation: exit status 2: See https://docs.newrelic.com/docs/integrations/host-integrations/host-integrations-list/nginx-monitoring-integration#config for more info.. If this problem persists please visit the documentation and support page for additional help here: https://one.newrelic.com/-/06vjAeZLKjP
FATAL We encountered an error during the installation: we couldn’t install the Java Agent Installer. Make sure Java is installed and running on this host and rerun the newrelic-cli command. If this problem persists please visit the documentation and support page for additional help here: https://one.newrelic.com/-/06vjAeZLKjP
Using mysql2
with promises is not instrumented and APM does not track SQL queries.
For instance, using knex
or objectionjs
causes the agent to simply not report any SQL queries.
This was asked last year, but as this is the official repo I thought creating the issue here would be better.
https://discuss.newrelic.com/t/feature-idea-any-plans-to-instrument-mysql2-promise-in-the-nodejs-agent/72101
Every source file in the repository should contain the copyright block heading on top:
/*
* Copyright 2020 New Relic Corporation. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/
This includes bash scripts (slightly different commenting style) and code examples. Does not include copy-paste templates.
NOTE: we want the Apache-2.0 license to land first so these are consistent and that license is the current active for the commit(s) applying these changes.
git ls-files | grep '\.js$' | grep -Ev '(.eslintrc|^newrelic)'
to see list of filestmp=$(mktemp) # Create a temporary file
trap "rm -f $tmp; exit 1" 0 1 2 3 13 15
header="/*
* Copyright 2020 New Relic Corporation. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/
"
for file in $(git ls-files | grep '\.js$' | grep -Ev '(.eslintrc|^newrelic)')
do
{
echo -e "$header"
cat $file
} > $tmp
mv $tmp $file
echo $file
done
rm -f $tmp
trap 0
Basically just resurrecting project file from: newrelic/opensource-website#468.
NOTE: defaultBranch field is now required. See: newrelic/opensource-website#523
https://github.com/newrelic/newrelic-oss-cli#third-party-notice-generation-for-npm-based-projects
-----
Portions copyright Node.js contributors. Depending on your existing libraries and package management settings,
your systems may call externally maintained libraries in addition to those listed above.
See [here](https://nodejs.org/en/docs/meta/topics/dependencies/) and [here](https://github.com/nodejs/node/blob/v4.3.1/LICENSE)
for additional details regarding externally maintained libraries and certain related licenses and notices.”
It looks like when 'execute' support was added in 2019 to the main agent mysql instrumentation, this module was not updated and we didn't have an issue to capture.
As such, a couple recent attempts to use mysql2/promise by customers and internal folks have had issues because they are using this function.
Whether we keep this module or merge back into the main agent, we should ensure this functionality works with mysql2/promise usages.
Here's one instance: #47 (comment)
Main agent reference:
https://github.com/newrelic/node-newrelic/blob/main/lib/instrumentation/mysql.js#L134-L136
newrelic/node-newrelic@d64f7de
Effort: Small
We've settled on main as the new default branch name.
This will involve creating and migrating to the new branch before deleting the prior. We'll also want to ensure we change the base of any existing PR's etc.
Hanselman has some helpful instructions on the blog: https://www.hanselman.com/blog/EasilyRenameYourGitDefaultBranchFromMasterToMain.aspx. I'm sure there are other useful resources out there as well.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.