$ show getsentry/sentry-kubernetes
This is a Go-based Kubernetes agent that watches cluster events (Kubernetes Event objects and Pod status changes) and sends them to Sentry for error tracking and monitoring. It runs as a read-only sidecar inside a Kubernetes cluster, using client-go informers and watchers to observe Jobs, CronJobs, Deployments, ReplicaSets, Events, and Pods. When a warning or error event occurs, the agent enriches it with Kubernetes metadata (owner references, node names, namespace) and captures it as a Sentry error event. It also supports Sentry Crons monitoring for CronJobs, custom DSN per resource via annotations, GKE integration for cluster metadata, and client-side filtering by event reason or source. The architecture is cleanly separated into watchers, enhancers, filters, and backoff logic, with comprehensive unit tests and CI/CD pipelines.
The LLM identified 2 files worth highlighting for reuse:
A standalone, well-tested exponential backoff implementation with configurable initial and maximum durations. It doubles the delay on each failure up to a cap and resets on success. The design is clean, thread-safe, and easily extractable for any retry logic in other Go projects.
Provides a reusable pattern-matching engine that uses regex capture groups to fingerprint Sentry events. It defines common Kubernetes error message patterns (e.g., OOM, readiness probe failures) and extracts dynamic values (e.g., process name, container name) to create stable fingerprints. The validation step ensures pattern integrity. This module can be adapted to group similar log messages in any event-driven system.