
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
@dynatrace/api-client
Advanced tools
Welcome to the Dynatrace Api node module. This is a simple helper module for interacting with the Dynatrace API including caching support.
This plugin is community contributed and not officially supported by Dynatrace. In case of problems, feature requests, or questions submit a ticket on GitHub .
const { Dynatrace } = require("@davis/dynatrace");
const redis = require("redis").createClient();
const dynatrace = new Dynatrace({
baseUrl: "https://base-url-of-dynatrace-server",
apiToken: "api-token-of-dynatrace-server",
redis: redis, // this is optional
cacheTTL: 600, // defaults to 60. Time to cache entities in seconds
cachePrefix: "davis-redis-cache" // prefix for redis keys to prevent collisions
});
dynatrace
.problemFeed({
relativeTime: "day"
})
.then(problems => {
// Full list of problems here
console.log(`There were ${problems.length} problems in the last day.`);
// There were 191 problems in the last day.
return problems[0];
})
.then(problem => {
// single problem here
console.log(
`The first problem is a ${problem.status} ${problem.impactLevel} problem`
);
// The first problem is a CLOSED APPLICATION problem
return problem.getDetails();
})
.then(details => {
// more detailed problem information here
console.log(`with ${details.commentCount} comments.`);
// with 0 comments.
return details.addComment({
content: "Checked using the dynatrace nodejs client",
username: "@cto",
context: "nodejs client"
});
});
dynatrace
.applications({ tag: "davis" })
.then(apps => _.find(apps, a => a.displayName === "Davis"))
.then(davis => {
return davis.userActionDurationXHR({
queryMode: "total",
relativeTime: "day"
});
})
.then(data => {
console.log(util.inspect(data, null, null));
});
// βββββ{ dataPoints: βββββ
// βββββ { 'APPLICATION-7D7CBD136E0B9959': [ [ 1520351760000, 423683.00326322095 ] ] },βββββ
// βββββ timeseriesId: 'com.dynatrace.builtin:app.useractionduration.xhr',βββββ
// βββββ unit: 'MicroSecond (Β΅s)',βββββ
// βββββ entities: { 'APPLICATION-7D7CBD136E0B9959': 'Davis' },βββββ
// βββββ resolutionInMillisUTC: 86400000,βββββ
// βββββ aggregationType: 'AVG' }βββββ
async function deploy(entityId) {
const deployment = dynatrace.startDeployment({
deploymentName: "Test deployment",
deploymentProject: "dynatrace node module",
deploymentVersion: "0.0.1-7",
source: "dynatrace node module"
});
// helpers for setting API parameters
deployment.attachRules({ entityIds: [entityId] });
// Deployment things here
deployment.ciBackLink("https://link-to-ci");
return deployment.send();
}
async function deployments(entityId) {
dynatrace
.applications()
.then(apps => apps[0])
.then(app => app.deployments())
.then(console.log);
}
dynatrace
.applications()
.then(apps => apps[0])
.then(app =>
app.userActionsPerMinute({
relativeTime: "2hours",
queryMode: "total",
aggregationType: "avg"
})
);
FAQs
A NodeJS package for the Dynatrace REST API
We found that @dynatrace/api-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.Β It has 6 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.