Skip to main content

Clean up inactive datasets and columns in Honeycomb

Project description

Honeycomb Cleaner

PyPI Changelog Tests License

A command-line tool to clean up inactive datasets and columns in Honeycomb to reduce clutter and improve performance.

Features

  • ๐Ÿ—‚๏ธ Dataset Cleanup: Find and delete datasets with no activity in the last N days
  • ๐Ÿ“Š Column Cleanup: Find and delete unused columns in active datasets
  • ๐Ÿ›ก๏ธ Protection Handling: Automatically disable deletion protection when needed
  • ๐ŸŽฏ Selective Targeting: Filter by specific dataset names
  • ๐Ÿ“‹ Rich Tables: Beautiful output with clickable dataset URLs
  • ๐Ÿ“Š Progress Bars: Real-time progress tracking with error grouping
  • โš ๏ธ Safety First: Multiple confirmations before deletion

Run / Installation

You can run the tool directly using uvx

uvx honeycomb-cleaner

To install it permanently:

uv tool install honeycomb-cleaner

Configuration

Set your Honeycomb configuration API key as an environment variable:

export HONEYCOMB_API_KEY=your_api_key_here

Your API key needs the following permissions:

  • Send Events (to read dataset metadata)
  • Manage Queries and Columns (to read and delete columns)
  • Create Datasets (to delete datasets)

Usage

Basic Dataset Cleanup

# List datasets inactive for 60 days (default)
honeycomb-cleaner

# List datasets inactive for 30 days
honeycomb-cleaner --days 30

# Delete inactive datasets (interactive)
honeycomb-cleaner --delete

# Also delete datasets with deletion protection
honeycomb-cleaner --delete --delete-protected

Column Cleanup

# Check for unused columns in active datasets
honeycomb-cleaner --check-columns

# Check for columns unused in last 30 days
honeycomb-cleaner --check-columns --days 30

# Delete unused columns (interactive)
honeycomb-cleaner --check-columns --delete-columns

Selective Cleanup

# Only consider specific datasets
honeycomb-cleaner --name app-endpoints --name shipping-api

# Check columns in specific datasets only
honeycomb-cleaner --check-columns -n app-endpoints -n logs

# Delete datasets and columns for specific services
honeycomb-cleaner --delete --delete-protected --check-columns --delete-columns -n old-service

Combined Operations

# Complete cleanup: datasets + columns
honeycomb-cleaner --delete --delete-protected --check-columns --delete-columns

# Dry run: see what would be deleted
honeycomb-cleaner --check-columns --days 90

Command Line Options

Option Description
--days N Look back N days for activity (default: 60)
--delete Enable dataset deletion mode
--delete-protected Also delete datasets with deletion protection
--check-columns Check for unused columns in active datasets
--delete-columns Enable column deletion (requires --check-columns)
--name NAME / -n NAME Only consider specific datasets (can be used multiple times)
--api-key KEY Honeycomb API key (overrides environment variable)

Example Output

Honeycomb Environment: production

Found 85 active datasets
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“
โ”ƒ Name                        โ”ƒ Created    โ”ƒ Last Activity โ”ƒ URL                                                                           โ”ƒ
โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ
โ”‚ current-service             โ”‚ 2024-01-01 โ”‚ 2024-01-08    โ”‚ https://ui.honeycomb.io/team/environments/prod/datasets/current-service/home โ”‚
โ”‚ active-logs                 โ”‚ 2024-01-15 โ”‚ 2024-01-07    โ”‚ https://ui.honeycomb.io/team/environments/prod/datasets/active-logs/home     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Found 3 inactive datasets
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“
โ”ƒ Name                        โ”ƒ Created    โ”ƒ Last Activity โ”ƒ URL                                                                           โ”ƒ
โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ
โ”‚ old-service                 โ”‚ 2023-05-01 โ”‚ 2023-05-15    โ”‚ https://ui.honeycomb.io/team/environments/prod/datasets/old-service/home     โ”‚
โ”‚ test-dataset                โ”‚ 2023-06-01 โ”‚ Never         โ”‚ https://ui.honeycomb.io/team/environments/prod/datasets/test-dataset/home    โ”‚
โ”‚ legacy-logs                 โ”‚ 2023-04-01 โ”‚ 2023-04-20    โ”‚ https://ui.honeycomb.io/team/environments/prod/datasets/legacy-logs/home     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Checking columns in active datasets...
Found 245 inactive columns across 12 datasets

