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
  • โš ๏ธ 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

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
  • 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.1.1.tar.gz (7.9 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.1.1-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: honeycomb_cleaner-0.1.1.tar.gz
  • Upload date:
  • Size: 7.9 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.1.1.tar.gz
Algorithm Hash digest
SHA256 b468e72244962043e8412121fbb14b14e25e92f9b6d187003244ab2131235ed9
MD5 f5d2444bbab6e5c581db61181a91ce88
BLAKE2b-256 b16e8e813bd7ac378ce42389926c7621e08d6169266168da2787b1e9619ea53a

See more details on using hashes here.

Provenance

The following attestation bundles were made for honeycomb_cleaner-0.1.1.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.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for honeycomb_cleaner-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 eced8389bb15cf783198ba44d02d91123c783bce40fb0475a3ecb0882b51c020
MD5 55124ec4256a54d84c98ec1b6de0628b
BLAKE2b-256 7568e5116f946cc0bd43fcc67b23e46e6fce77d840a7f9daccb6d63090bef1e6

See more details on using hashes here.

Provenance

The following attestation bundles were made for honeycomb_cleaner-0.1.1-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