AGENT SKILL

clay-observability

Set up comprehensive observability for Clay integrations with metrics, traces, and alerts. Use when implementing monitoring for Clay operations, setting up dashboards, or configuring alerting for Clay integration health. Trigger with phrases like "clay monitoring", "clay metrics", "clay observability", "monitor clay", "clay alerts", "clay tracing".

License 许可
MIT
最近更新
2026-03-20
Stars
★ 4
Forks
0

01 前言 Front Matter

name
clay-observability
author
Jeremy Longshore <jeremy@intentsolutions.io>
license
MIT
version
1.0.0
description
Set up comprehensive observability for Clay integrations with metrics, traces, and alerts. Use when implementing monitoring for Clay operations, setting up dashboards, or configuring alerting for Clay integration health. Trigger with phrases like "clay monitoring", "clay metrics", "clay observability", "monitor clay", "clay alerts", "clay tracing".
allowed-tools
Read, Write, Edit
compatible-with
claude-code, codex, openclaw

03 SKILL.md 正文

Clay Observability

Overview

Monitor Clay data enrichment pipeline health, credit consumption velocity, and enrichment success rates. Clay's credit-based pricing model means observability must track per-enrichment costs (email lookup: ~1 credit, company enrichment: ~5 credits, waterfall enrichment: variable).

Prerequisites

  • Clay Team or Enterprise plan
  • API access for usage queries
  • External metrics/alerting system

Instructions

Step 1: Track Credit Consumption in Real Time

set -euo pipefail
# Query current credit usage by table
curl "https://api.clay.com/v1/workspace/usage?group_by=table&period=today" \
  -H "Authorization: Bearer $CLAY_API_KEY" | \
  jq '.usage[] | {table_name, credits_used, rows_enriched, avg_credits_per_row: (.credits_used / (.rows_enriched + 0.01))}'

Step 2: Monitor Enrichment Hit Rates

// clay-enrichment-monitor.ts
async function monitorEnrichments() {
  const tables = await clayApi.listTables();
  for (const table of tables) {
    const stats = await clayApi.getTableStats(table.id);
    const hitRate = stats.rows_with_data / Math.max(stats.total_rows, 1) * 100;
    emitGauge('clay_enrichment_hit_rate_pct', hitRate, { table: table.name, enrichment: stats.enrichment_type });
    emitCounter('clay_credits_consumed', stats.credits_used, { table: table.name });

    if (hitRate < 30) {
      console.warn(`Low hit rate on ${table.name}: ${hitRate.toFixed(1)}% (check enrichment config)`);
    }
  }
}

Step 3: Set Up Credit Burn Alerts

groups:
  - name: clay
    rules:
      - alert: ClayCreditBurnHigh
        expr: rate(clay_credits_consumed[1h]) > 500  # HTTP 500 Internal Server Error
        annotations: { summary: "Clay burning >500 credits/hour (projected monthly: {{ $value * 720 }})" }  # 720: HTTP 500 Internal Server Error
      - alert: ClayLowHitRate
        expr: clay_enrichment_hit_rate_pct < 20
        for: 30m
        annotations: { summary: "Clay enrichment hit rate below 20% on {{ $labels.table }}" }
      - alert: ClayCreditBalance
        expr: clay_credits_remaining < 1000  # 1000: 1 second in ms
        annotations: { summary: "Clay credit balance below 1,000 -- refill needed" }

Step 4: Log Enrichment Results for Audit

{"ts":"2026-03-10T14:30:00Z","table":"outbound-leads","enrichment":"email_finder","rows_attempted":100,"rows_enriched":72,"credits_used":100,"hit_rate":72.0,"duration_ms":4500}  # 2026: 4500 = configured value

Step 5: Build a Credit Efficiency Dashboard

Key panels: credit consumption by table (bar chart), enrichment hit rate by provider, daily/weekly credit burn trend, credits remaining gauge, and cost-per-enriched-row (credits used / rows with actual data returned). Tables with low hit rates and high credit burn are optimization targets.

Error Handling

Issue Cause Solution
Credits depleting fast Waterfall enrichment trying all providers Limit waterfall steps or set credit cap per row
Hit rate near 0% Bad input data (invalid emails/domains) Clean input data before enrichment
API timeout on enrichment Provider rate limit Reduce table auto-enrich concurrency
Usage API returning stale data Caching lag Wait 5 minutes for usage data to update

Examples

Basic usage: Apply clay observability to a standard project setup with default configuration options.

Advanced scenario: Customize clay observability for production environments with multiple constraints and team-specific requirements.

Output

  • Configuration files or code changes applied to the project
  • Validation report confirming correct implementation
  • Summary of changes made and their rationale

Resources

  • Official monitoring documentation
  • Community best practices and patterns
  • Related skills in this plugin pack

04 同仓库更多 Skills

micsapp
micsapp/micstec-skills

azure-apim-architecture

Analyzes and explains Azure API Management architecture decisions for enterprise API marketplace implementations using VNet Internal mode, Front Door, hybrid authentication, and multi-environment strategies. Use when discussing APIM component selection, network topology, cost optimization, or comparing alternatives like workspaces vs instances, VNet Internal vs External mode, or Front Door vs Application Gateway.

开发工程师后端与接口
★ 4
micsapp
micsapp/micstec-skills

apiops-deployment

Guides deployment of Azure API Management infrastructure using Infrastructure as Code (Bicep/Terraform), CI/CD pipelines (GitHub Actions/Azure DevOps), and APIOps workflows. Use when deploying APIM, creating pipelines, or implementing dev→test→prod promotion strategies.

开发工程师后端与接口运维与部署
★ 4
micsapp
micsapp/micstec-skills

apim-policy-authoring

Creates production-ready Azure API Management policy XML for authentication (OAuth 2.0, JWT validation, subscription keys), rate limiting, CORS configuration, error handling, and API transformations. Use when implementing API security, access control, or request/response processing logic.

后端与接口
★ 4
micsapp
micsapp/micstec-skills

api-security-review

Reviews Azure API Management configurations for security vulnerabilities, OWASP API Security Top 10 compliance, VNet Internal mode validation, Private Link verification, and Azure Security Benchmark alignment. Use when performing security audits, pre-deployment validation, or compliance reviews.

开发工程师后端与接口
★ 4
micsapp
micsapp/micstec-skills

jira-cli

Interact with Jira from the command line to create, list, view, edit, and transition issues, manage sprints and epics, and perform common Jira workflows. Use when the user asks about Jira tasks, tickets, issues, sprints, or needs to manage project work items.

★ 4
micsapp
micsapp/micstec-skills

calculator

Performs arbitrary-precision arithmetic calculations including addition, subtraction, multiplication, division, and exponents. Use when the user asks to calculate, compute, or evaluate math expressions, or when precise decimal arithmetic is needed to avoid floating-point errors.

★ 4