Clean up inactive datasets and columns in Honeycomb
Project description
Honeycomb Cleaner
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
--deleteflags
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8cfb7dd7bd2fe35d59462a249c64a4db711860d9f21c52ef19159b88b93bc0f
|
|
| MD5 |
efa57d2937a209cf756382dadbf16a54
|
|
| BLAKE2b-256 |
2c6b74c482fb15648edbde61fa9b1dae18d72d820493d900575303923dfbeb37
|
Provenance
The following attestation bundles were made for honeycomb_cleaner-0.2.tar.gz:
Publisher:
cd.yml on mgaitan/honeycomb-cleaner
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
honeycomb_cleaner-0.2.tar.gz -
Subject digest:
a8cfb7dd7bd2fe35d59462a249c64a4db711860d9f21c52ef19159b88b93bc0f - Sigstore transparency entry: 271896914
- Sigstore integration time:
-
Permalink:
mgaitan/honeycomb-cleaner@7fd8164e1d5cfead7bfa003800b8b5331575d25b -
Branch / Tag:
refs/tags/0.2 - Owner: https://github.com/mgaitan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@7fd8164e1d5cfead7bfa003800b8b5331575d25b -
Trigger Event:
release
-
Statement type:
File details
Details for the file honeycomb_cleaner-0.2-py3-none-any.whl.
File metadata
- Download URL: honeycomb_cleaner-0.2-py3-none-any.whl
- Upload date:
- Size: 11.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
093ad781c41fed7956801a15aa9c1bc240211e25102602324b95929d3147ddb3
|
|
| MD5 |
5b6a4933687e00430b62d45ce154bf0d
|
|
| BLAKE2b-256 |
3f8ba083a2e9737fffc92481e3f895c475c653e9701dcabbd5cf00f2f30ec4d9
|
Provenance
The following attestation bundles were made for honeycomb_cleaner-0.2-py3-none-any.whl:
Publisher:
cd.yml on mgaitan/honeycomb-cleaner
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
honeycomb_cleaner-0.2-py3-none-any.whl -
Subject digest:
093ad781c41fed7956801a15aa9c1bc240211e25102602324b95929d3147ddb3 - Sigstore transparency entry: 271896916
- Sigstore integration time:
-
Permalink:
mgaitan/honeycomb-cleaner@7fd8164e1d5cfead7bfa003800b8b5331575d25b -
Branch / Tag:
refs/tags/0.2 - Owner: https://github.com/mgaitan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@7fd8164e1d5cfead7bfa003800b8b5331575d25b -
Trigger Event:
release
-
Statement type: