@dynatrace/oneagent

中文文档
1.325.69-1.0.0发布于 2025/12/15MITCommonJS近 30 天下载 8554

Dynatrace Node.js OneAgent for PaaS environments

原始使用文档
文档目录6 节
  1. Installation
  2. Deployment
  3. Deploying Dynatrace to AWS Lambda
  4. Deploying Dynatrace to Heroku
  5. Deploying Dynatrace to Cloud Foundry
  6. Licence

Dynatrace npm module for PaaS

This module adds enterprise grade monitoring for Node.js in PaaS environments that aren't supported by a dedicated integration. Before using this module, please review the Dynatrace documentation to make sure that there isn't already a marketplace integration or buildpack available for your platform.

Installation

  • Sign up for free and follow the instructions
  • Click on "Deploy Dynatrace"
  • Click on "Set up PaaS Integration"
  • Generate a PaaS token
  • Run $ npm install --save @dynatrace/oneagent in your project directory
  • Using the previously created credentials add the following code block as first statement to your application
try {
  require('@dynatrace/oneagent')({
    environmentid: '<environmentid>',
    apitoken: '<paastoken>',
    endpoint: '<endpoint url>', // specify endpoint url - not needed for SaaS customers
    rejectUnauthorized: true // default is false which allows to use a self-signed certificate, see more below
  });
} catch (err) {
  console.log('Failed to load OneAgent: ', err);
}

The rejectUnauthorized option controls TLS certificate verification for the initial request to /v1/deployment/installer/agent/connectioninfo. It has no impact to other OneAgent code module communication nor the monitored application. By default, certificate verification is only enforced for requests to Dynatrace domains (e.g., dynatrace.com).
To enforce TLS certificate verification for all connections and reject self-signed certificates, set rejectUnauthorized: true.

Emitting debug output

To enable debug output set the DEBUG environment variable to dynatrace*. For more detail see the debug module documentation.

Deployment

Deploying Dynatrace to AWS Lambda

Starting with Dynatrace OneAgent 1.207, Dynatrace offers a dedicated AWS Lambda layer to monitor Node.js based AWS Lambda functions. Please review the Dynatrace product news and documentation to learn more.

Deploying Dynatrace to Heroku

Starting with Dynatrace OneAgent 1.141, Dynatrace offers a dedicated buildpack for Heroku. Please refer to our documentation for further instructions.

Deploying Dynatrace to Cloud Foundry

Starting with Dynatrace OneAgent 1.131 and Cloud Foundry Node.js buildpack 1.6.10 Dynatrace is part of the buildpack. Using the buildpack is preferable to the npm module approach due to several improvements. For instance, you're no longer required to install a dependency on @dynatrace/oneagent in your project directory. You also no longer need to add a require statement as the first statement of your application. Please review the Dynatrace product news and documentation to learn more.

Licence

Licensed under the MIT License. See the LICENSE file for details.

版本与发布记录

@dynatrace/oneagent 共发布 202 个版本,首次发布于 2016/11/17;过去 12 个月发布了 2 个版本。

版本发布日期距今
1.325.69-1.0.0latest2025/12/1510 个月前
1.327.51-1.0.0next2025/12/1510 个月前
1.321.63-1.0.02025/09/261.1 年前
1.319.63-1.0.12025/09/251.1 年前
1.319.63-1.0.02025/08/181.2 年前
1.317.47-1.0.02025/07/171.3 年前

关于 @dynatrace/oneagent 的常见问题

@dynatrace/oneagent 是什么?

Dynatrace Node.js OneAgent for PaaS environments

如何安装 @dynatrace/oneagent?

在项目目录运行 npm install @dynatrace/oneagent,或使用 pnpm add / yarn add / bun add。

@dynatrace/oneagent 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/dynatrace__oneagent 是否存在。

@dynatrace/oneagent 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@dynatrace/oneagent 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=12。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@dynatrace/oneagent 可以商用吗?

@dynatrace/oneagent 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@dynatrace/oneagent 的下载量有多少?

根据 npm 官方下载统计,@dynatrace/oneagent 在 2026/10/13 – 2026/11/11 这 30 天内被下载 8,554 次,日均约 285 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@dynatrace/oneagent 还在维护吗?

最新版本 1.325.69-1.0.0 发布于 2025/12/15(10 个月前);至今共发布 202 个版本,其中过去 12 个月发布了 2 个;首次发布于 2016/11/17。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。