cloudgrip
v1.1.4
Published
**CloudGrip** is the world’s first **AI-native observability platform**. It doesn’t just collect logs and metrics — it finds and fixes bugs in production **automatically**.
Downloads
39
Readme
CloudGrip SDK for Node.js
CloudGrip is the world’s first AI-native observability platform. It doesn’t just collect logs and metrics — it finds and fixes bugs in production automatically.
- ⚡️ Zero-config setup
- 🧠 Real-time AI root cause analysis
- 🔍 Detects the exact line of code causing a problem
- ✅ Auto-generates pull requests with the fix
CloudGrip turns observability from passive data collection into an active DevOps agent — fixing issues before users even notice.
👉 Learn more at cloudgrip.ai
Installation
npm install cloudgripGetting Started
🔹 Send Logs
import { CloudGrip } from 'cloudgrip';
const cg = new CloudGrip({
apiKey: 'cg_123456789',
});
cg.logger.info('User login', { userId: 'abc123' });
cg.logger.error(new Error('Something went wrong'), 'Failed to process request');🔹 Send Metrics
cg.metrics.counter('http.requests');
cg.metrics.histogram('http.request.duration', 245);
cg.metrics.gauge('heap.usage.bytes', process.memoryUsage().heapUsed);🔹 Send Traces
const spanId = cg.tracer.span('db_query', { traceId: 'abc123' });
// ... your code here ...
cg.tracer.endSpan(spanId);🔹 Use CloudGrip with Pino
import pino from 'pino';
const logger = pino({
transport: {
target: 'cloudgrip/transport',
options: {
apiKey: 'cg_123456789',
},
},
});
logger.info('This log is sent to CloudGrip');Log Levels
| Method | Level | Description |
|---------------|---------|-----------------------------------------------------|
| trace() | 10 | Most detailed logs — every step, for deep debugging |
| debug() | 20 | Internal debugging info |
| info() | 30 | Normal logs: service start, request handled, etc. |
| warn() | 40 | Something unexpected, but not broken |
| error() | 50 | An error occurred, but app continues to run |
| fatal() | 60 | Unrecoverable error, likely before shutdown |
Configuration
Pass the following options when creating the SDK instance:
const cg = new CloudGrip({
apiKey: 'cg_123456789',
host: 'https://telemetry-api.cloudgrip.ai', // optional
logLevel: 'info', // optional
logToConsole: true, // optional
maxBufferSize: 1000, // optional
flushIntervalMs: 5000, // optional
});| Option | Type | Required | Description |
|--------------------|-----------|----------|-----------------------------------------------------------------------------|
| apiKey | string | ✅ Yes | Your CloudGrip API key |
| host | string | No | Custom endpoint for telemetry export (defaults to CloudGrip API) |
| logLevel | string | No | Minimum log level (trace, debug, etc.). Default: trace |
| logToConsole | boolean | No | Whether to also print logs to stdout. Default: true in development |
| maxBufferSize | number | No | Max telemetry items buffered before flushing |
| flushIntervalMs | number | No | Time (ms) between automatic telemetry flushes |
Deployment Environment
The SDK automatically sets deployment.environment based on process.env.NODE_ENV.
If NODE_ENV is not set, it defaults to "development".
