Skip to content

Commit

Permalink
reasing off of [#801] and adding prometheus.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
charlyF committed Nov 14, 2017
1 parent 96ad61d commit c53fa39
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 13 deletions.
10 changes: 1 addition & 9 deletions kubernetes_state/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
# CHANGELOG - kubernetes_state
1.3.1 / 2017-10-12
==================
* [] Adding HPA metrics

1.4.0 / Unreleased
==================
### Changes

* [UPDATE] Update auto_conf template to support agent 6 and 5.20+. See [#860][]

1.4.0 / Unreleased
==================

### Changes

* [FEATURE] Adding HPA metrics. See [#801][]
* [FEATURE] Add metrics for GPU, PVC, CronJobs and other added in kubernetes_state 1.1.0. See [#853][]

1.3.0 / 2017-08-28
Expand Down
1 change: 1 addition & 0 deletions kubernetes_state/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ def __init__(self, name, init_config, agentConfig, instances=None):
'kube_replicationcontroller_status_observed_generation',
'kube_statefulset_metadata_generation',
'kube_statefulset_status_observed_generation',
'kube_hpa_metadata_generation',
# kube_node_status_phase and kube_namespace_status_phase have no use case as a service check
'kube_namespace_status_phase',
'kube_node_status_phase',
Expand Down
20 changes: 19 additions & 1 deletion kubernetes_state/ci/fixtures/prometheus/prometheus.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# HELP kube_hpa_metadata_generation The generation observed by the HorizontalPodAutoscaler controller.
# TYPE kube_hpa_metadata_generation gauge
kube_hpa_metadata_generation{hpa="hpa1",namespace="ns1"} 2
# HELP kube_hpa_spec_max_replicas Upper limit for the number of pods that can be set by the autoscaler; cannot be smaller than MinReplicas.
# TYPE kube_hpa_spec_max_replicas gauge
kube_hpa_spec_max_replicas{hpa="hpa1",namespace="ns1"} 4
# HELP kube_hpa_spec_min_replicas Lower limit for the number of pods that can be set by the autoscaler, default 1.
# TYPE kube_hpa_spec_min_replicas gauge
kube_hpa_spec_min_replicas{hpa="hpa1",namespace="ns1"} 2
# HELP kube_hpa_status_current_replicas Current number of replicas of pods managed by this autoscaler.
# TYPE kube_hpa_status_current_replicas gauge
kube_hpa_status_current_replicas{hpa="hpa1",namespace="ns1"} 2
# HELP kube_hpa_status_desired_replicas Desired number of replicas of pods managed by this autoscaler.
# TYPE kube_hpa_status_desired_replicas gauge
kube_hpa_status_desired_replicas{hpa="hpa1",namespace="ns1"} 2
# HELP kube_cronjob_created Unix creation timestamp
# TYPE kube_cronjob_created gauge
kube_cronjob_created{cronjob="hello",namespace="default"} 1.509978394e+09
Expand Down Expand Up @@ -228,6 +243,9 @@ kube_node_status_condition{condition="OutOfDisk",node="minikube",status="unknown
kube_node_status_condition{condition="Ready",node="minikube",status="false"} 0
kube_node_status_condition{condition="Ready",node="minikube",status="true"} 1
kube_node_status_condition{condition="Ready",node="minikube",status="unknown"} 0
# HELP kube_node_status_network_unavailable Whether the network is correctly configured for the node.
# TYPE kube_node_status_network_unavailable gauge
kube_node_status_network_unavailable{node="127.0.0.1",condition="false"} 1
# HELP kube_persistentvolumeclaim_info Information about persistent volume claim.
# TYPE kube_persistentvolumeclaim_info gauge
kube_persistentvolumeclaim_info{namespace="default",persistentvolumeclaim="task-pv-claim",storageclass="manual"} 1
Expand Down Expand Up @@ -747,4 +765,4 @@ kube_service_labels{label_component="apiserver",label_provider="kubernetes",name
kube_service_labels{label_app="helm",label_name="tiller",namespace="kube-system",service="tiller-deploy"} 1
kube_service_labels{label_addonmanager_kubernetes_io_mode="Reconcile",label_k8s_app="kube-dns",label_kubernetes_io_name="KubeDNS",namespace="kube-system",service="kube-dns"} 1
kube_service_labels{label_addonmanager_kubernetes_io_mode="Reconcile",label_app="kubernetes-dashboard",label_kubernetes_io_minikube_addons="dashboard",label_kubernetes_io_minikube_addons_endpoint="dashboard",namespace="kube-system",service="kubernetes-dashboard"} 1
kube_service_labels{label_app="kube-state-metrics",label_chart="kube-state-metrics-0.3.1",label_heritage="Tiller",label_release="jaundiced-numbat",namespace="default",service="jaundiced-numbat-kube-state-metrics"} 1
kube_service_labels{label_app="kube-state-metrics",label_chart="kube-state-metrics-0.3.1",label_heritage="Tiller",label_release="jaundiced-numbat",namespace="default",service="jaundiced-numbat-kube-state-metrics"} 1
Binary file not shown.
5 changes: 2 additions & 3 deletions kubernetes_state/test_kubernetes_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from tests.checks.common import AgentCheckTest

NAMESPACE = 'kubernetes_state'

class TestKubernetesState(AgentCheckTest):

CHECK_NAME = 'kubernetes_state'
Expand Down Expand Up @@ -118,9 +117,9 @@ def test__update_kube_state_metrics(self, mock_poll):

@mock.patch('checks.prometheus_check.PrometheusCheck.poll')
def test__update_kube_state_metrics_v040(self, mock_poll):
f_name = os.path.join(os.path.dirname(__file__), 'ci', 'fixtures', 'prometheus', 'protobuf.bin')
f_name = os.path.join(os.path.dirname(__file__), 'ci', 'fixtures', 'prometheus', 'prometheus.txt')
with open(f_name, 'rb') as f:
mock_poll.return_value = ('application/vnd.google.protobuf', f.read())
mock_poll.return_value = ('text/plain', f.read())

config = {
'instances': [{
Expand Down

0 comments on commit c53fa39

Please sign in to comment.