Kubernetes event reporter for Sentry
Switch branches/tags
Nothing to show
Clone or download
q3aiml and bretthoerner reduce mangling of involved object names (#15)
* reduce mangling of involved object names

The short_name logic seems to be targeted at pods, replicasets, and
statefulsets where parts of the name can be auto generated. In other
cases the short_name mangling is undesirable as it throws away relevant
parts of the name when the name contains dashes.  For example a Service
called "my-lb" would appear in the culprit only as "my".

This is an improvement but still imperfect because 1) it is quite
possible to create many of these objects directly without any generated
suffix and 2) even when a suffix is appended it is not always 2 segments
as currently assumed. A more complete fix likely requires querying
kubernetes for details about the involved object and determining the
closest object that is not automatically created by kubernetes to
attribute the culprit to.

* make configurable which object types to mangle

Default to current behavior and make change opt-in in case the Pod,
ReplicaSet, and StatefulSet trio is not correct for everyone.

* make opt-in actually opt-in
Latest commit a254c4b Oct 9, 2018



Errors and warnings in Kubernetes often go unnoticed by operators. Even when they are checked they are hard to read and understand in the context of what else is going on in the cluster. sentry-kubernetes is a small container you launch inside your Kubernetes cluster that will send errors and warnings to Sentry where they will be cleanly presented and intelligently grouped. Typical Sentry features such as notifications can then be used to help operation and developer visibility.

Create a new project on Sentry and use your DSN when launching the sentry-kubernetes container:

kubectl run sentry-kubernetes \
  --image getsentry/sentry-kubernetes \

Events are grouped in Sentry:


They come with useful tags for filtering, and breadcrumbs showing events that occurred prior to the warning/error:


And include all of the extra data attached to the event:


Install using helm charts

$ 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>