Giter Site home page Giter Site logo

Custom format for webhook handler about kubewatch HOT 7 OPEN

bugok avatar bugok commented on August 26, 2024
Custom format for webhook handler

from kubewatch.

Comments (7)

aantn avatar aantn commented on August 26, 2024 1

@bugok You might be interested in an open source I wrote, http://robusta.dev/

We implemented what you mentioned

from kubewatch.

aantn avatar aantn commented on August 26, 2024

I'm not the maintainer, but I'm curious about your usecase. I've forked kubewatch myself to add support for extra json in the webhook, albeit in slightly different way than you.

from kubewatch.

bugok avatar bugok commented on August 26, 2024

@aantn : Shalom :)
My use case is that I have an HTTP endpoint which can expect logs to be posted via a HTTP POST. That endpoint expects the request to be in that specific format.

Eventually, I also forked this repo internally and implemented a new handler (based on the webhook handler) which executes the HTTP POST in the format I expect.

I've also made a few other changes:

  • I output everything the event object has.
  • I added a 'cluster' attribute that I pass to the config. That doesn't relate to the events, but having a 'cluster' in the logging sample allows me to dump the logs from all my clusters to the same dataset, where I can filter by cluster.

from kubewatch.

aantn avatar aantn commented on August 26, 2024

@bugok Shalom shalom :)

By "everything the event has", I assume you're referring to the actual Kubernetes object that changed? I'm doing the same in my fork here: https://github.com/aantn/kubewatch

Out of curiousity, what is your use-case? An internal tool, I assume?

from kubewatch.

bugok avatar bugok commented on August 26, 2024

@aantn : I mean all attributes the event object has: https://github.com/bitnami-labs/kubewatch/blob/84a34db93ff9935ce133f4eb1175187154253685/pkg/event/event.go#L30-L38
As well as the message and the time of the event.

Currently, I just collect the data, but in the future I plan to:

  • Show recent (bad) events on a dashboard
  • Create alerts based on bad events which were logged.

Yes, all these are maintained by internal tools.

from kubewatch.

aantn avatar aantn commented on August 26, 2024

@bugok cool. I dump the entire k8s object to json on creates and deletes. For updates I dump both the old and new object so that you can diff them and see which fields changed. If that's useful, feel free to use it and send me any questions.

How are you doing the logic like determining which events are bad or when/how you should create alerts?

from kubewatch.

bugok avatar bugok commented on August 26, 2024

@aantn : I haven't yet defined the alerts. However, I'm planning to start with filtering events with status=Danger. I see that I get messages with CrashLoopBackOff, for example.

from kubewatch.

Related Issues (20)

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.