Giter Site home page Giter Site logo

k8s-sentry's Introduction

k8s-sentry

k8s-sentry is a simple tool to monitor a Kubernetes cluster and report all operational issues to Sentry.

Screenshot

There are two alternatives implementations:

k8s-sentry watches for several things:

  • All warning and error events
  • Pod containers terminating with a non-zero exit code
  • Pods failing completely

Deployment

See deploy for Kubernetes manifests and installation instructions.

Configuration

Configuration is done completely via environment variables.

Variable Description
SENTRY_DSN Required DSN for a Sentry project.
SENTRY_ENVIRONMENT Environment for Sentry issues. If not set the namespace is used as environment.
NAMESPACE Comma separated set of namespaces to minitor. If not set all namespaces are monitored (as far as permissions allow)

Issue grouping

k8s-sentry tries to be smart about grouping issues. To handle that several strategies are used:

  • all issues use the event type, event reason and event message as part of the fingerprint
  • events related to controlled Pods (for example Pods created through a ReplicaSet (which is automatically done if you use a StatefulSet or Deployment) are grouped by the ReplicateSet.
  • other events are grouped by the the involved object

Building

This project uses Go modules and requires Go 1.13 or later. From a git checkout you can build the binary using go build:

$ go build
go: downloading k8s.io/apimachinery v0.0.0-20191020214737-6c8691705fc5
go: downloading k8s.io/client-go v0.0.0-20191016111102-bec269661e48
go: downloading k8s.io/api v0.0.0-20191016110408-35e52d86657a
...

You can then run k8s-sentry directly (assuming you have a valid kubectl configuration):

$ ./k8s-sentry
2019/10/22 15:55:41 Warning: DSN environment variable not set. Can not report to Sentry
2019/10/22 15:55:41 Warning HorizontalPodAutoscaler/istio-ingressgateway: unable to get metrics for resource cpu: no metrics returned from resource metrics API
2019/10/22 15:55:41 Warning HorizontalPodAutoscaler/istio-pilot: unable to get metrics for resource cpu: no metrics returned from resource metrics API

k8s-sentry's People

Contributors

athak avatar flimzy avatar wichert avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.