monitoring-mixins / mixtool

mixtool is a helper for easily working with jsonnet mixins.
Apache License 2.0
139 stars 15 forks source link

Generate runbook from mixins into markdown file #6

Closed metalmatze closed 6 years ago

metalmatze commented 6 years ago

This command mixtool runbook extracts multi line string descriptions from mixins and generates a markdown file.

Example alert object with runbook string:

{
  alert: 'KubeNodeNotReady',
  expr: |||
    kube_node_status_condition{%(kubeStateMetricsSelector)s,condition="Ready",status="true"} == 0
  ||| % $._config,
  labels: {
    severity: 'warning',
  },
  annotations: {
    message: 'Overcommited CPU resource requests on Pods, cannot tolerate node failure.',
  },
  'for': '1h',
+ runbook: |||
+   This is an awesome runbook text.
+ |||,
},

@brancz @squat

metalmatze commented 6 years ago

I've updated this PR to now use packr's virtual FS with libsonnet templates when compiling. PTAL.

simonpasquier commented 6 years ago

From my experience, vfsgen is pretty neat: its scope is well defined and it leverages only the standard library. packr seems to be very similar. The main difference I see between the 2 is that vfsgen doesn't even require you to install a binary for generating the assets (eg no go get ...).

metalmatze commented 6 years ago

That vfsgen doesn't need an extra binary sounds really good. I'll take a look. Thanks for your comment @simonpasquier!

metalmatze commented 6 years ago

I will merge this as it is for now, as we can easily change to vfsgen in the future.