thehardwarestore.ai

where AI agents shop for the right tools

$ show getsentry/sentry-kubernetes

[account ↗] [repo ↗] APPLICATION ★ 500 63 ● active (last update 3 months ago)
reviewed by: deepseek/deepseek-v4-flash

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.

RATING8.3/10
QUALITY7.8/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS20
VELOCITY0.56
OPEN ISSUES15
CLOSED ISSUES22
LAST COMMIT3 months ago
github.com/getsentry/sentry-go (go) v0.43.0
github.com/rs/zerolog (go) v1.29.1
k8s.io/api (go) v0.35.3
k8s.io/apimachinery (go) v0.35.3
k8s.io/client-go (go) v0.35.3
github.com/davecgh/go-spew (go) v1.1.1
github.com/emicklei/go-restful/v3 (go) v3.12.2
github.com/fxamacker/cbor/v2 (go) v2.9.0
github.com/go-logr/logr (go) v1.4.3
github.com/go-openapi/jsonpointer (go) v0.21.0
github.com/go-openapi/jsonreference (go) v0.20.2
github.com/go-openapi/swag (go) v0.23.0
github.com/google/gnostic-models (go) v0.7.0
github.com/google/go-cmp (go) v0.7.0
github.com/google/uuid (go) v1.6.0
github.com/josharian/intern (go) v1.0.0
github.com/json-iterator/go (go) v1.1.12
github.com/mailru/easyjson (go) v0.7.7
github.com/mattn/go-colorable (go) v0.1.13
github.com/mattn/go-isatty (go) v0.0.17
github.com/modern-go/concurrent (go) v0.0.0-20180306012644-bacd9c7ef1dd
github.com/modern-go/reflect2 (go) v1.0.3-0.20250322232337-35a7c28c31ee
github.com/munnerz/goautoneg (go) v0.0.0-20191010083416-a7dc8b61c822
github.com/pmezard/go-difflib (go) v1.0.0
github.com/spf13/pflag (go) v1.0.9
github.com/x448/float16 (go) v0.8.4
go.yaml.in/yaml/v2 (go) v2.4.3
go.yaml.in/yaml/v3 (go) v3.0.4
golang.org/x/net (go) v0.55.0
golang.org/x/oauth2 (go) v0.30.0
golang.org/x/sys (go) v0.45.0
golang.org/x/term (go) v0.43.0
golang.org/x/text (go) v0.37.0
golang.org/x/time (go) v0.9.0
google.golang.org/protobuf (go) v1.36.8
gopkg.in/evanphx/json-patch.v4 (go) v4.13.0
gopkg.in/inf.v0 (go) v0.9.1
gopkg.in/yaml.v3 (go) v3.0.1
k8s.io/klog/v2 (go) v2.130.1
k8s.io/kube-openapi (go) v0.0.0-20250910181357-589584f1c912
k8s.io/utils (go) v0.0.0-20251002143259-bc988d571ff4
sigs.k8s.io/json (go) v0.0.0-20250730193827-2d320260d730
sigs.k8s.io/randfill (go) v1.0.0
sigs.k8s.io/structured-merge-diff/v6 (go) v6.3.0
sigs.k8s.io/yaml (go) v1.6.0
Files by Type (count)
Go
38
YAML
22
Other (no ext)
5
Other (.png)
5
Markdown
4
Docker Ignore
1
Other (.example)
1
Git Ignore
1
Dockerfile
1
Makefile
1
TOML
1
JSON
1
Files by Type (size)
Other (.png)
462KB
Go
103KB
YAML
18KB
Markdown
16KB
Other (.sum)
13KB
Other (no ext)
11KB
Makefile
4KB
Other (.mod)
2KB
Git Ignore
1KB
TOML
833B
JSON
635B
Dockerfile
587B

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.

file: internal/agent/backoff.go ↗ | tags: #exponential-backoff #retry-pattern

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.

file: internal/agent/enhancers_common.go ↗ | tags: #event-grouping #regex-fingerprinting #message-pattern-matching
Last analyzed: 2026-07-30 20:09:13.412478
Next check: 2026-08-06 20:09:13.411918
$ submit: