Skip to main content
Monitor your Anthropic API usage and costs in real-time by collecting detailed metrics and logs with a custom OpenTelemetry collector. This integration provides comprehensive visibility into token consumption, feature usage, and cost attribution across models, workspaces, and API keys.

Overview

The Anthropic Usage & Cost Monitoring integration uses an OpenTelemetry receiver to collect detailed usage metrics and cost data from the Anthropic Admin API, transforming them into structured telemetry for monitoring and cost tracking in Honeycomb. What’s Collected:
  • Usage Metrics (minute-level granularity): Token consumption (input, output, cache), feature usage (web searches), grouped by model, tier, workspace, and API key
  • Cost Data (daily logs): Detailed cost breakdowns with workspace attribution and human-readable descriptions

Prerequisites

Custom Collector Setup

The Anthropic Usage Receiver is designed to be integrated into a custom OpenTelemetry Collector using the OpenTelemetry Collector Builder (OCB).
1

Install OpenTelemetry Collector Builder

Download the appropriate OCB binary for your platform:
2

Create Builder Configuration

Create a builder-config.yaml file that includes the Anthropic Usage Receiver:
3

Build Custom Collector

This generates a custom collector binary in the ./dist directory.

Deployment Options

Stateless Deployment

For environments where persistence isn’t required (e.g., short-lived containers, testing):

Stateful Deployment

For production environments where checkpoint persistence is important to prevent data loss during restarts:
Stateful vs Stateless:
  • Stateful: Maintains checkpoint state across restarts, preventing data loss and duplicate collection. Recommended for production.
  • Stateless: Simpler setup but may miss data during restarts. Suitable for testing or environments with external state management.

Run the Collector

Using the Anthropic Usage Board Template

Once your data is flowing into Honeycomb, use the pre-built Anthropic Usage & Cost Monitoring Board Template to instantly visualize your usage and costs:
  1. Navigate to Boards in the Honeycomb UI
  2. Select Templates or Create BoardsFrom Template
  3. Choose Anthropic Usage & Cost Monitoring template
  4. Review the template preview with your data
  5. If needed, map any fields in the Setup view to match your data structure
  6. Select Use Template to create your board
The template includes pre-configured visualizations for:
  • Token usage trends and patterns
  • Cost monitoring and attribution
  • Cache utilization analysis
  • Usage distribution across models and workspaces
The board template automatically works with data from the Anthropic Usage Receiver. If some queries show “Unable to display”, verify your collector is running and data is flowing to Honeycomb.

Configuration Reference

Usage Metrics

Cost Metrics

Key Attributes

Advanced Configuration

Filtering Data Collection

Limit data collection to specific models, tiers, or workspaces:

Multiple Exporters

Send data to multiple destinations:

Troubleshooting

Common Issues

No data appearing in Honeycomb:
  • Verify your Anthropic Admin API key has proper permissions
  • Check collector logs for authentication errors
  • Ensure your Honeycomb API key is configured correctly
Missing cost data:
  • Cost data is only available at daily granularity
  • Ensure cost.enabled: true in your configuration
  • Check that your Admin API key has cost visibility permissions
Checkpoint persistence not working:
  • Verify the storage directory is writable
  • Check that the file_storage extension is properly configured
  • Ensure the storage extension is referenced in the service section
High API usage:
  • Increase collection_interval to reduce API call frequency (minimum recommended: 1 minute)
  • Use filtering to collect only necessary data
  • Monitor the anthropic.scraper.up metric for health status
  • Note: Usage and cost data appears within 5 minutes of API request completion
Rate limiting:
  • The API is designed for polling once per minute maximum
  • Reduce polling frequency if you encounter rate limit errors
  • Consider caching results for frequently updated dashboards

Getting Help