state_cronjob

package
v0.0.0-...-be347a3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

README

Kube-state-metrics/Cronjob

Version history

  • July 2019, v1.7.0

Resources

Docs for 1.7 release of kube-state-metrics cronjobs can be found here: https://github.com/kubernetes/kube-state-metrics/blob/release-1.7/docs/cronjob-metrics.md

Metrics insight

- kube_cronjob_labels{namespace,cronjob,label_run} Gauge
    
    Need to modify prometheus thing to be able to read this
    *Not added yet!*

- kube_cronjob_info{namespace,cronjob,schedule=,concurrency_policy} Gauge

- kube_cronjob_created{namespace,cronjob} Gauge
    
    Unix time

- kube_cronjob_status_active{namespace,cronjob} Gauge
    
    Contains the number of active pods working for this cronjob, will usually be 0 or 1, but I think this could be more than 1

- kube_cronjob_status_last_schedule_time{namespace,cronjob} Gauge
    
    Unix time

- kube_cronjob_spec_suspend{namespace,cronjob} Gauge

- kube_cronjob_spec_starting_deadline_seconds{namespace,cronjob} Gauge
        
    RE-TEST -- add deadline

- kube_cronjob_next_schedule_time{namespace,cronjob} Gauge
    
    Unix time

- kube_cronjob_annotations{namespace="default",cronjob="bye"}
    
    Marked as experimental
    *Not added yet!*

Setup environment for manual tests

Instructions for Linux and Kind. If you are using any other environment and need to adapt these instructions, please, update accordingly.

Deploy metricbeat pre-baked pod as recommended by the docs.

Kubernetes YAML chunk should look like:

- module: kubernetes
  enabled: true
  metricsets:
    - state_cronjob
  period: 10s
  hosts: ["kube-state-metrics:8080"]

Deploy kube-state-metrics. You can find the manifests here

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCronJobMetricSet

func NewCronJobMetricSet(base mb.BaseMetricSet) (mb.MetricSet, error)

NewCronJobMetricSet returns a prometheus based metricset for CronJobs

Types

type CronJobMetricSet

type CronJobMetricSet struct {
	mb.BaseMetricSet
	// contains filtered or unexported fields
}

CronJobMetricSet uses a prometheus based MetricSet that looks for mb.ModuleDataKey prefixed fields and puts then at the module level

Copying the code from other kube state metrics, this should be improved to avoid all these ugly tricks

func (*CronJobMetricSet) Fetch

func (m *CronJobMetricSet) Fetch(reporter mb.ReporterV2) error

Fetch prometheus metrics and treats those prefixed by mb.ModuleDataKey as module rooted fields at the event that gets reported

Copied from other kube state metrics.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL