{"repo":"YElayyat/otel-cardinality-processor","free":true,"listed":false,"github":"https://github.com/YElayyat/otel-cardinality-processor","clone":"git clone https://github.com/YElayyat/otel-cardinality-processor.git","description":"🛡️ Cardinality Guardian: A production-grade OpenTelemetry processor to prevent cardinality explosions and stop TSDB billing spikes.","language":"Go","stars":42,"topics":["cardinality","golang","observability","opentelemetry","opentelemetry-collector","otel","sre"],"license":"Apache-2.0","category":"analytics","readme_excerpt":"Cardinality Guardian An OpenTelemetry Collector processor that catches metric cardinality explosions before they reach your TSDB. It strips only the exploding label — not the entire data point. Your dashboards keep working. What it does A developer pushes code that logs raw exception strings into error.type . Yesterday that label had 5 unique values. Today it has 50,000 and climbing. Your Datadog bill noticed before you did. This processor sits in your OTel pipeline and detects labels with abnormal growth. It either strips them (enforcement mode) or tags them for routing (tag-only mode). The metric stays intact — only the bad label is removed. region and status survive. Your latency dashboards keep working. The 50,000 unique exception strings are gone. How it works Key design decisions: - Delta-based detection, not absolute thresholds. A label with 50K stable values is fine. A label that grew by 100 in the last epoch is a problem. The processor tracks growth rate using dual-epoch HyperLogLog++ sketches, so legitimate high-cardinality metrics aren't penalized. - 256-way sharding. Each shard has its own RWMutex . With 50 concurrent goroutines across 256 shards, average occupancy is 0.4 per shard. Contention is near zero. Shard selection is hash & 0xFF — one CPU cycle. - HLL++ with 2KB per tracker. Each sketch estimates cardinality regardless of whether 100 or 100M unique values have been observed. 1-2% accuracy. The axiomhq/hyperloglog library's InsertHash(uint64) path avoids a","default_branch":null,"files":null,"tree":[],"storefront":"/r/YElayyat","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/YElayyat/otel-cardinality-processor/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}