Argus
SDK Setup

Node.js SDK

Install and configure the Argus Node.js SDK.

Installation

npm install @argus/sdk

Quick Start

import { ArgusClient } from '@argus/sdk';

const client = new ArgusClient({
  apiKey: 'your-api-key',
  endpoint: 'https://api.tryargus.cloud'
});

// Start automatic metric collection
client.start();

Sending Custom Metrics

await client.ingest({
  host: 'web-server-01',
  metrics: {
    cpu_percent: 42.5,
    memory_percent: 68.2,
    request_count: 1847
  },
  tags: {
    environment: 'production',
    service: 'api'
  }
});

Webhook Handler

The Node.js SDK includes an Express middleware for handling webhook events:

import { createArgusHandler } from '@argus/sdk';
import express from 'express';

const app = express();

const argusHandler = createArgusHandler({
  secret: 'your-webhook-secret',
  tools: {
    restart_service: async (params) => {
      // Handle restart
      return { success: true };
    },
    scale_up: async (params) => {
      // Handle scaling
      return { success: true };
    }
  }
});

app.use('/argus/webhook', argusHandler);

Configuration Options

OptionTypeDefaultDescription
apiKeystringRequiredYour Argus API key
endpointstringhttps://api.tryargus.cloudArgus API endpoint
intervalnumber60Collection interval in seconds
collectDockerbooleantrueCollect Docker metrics
collectProcessesbooleantrueCollect process metrics

On this page