dynatrace-agent-api
Advanced tools
Comparing version 1.1.1 to 2.0.0
{ | ||
"name": "dynatrace-agent-api", | ||
"version": "1.1.1", | ||
"description": "Node.js bindings for Dynatrace OneAgent", | ||
"engines":{"node": ">= 4.0.0"}, | ||
"main": "./lib/index.js", | ||
"version": "2.0.0", | ||
"description": "", | ||
"main": "index.js", | ||
"scripts": { | ||
@@ -12,22 +11,10 @@ "test": "echo \"Error: no test specified\" && exit 1" | ||
"type": "git", | ||
"url": "git+https://github.com/Dynatrace/nodejs-agent-api.git" | ||
"url": "git+https://github.com/npm/deprecate-holder.git" | ||
}, | ||
"keywords": [ | ||
"dynatrace", | ||
"ruxit", | ||
"tracing", | ||
"monitoring", | ||
"performance", | ||
"node.js", | ||
"sdk" | ||
], | ||
"author": "Daniel Khan <daniel.khan@dynatrace.com>", | ||
"license": "MIT", | ||
"author": "", | ||
"license": "ISC", | ||
"bugs": { | ||
"url": "https://github.com/Dynatrace/nodejs-agent-api/issues" | ||
"url": "https://github.com/npm/deprecate-holder/issues" | ||
}, | ||
"homepage": "https://github.com/Dynatrace/nodejs-agent-api#readme", | ||
"dependencies": { | ||
"debug": "^2.2.0" | ||
} | ||
"homepage": "https://github.com/npm/deprecate-holder#readme" | ||
} |
110
README.md
@@ -1,109 +0,5 @@ | ||
# Node.js API for Dynatrace OneAgent | ||
# Deprecated Package | ||
This module provides JavaScript bindings for Node.js applications | ||
monitored with [Dynatrace](https://www.dynatrace.com/technologies/nodejs-monitoring/). | ||
This package is no longer supported and has been deprecated. To avoid malicious use, npm is hanging on to the package name. | ||
## What does this module provide? | ||
The current version provides a method `passContext()` which passes transactional context | ||
through chains of callbacks for *currently not supported technologies*. | ||
Dynatrace supports many technologies out-of-the-box and context loss only happens | ||
in rare cases - so only use this module if transactions seem to be incomplete. | ||
## Quick Start | ||
Deprecated. Please use @dynatrace/agent-api instead. | ||
### Installation | ||
`$ npm install --save dynatrace-agent-api` | ||
### Usage | ||
#### Example: Regular callbacks | ||
```js | ||
const dta = require('dynatrace-agent-api')(); | ||
some.asyncFunction(someParam, dta.passContext(function(err, result) { | ||
// Context is preserved | ||
http.get('https://some-api.xyz/service', dta.passContext((res) => {})); | ||
})); | ||
``` | ||
#### Example: Express route with couchDB middleware and promises | ||
```js | ||
const dta = require('dynatrace-agent-api')(); | ||
function couchMiddleware(req, res, next) { | ||
couch.get("testdb", "123a3354452ddfa2973ec0a477000f7a").then(dta.passContext(couchCallback), err => { | ||
if(err) throw err; | ||
}).then(dta.passContext(next)); | ||
} | ||
router.get('/couchdb', couchMiddleware, (req, res, next) => { | ||
request.get('https://google.com', (err, result) => { | ||
res.send('hello'); | ||
}); | ||
}); | ||
``` | ||
### Please Note | ||
* Make sure that the module is required after Dynatrace agent. | ||
* Using this module will not cause any errors if no agent is present (e.g. in testing). | ||
* The wrapping needs to happen call time. | ||
```js | ||
// This will *NOT* work | ||
const wrappedFunction = dta.passContext(someFunction); | ||
some.asyncFunction('someParam', wrappedFunction); | ||
// This works | ||
some.asyncFunction('someParam', dta.passContext(someFunction)); | ||
``` | ||
## Further Information | ||
### What is transactional context? | ||
[Dynatrace's patented PurePath Technology®](https://www.dynatrace.com/en_us/application-performance-management/products/purepath-technology.html) captures timing and code level context for *all* transactions, | ||
end-to-end, from user click, across all tiers, to the database of record and back. | ||
Technically this means that Dynatrace adds transactional context to any inbound-, outbound- and function call of an application. | ||
### What does this mean for Node.js applications? | ||
Node.js is single threaded - its control flow is based on events and asynchronous callbacks. | ||
Let's look at an example for finding a document with mongoDB: | ||
```js | ||
function callback(err, document) { | ||
console.log(document.name); | ||
http.get('https://some-api.xyz/service', (res) => {}); | ||
// ^^^ °°°°°°°°°°° | ||
// Asynchronous call Asynchronous callback | ||
} | ||
collection.findOne({_id: doc_id}, callback); | ||
// ^^^^^^^ °°°°°°°° | ||
// Asynchronous call Asynchronous callback | ||
``` | ||
After `collection.findOne()` is executed asynchronously `callback()` will be called. | ||
`callback()` again contains an asynchronous call `http.get()` which performs an outbound http request. | ||
If there is a current transactional context, Dynatrace will transparently add a header containing a transaction id to this outbound request. | ||
The next tier - if instrumented with Dynatrace - will continue this transaction then. | ||
Without further intervention any transactional context would get lost between asynchronous invocation | ||
and a callback. | ||
Currently the only reliable way to pass over context information to a callback is called 'wrapping'. | ||
This means: Dynatrace will transparently wrap *supported* libraries to add context information. | ||
For every yet *unsupported* module `passContext()` can be used to provide transactional context to callbacks. | ||
## Disclaimer | ||
This module is supported by the Dynatrace Innovation Lab. | ||
Please use the issue tracker to report any problems or ask questions. | ||
## License | ||
Licensed under the MIT License. See the LICENSE file for details. | ||
Please contact support@npmjs.com if you have questions about this package. |
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
0
0
681
2
0
2
6
2
- Removeddebug@^2.2.0
- Removeddebug@2.6.9(transitive)
- Removedms@2.0.0(transitive)