anth-observability

Featured

Set up observability for Claude API integrations with metrics, logging, and alerting for latency, cost, errors, and token usage. Trigger with phrases like "anthropic monitoring", "claude observability", "anthropic metrics", "track claude usage", "claude dashboard".

AI & Automation 2,266 stars 315 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Anthropic Observability ## Overview Instrument Claude API calls with structured logging, Prometheus metrics, and cost tracking. Every API response includes `usage` data and rate limit headers — capture these for dashboards and alerting. ## Structured Logging ```python import anthropic import logging import time import json logger = logging.getLogger("claude") def create_with_logging(client: anthropic.Anthropic, **kwargs) -> anthropic.types.Message: start = time.monotonic() request_meta = { "model": kwargs.get("model"), "max_tokens": kwargs.get("max_tokens"), "tool_count": len(kwargs.get("tools", [])), "stream": kwargs.get("stream", False), } try: response = client.messages.create(**kwargs) duration_ms = int((time.monotonic() - start) * 1000) logger.info(json.dumps({ "event": "claude.request", "request_id": response._request_id, "model": response.model, "input_tokens": response.usage.input_tokens, "output_tokens": response.usage.output_tokens, "cache_read_tokens": getattr(response.usage, "cache_read_input_tokens", 0), "stop_reason": response.stop_reason, "duration_ms": duration_ms, "content_blocks": len(response.content), })) return response except anthropic.APIStatusError as e: duration_ms = int((time.monotonic() - start) * 1000) logger.error(json.dumps...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
7 months ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Featured

clade-observability

Monitor Claude API calls — log tokens, latency, costs, errors, and Use when working with observability patterns. set up alerts for production Claude integrations. Trigger with "anthropic monitoring", "claude observability", "track claude usage", "anthropic logging".

2,266 Updated today
jeremylongshore
AI & Automation Listed

claude-api

Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.

0 Updated today
CodeWithBehnam
AI & Automation Solid

claude-api

Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.

199,464 Updated today
affaan-m
AI & Automation Featured

anth-reference-architecture

Implement Claude API reference architectures for common use cases. Use when designing a Claude-powered application, choosing between direct API vs queue-based, or planning a multi-model architecture. Trigger with phrases like "anthropic architecture", "claude system design", "anthropic reference architecture", "design claude integration".

2,266 Updated today
jeremylongshore
AI & Automation Listed

claude-api

Build apps with the Claude API or Anthropic SDK. TRIGGER when: code imports `anthropic`/`@anthropic-ai/sdk`/`claude_agent_sdk`, or user asks to use Claude API, Anthropic SDKs, or Agent SDK. DO NOT TRIGGER when: code imports `openai`/other AI SDK, general programming, or ML/data-science tasks.

1 Updated 1 weeks ago
DROOdotFOO