robusta icon indicating copy to clipboard operation
robusta copied to clipboard

UI / Jobs / Ability to show logs and remove jobs

Open lictw opened this issue 1 year ago • 4 comments

On alert, we often just want to delete a failed job after logs check.

lictw avatar Jan 16 '23 10:01 lictw

Thanks for reporting it @lictw

By default, we have this playbook, which is doing something similar:

- triggers:
  - on_prometheus_alert:
      alert_name: KubeJobFailed
  - on_prometheus_alert:
      alert_name: KubeJobCompletion
  actions:
  - job_info_enricher: {}
  - job_events_enricher: {}
  - job_pod_enricher: {}

Basically, when ever the KubeJobFailed or KubeJobCompletion alerts are fired, we're running these 3 actions, which will get information about the job, the job events, and logs from the job pod.

These actions can be triggered by any alert that fires on a k8s job.

Can that work for you?

see: https://docs.robusta.dev/master/catalog/actions/event-enrichment.html#job-enrichers https://docs.robusta.dev/master/catalog/triggers/smart.html#job-failure

arikalon1 avatar Jan 16 '23 18:01 arikalon1

If you're referring to the UI, we're going to add these capabilities very soon (viewing logs and deleting the job).

arikalon1 avatar Jan 16 '23 19:01 arikalon1

Yes, it's about UI, but about pipeline posted by you: does it should send alerts after every job with detailed information, even successful? I don't have such alerts..

lictw avatar Jan 17 '23 20:01 lictw

By default, it's configured to run only on job alerts. (when a job is failed, or running for a long time) You could however, configure it to run for every job. For example:

- triggers:
  - on_job_create: {}
  actions:
  - job_info_enricher: {}
  - job_events_enricher: {}

arikalon1 avatar Jan 20 '23 07:01 arikalon1