Inactive columns (last 60 days) - current-service (showing first 100 of 245)
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”“
โ”ƒ Column Name                     โ”ƒ Type   โ”ƒ Created    โ”ƒ Last Used  โ”ƒ Hidden โ”ƒ
โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ
โ”‚ debug_column                    โ”‚ string โ”‚ 2023-01-01 โ”‚ 2023-05-15 โ”‚ No     โ”‚
โ”‚ old_field                       โ”‚ int    โ”‚ 2023-02-01 โ”‚ Never      โ”‚ Yes    โ”‚
โ”‚ legacy_attribute                โ”‚ string โ”‚ 2023-03-01 โ”‚ 2023-06-01 โ”‚ No     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
... and 145 more columns

โš ๏ธ WARNING: COLUMN DELETION MODE โš ๏ธ
This action cannot be undone!

Do you want to delete 245 inactive columns? (yes I do/no): yes I do

 โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” 100% (245/245)
Deleting: legacy_attribute from current-service

โœ“ Deleted 242 columns successfully
โœ— Failed to delete 3 columns:

  HTTP 404:
    - missing_column from old-service
    - deleted_field from test-dataset

  Column not found:
    - nonexistent_column from active-logs

Summary: 242 deleted, 3 failed out of 245 total

Safety Features

  • Environment Display: Shows which Honeycomb environment you're working with
  • Multiple Confirmations: Requires explicit confirmation before deletion
  • Exact Text Matching: Must type "yes I do" exactly for final confirmation
  • Progress Tracking: Real-time progress bars with current item display
  • Error Grouping: Failed operations are grouped by error type for easy debugging
  • Error Handling: Clear error messages for API failures
  • Dry Run Mode: Preview what would be deleted without --delete flags

Common Use Cases

1. Regular Cleanup

# Monthly cleanup of old datasets and columns
honeycomb-cleaner --days 90 --delete --delete-protected --check-columns --delete-columns

2. Service Decommissioning

# Remove all traces of an old service
honeycomb-cleaner --delete --delete-protected --check-columns --delete-columns -n old-service-name

3. Development Environment Cleanup

# Clean up test datasets in dev environment
honeycomb-cleaner --days 30 --delete -n test-dataset -n debug-logs -n temp-data

4. Column-Only Cleanup

# Just clean up unused columns, keep all datasets
honeycomb-cleaner --check-columns --delete-columns --days 60

Troubleshooting

Permission Errors

If you get 401/403 errors, ensure your API key has the required permissions:

  • Go to Honeycomb UI โ†’ Environment Settings โ†’ API Keys
  • Edit your API key and add missing permissions

Deletion Protection

Some datasets may have deletion protection enabled. Use --delete-protected to automatically disable protection before deletion.

Large Datasets

For datasets with many columns (>100), only the first 100 are displayed in tables for performance reasons. All columns are still processed for deletion.

Development

To run from source:

cd honeycomb-cleaner
uv sync --dev
honeycomb-cleaner --help

License

License under Apache 2.0 . See LICENSE file.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

honeycomb_cleaner-0.2.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

honeycomb_cleaner-0.2-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file honeycomb_cleaner-0.2.tar.gz.

File metadata

  • Download URL: honeycomb_cleaner-0.2.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for honeycomb_cleaner-0.2.tar.gz
Algorithm Hash digest
SHA256 a8cfb7dd7bd2fe35d59462a249c64a4db711860d9f21c52ef19159b88b93bc0f
MD5 efa57d2937a209cf756382dadbf16a54
BLAKE2b-256 2c6b74c482fb15648edbde61fa9b1dae18d72d820493d900575303923dfbeb37

See more details on using hashes here.

Provenance

The following attestation bundles were made for honeycomb_cleaner-0.2.tar.gz:

Publisher: cd.yml on mgaitan/honeycomb-cleaner

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file honeycomb_cleaner-0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for honeycomb_cleaner-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 093ad781c41fed7956801a15aa9c1bc240211e25102602324b95929d3147ddb3
MD5 5b6a4933687e00430b62d45ce154bf0d
BLAKE2b-256 3f8ba083a2e9737fffc92481e3f895c475c653e9701dcabbd5cf00f2f30ec4d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for honeycomb_cleaner-0.2-py3-none-any.whl:

Publisher: cd.yml on mgaitan/honeycomb-cleaner

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page