documenso-observability
Implement monitoring, logging, and tracing for Documenso integrations. Use when setting up observability, implementing metrics collection, or debugging production issues. Trigger with phrases like "documenso monitoring", "documenso metrics", "documenso logging", "documenso tracing", "documenso observability".
Best use case
documenso-observability is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Implement monitoring, logging, and tracing for Documenso integrations. Use when setting up observability, implementing metrics collection, or debugging production issues. Trigger with phrases like "documenso monitoring", "documenso metrics", "documenso logging", "documenso tracing", "documenso observability".
Teams using documenso-observability should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/documenso-observability/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How documenso-observability Compares
| Feature / Agent | documenso-observability | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Implement monitoring, logging, and tracing for Documenso integrations. Use when setting up observability, implementing metrics collection, or debugging production issues. Trigger with phrases like "documenso monitoring", "documenso metrics", "documenso logging", "documenso tracing", "documenso observability".
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
ChatGPT vs Claude for Agent Skills
Compare ChatGPT and Claude for AI agent skills across coding, writing, research, and reusable workflow execution.
SKILL.md Source
# Documenso Observability
## Overview
Implement monitoring, structured logging, and health checks for Documenso integrations. Since Documenso does not expose rate limit headers or usage metrics via API, observability is built around your API call patterns, latency, error rates, and webhook delivery.
## Prerequisites
- Working Documenso integration
- Monitoring stack (Prometheus/Grafana, Datadog, or CloudWatch)
- Logging infrastructure
## Instructions
### Step 1: Instrumented Client Wrapper
```typescript
// src/observability/documenso-metrics.ts
import { Documenso } from "@documenso/sdk-typescript";
interface Metrics {
requestCount: number;
errorCount: number;
totalLatencyMs: number;
errorsByStatus: Record<number, number>;
}
const metrics: Metrics = {
requestCount: 0,
errorCount: 0,
totalLatencyMs: 0,
errorsByStatus: {},
};
export function createInstrumentedClient(): Documenso {
const client = new Documenso({ apiKey: process.env.DOCUMENSO_API_KEY! });
return new Proxy(client, {
get(target, prop) {
const value = (target as any)[prop];
if (typeof value === "object" && value !== null) {
return new Proxy(value, {
get(innerTarget, method) {
const fn = (innerTarget as any)[method];
if (typeof fn !== "function") return fn;
return async (...args: any[]) => {
const start = Date.now();
metrics.requestCount++;
try {
const result = await fn.apply(innerTarget, args);
metrics.totalLatencyMs += Date.now() - start;
return result;
} catch (err: any) {
metrics.errorCount++;
const status = err.statusCode ?? 0;
metrics.errorsByStatus[status] = (metrics.errorsByStatus[status] || 0) + 1;
metrics.totalLatencyMs += Date.now() - start;
throw err;
}
};
},
});
}
return value;
},
});
}
// Expose metrics for Prometheus scraping
export function getMetrics() {
return {
...metrics,
avgLatencyMs: metrics.requestCount > 0
? Math.round(metrics.totalLatencyMs / metrics.requestCount)
: 0,
errorRate: metrics.requestCount > 0
? (metrics.errorCount / metrics.requestCount * 100).toFixed(2) + "%"
: "0%",
};
}
```
### Step 2: Structured Logging
```typescript
// src/observability/logger.ts
import { createLogger, format, transports } from "winston";
const logger = createLogger({
level: process.env.LOG_LEVEL ?? "info",
format: format.combine(
format.timestamp(),
format.json()
),
defaultMeta: { service: "documenso-integration" },
transports: [
new transports.Console(),
// Add file or cloud transport for production
],
});
// Log Documenso operations with structured context
export function logDocumensoOperation(
operation: string,
documentId?: number,
extra?: Record<string, any>
) {
logger.info("documenso_operation", {
operation,
documentId,
...extra,
});
}
// Log errors with full context
export function logDocumensoError(
operation: string,
error: any,
documentId?: number
) {
logger.error("documenso_error", {
operation,
documentId,
statusCode: error.statusCode,
message: error.message,
// Never log API keys
});
}
```
### Step 3: Health Check Endpoint
```typescript
// src/api/health.ts
import { Documenso } from "@documenso/sdk-typescript";
interface HealthStatus {
status: "healthy" | "degraded" | "unhealthy";
latencyMs: number;
message: string;
}
async function checkDocumensoHealth(): Promise<HealthStatus> {
const client = new Documenso({ apiKey: process.env.DOCUMENSO_API_KEY! });
const start = Date.now();
try {
await client.documents.findV0({ page: 1, perPage: 1 });
const latencyMs = Date.now() - start;
if (latencyMs > 5000) {
return { status: "degraded", latencyMs, message: "High latency" };
}
return { status: "healthy", latencyMs, message: "OK" };
} catch (err: any) {
return {
status: "unhealthy",
latencyMs: Date.now() - start,
message: `${err.statusCode ?? "unknown"}: ${err.message}`,
};
}
}
// Express endpoint
app.get("/health/documenso", async (req, res) => {
const health = await checkDocumensoHealth();
const httpStatus = health.status === "healthy" ? 200 : health.status === "degraded" ? 200 : 503;
res.status(httpStatus).json(health);
});
```
### Step 4: Prometheus Metrics Endpoint
```typescript
// src/api/metrics.ts
import { getMetrics } from "../observability/documenso-metrics";
app.get("/metrics/documenso", (req, res) => {
const m = getMetrics();
res.type("text/plain").send(`
# HELP documenso_requests_total Total API requests
# TYPE documenso_requests_total counter
documenso_requests_total ${m.requestCount}
# HELP documenso_errors_total Total API errors
# TYPE documenso_errors_total counter
documenso_errors_total ${m.errorCount}
# HELP documenso_avg_latency_ms Average request latency
# TYPE documenso_avg_latency_ms gauge
documenso_avg_latency_ms ${m.avgLatencyMs}
`.trim());
});
```
### Step 5: Webhook Delivery Monitoring
```typescript
// Track webhook delivery success/failure
const webhookMetrics = {
received: 0,
processed: 0,
failed: 0,
byEvent: {} as Record<string, number>,
};
app.post("/webhooks/documenso", async (req, res) => {
webhookMetrics.received++;
const { event } = req.body;
webhookMetrics.byEvent[event] = (webhookMetrics.byEvent[event] || 0) + 1;
res.status(200).json({ received: true });
try {
await processWebhookEvent(req.body);
webhookMetrics.processed++;
} catch (err) {
webhookMetrics.failed++;
logDocumensoError("webhook_processing", err);
}
});
// Expose webhook metrics
app.get("/metrics/webhooks", (req, res) => {
res.json(webhookMetrics);
});
```
### Step 6: Alerting Rules
```yaml
# alerting-rules.yml (Prometheus)
groups:
- name: documenso
rules:
- alert: DocumensoHighErrorRate
expr: rate(documenso_errors_total[5m]) / rate(documenso_requests_total[5m]) > 0.05
for: 5m
labels:
severity: warning
annotations:
summary: "Documenso error rate above 5%"
- alert: DocumensoUnhealthy
expr: up{job="documenso-health"} == 0
for: 2m
labels:
severity: critical
annotations:
summary: "Documenso health check failing"
- alert: DocumensoHighLatency
expr: documenso_avg_latency_ms > 5000
for: 5m
labels:
severity: warning
annotations:
summary: "Documenso average latency above 5s"
```
## Key Metrics to Monitor
| Metric | Healthy | Warning | Critical |
|--------|---------|---------|----------|
| API error rate | < 1% | 1-5% | > 5% |
| Average latency | < 1s | 1-5s | > 5s |
| Health check | Passing | Degraded | Failing |
| Webhook delivery | > 99% | 95-99% | < 95% |
## Error Handling
| Observability Issue | Cause | Solution |
|--------------------|-------|----------|
| Metrics not appearing | Scrape config wrong | Verify Prometheus targets |
| Logs missing | Log level too high | Set `LOG_LEVEL=debug` temporarily |
| False alerts | Thresholds too sensitive | Adjust to match your traffic patterns |
| Health check flapping | Transient network issues | Add `for: 2m` to alert rules |
## Resources
- [Prometheus Best Practices](https://prometheus.io/docs/practices/)
- [OpenTelemetry Documentation](https://opentelemetry.io/docs/)
- [Winston Logger](https://github.com/winstonjs/winston)
## Next Steps
For incident response, see `documenso-incident-runbook`.Related Skills
windsurf-observability
Monitor Windsurf AI adoption, feature usage, and team productivity metrics. Use when tracking AI feature usage, measuring ROI, setting up dashboards, or analyzing Cascade effectiveness across your team. Trigger with phrases like "windsurf monitoring", "windsurf metrics", "windsurf analytics", "windsurf usage", "windsurf adoption".
webflow-observability
Set up observability for Webflow integrations — Prometheus metrics for API calls, OpenTelemetry tracing, structured logging with pino, Grafana dashboards, and alerting for rate limits, errors, and latency. Trigger with phrases like "webflow monitoring", "webflow metrics", "webflow observability", "monitor webflow", "webflow alerts", "webflow tracing".
vercel-observability
Set up Vercel observability with runtime logs, analytics, log drains, and OpenTelemetry tracing. Use when implementing monitoring for Vercel deployments, setting up log drains, or configuring alerting for function errors and performance. Trigger with phrases like "vercel monitoring", "vercel metrics", "vercel observability", "vercel logs", "vercel alerts", "vercel tracing".
veeva-observability
Veeva Vault observability for enterprise operations. Use when implementing advanced Veeva Vault patterns. Trigger: "veeva observability".
vastai-observability
Monitor Vast.ai GPU instance health, utilization, and costs. Use when setting up monitoring dashboards, configuring alerts, or tracking GPU utilization and spending. Trigger with phrases like "vastai monitoring", "vastai metrics", "vastai observability", "monitor vastai", "vastai alerts".
twinmind-observability
Monitor TwinMind transcription quality, meeting coverage, action item extraction rates, and memory vault health. Use when implementing observability, or managing TwinMind meeting AI operations. Trigger with phrases like "twinmind observability", "twinmind observability".
speak-observability
Monitor Speak API health, assessment latency, session metrics, and pronunciation score distributions. Use when implementing observability, or managing Speak language learning platform operations. Trigger with phrases like "speak observability", "speak observability".
snowflake-observability
Set up Snowflake observability using ACCOUNT_USAGE views, alerts, and external monitoring. Use when implementing Snowflake monitoring dashboards, setting up query performance tracking, or configuring alerting for warehouse and pipeline health. Trigger with phrases like "snowflake monitoring", "snowflake metrics", "snowflake observability", "snowflake dashboard", "snowflake alerts".
shopify-observability
Set up observability for Shopify app integrations with query cost tracking, rate limit monitoring, webhook delivery metrics, and structured logging. Trigger with phrases like "shopify monitoring", "shopify metrics", "shopify observability", "monitor shopify API", "shopify alerts", "shopify dashboard".
salesforce-observability
Set up observability for Salesforce integrations with API limit monitoring, error tracking, and alerting. Use when implementing monitoring for Salesforce operations, tracking API consumption, or configuring alerting for Salesforce integration health. Trigger with phrases like "salesforce monitoring", "salesforce metrics", "salesforce observability", "monitor salesforce", "salesforce alerts", "salesforce API usage dashboard".
retellai-observability
Retell AI observability — AI voice agent and phone call automation. Use when working with Retell AI for voice agents, phone calls, or telephony. Trigger with phrases like "retell observability", "retellai-observability", "voice agent".
replit-observability
Monitor Replit deployments with health checks, uptime tracking, resource usage, and alerting. Use when setting up monitoring for Replit apps, building health dashboards, or configuring alerting for deployment health and performance. Trigger with phrases like "replit monitoring", "replit metrics", "replit observability", "monitor replit", "replit alerts", "replit uptime".