NodeJS
Datadog の調査レポート: サーバーレスの状態 レポート: サーバーレスの状態

NodeJS

Library ライブラリ
このページは日本語には対応しておりません。随時翻訳に取り組んでいます。翻訳に関してご質問やご意見ございましたら、お気軽にご連絡ください。

Overview

The Node.js integration allows you to collect and monitor your Node.js application logs, traces, and custom metrics.

Setup

Metric collection

The Node.js integration enables you to monitor a custom metric by instrumenting a few lines of code. For instance, you can have a metric that returns the number of page views or the time of any function call.

Instrumentation can be implemented using hot-shots, an open source DogStatsD client for Node.js.

For additional information about the Node.js integration, refer to this guide on submitting metrics.

  1. Install hot-shots with npm:

    npm install hot-shots
  2. Start instrumenting your code:

    var StatsD = require('hot-shots');
    var dogstatsd = new StatsD();
    
    // Increment a counter.
    dogstatsd.increment('page.views')
    

Trace collection

See the dedicated documentation for instrumenting your Node.js application for sending traces to Datadog.

Log collection

Available for Agent v6.0+

See the dedicated documentation to set up Node.js log collection for forwarding your logs to Datadog.

Troubleshooting

Need help? Contact Datadog support.

Further Reading