Surface Kubernetes Errors with Sentry
Kubernetes, like a lot of other tools, can be noisy. Errors and warnings often go completely unnoticed in the event stream. Or sometimes they are noticed, but are hard to understand in the context of what else is happening in the cluster.
Sentry, unlike a lot of other tools, works to eliminate that noise as much as possible, including Kubernetes-related noise.
sentry-kubernetes is a small container that can be launched inside your Kubernetes cluster that sends errors and warnings to Sentry, where they will be cleanly presented and intelligently grouped. At that point, typical Sentry features, such as notifications, can help increase developer visibility.
You can create a Kubernetes Deployment to run
sentry-kubernetes, or use whatever workflow your organization has standardized. The simplest way to get started and try it out is to simply use
Create a new project on Sentry and use your DSN when launching the
kubectl run sentry-kubernetes \ --image getsentry/sentry-kubernetes \ --env="DSN=$YOUR_DSN"
Events are grouped in Sentry by the
kind of event. Only events at the
error levels are sent to the server:
They come with useful tags for filtering (such as
component) and breadcrumbs for showing events that occurred prior to the
And include all of the extra data attached to the event:
Helm is a tool for managing pre-configured Kubernetes resources.
sentry-kubernetes can (optionally) be installed by using the Helm chart: incubator/sentry-kubernetes as follows:
$ helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com/ "incubator" has been added to your repositories $ helm install incubator/sentry-kubernetes --name my-release --set sentry.dsn=<your-dsn>