Skip to content

[metricbeat]Add kubeproxy metrics #12312

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Jun 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Keep `etcd` followers members from reporting `leader` metricset events {pull}12004[12004]
- Add overview dashboard to Consul module {pull}10665[10665]
- New fields were added in the mysql/status metricset. {pull}12227[12227]
- Added kubernetes metricset `proxy`. {pull}12312[12312]
- Always report Pod UID in the `pod` metricset. {pull}12345[12345]
- Add Vsphere Virtual Machine operating system to `os` field in Vsphere virtualmachine module. {pull}12391[12391]
- Add validation for elasticsearch and kibana modules' metricsets when xpack.enabled is set to true. {pull}12386[12386]
Expand Down
6 changes: 6 additions & 0 deletions deploy/kubernetes/metricbeat-kubernetes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ data:
#bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
#ssl.certificate_authorities:
#- /var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt
- module: kubernetes
metricsets:
- proxy
period: 10s
host: ${NODE_NAME}
hosts: ["localhost:10249"]
---
# Deploy a Metricbeat instance per node for node metrics retrieval
apiVersion: extensions/v1beta1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,9 @@ data:
#bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
#ssl.certificate_authorities:
#- /var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt
- module: kubernetes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: a new line before this would improve readability

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks like beats yaml generation is removing any \n in there

metricsets:
- proxy
period: 10s
host: ${NODE_NAME}
hosts: ["localhost:10249"]
263 changes: 263 additions & 0 deletions metricbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -14166,6 +14166,269 @@ type: long

--

[float]
=== proxy

Kubernetes proxy server metrics



*`kubernetes.proxy.handler`*::
+
--
Request handler


type: keyword

--

*`kubernetes.proxy.code`*::
+
--
HTTP code


type: keyword

--

*`kubernetes.proxy.method`*::
+
--
HTTP method


type: keyword

--

*`kubernetes.proxy.host`*::
+
--
Request host


type: keyword

--


*`kubernetes.proxy.process.cpu.sec`*::
+
--
CPU seconds

type: double

--

*`kubernetes.proxy.process.memory.resident.bytes`*::
+
--
Bytes in resident memory

type: long

format: bytes

--

*`kubernetes.proxy.process.memory.virtual.bytes`*::
+
--
Bytes in virtual memory

type: long

format: bytes

--

*`kubernetes.proxy.process.fds.open.count`*::
+
--
Number of open file descriptors

type: long

--

*`kubernetes.proxy.process.started.sec`*::
+
--
Seconds since the process started

type: double

--


*`kubernetes.proxy.http.request.duration.us.percentile.*`*::
+
--
Request duration microseconds percentiles

type: object

--

*`kubernetes.proxy.http.request.duration.us.sum`*::
+
--
Request duration microseconds cumulative sum

type: double

--

*`kubernetes.proxy.http.request.duration.us.count`*::
+
--
Request count for duration

type: long

--

*`kubernetes.proxy.http.request.size.bytes.percentile.*`*::
+
--
Request size percentiles

type: object

--

*`kubernetes.proxy.http.request.size.bytes.sum`*::
+
--
Request size cumulative sum

type: long

format: bytes

--

*`kubernetes.proxy.http.request.size.bytes.count`*::
+
--
Request count for size

type: long

--

*`kubernetes.proxy.http.response.size.bytes.percentile.*`*::
+
--
Response size percentiles

type: object

--

*`kubernetes.proxy.http.response.size.bytes.sum`*::
+
--
Response size cumulative sum

type: long

format: bytes

--

*`kubernetes.proxy.http.response.size.bytes.count`*::
+
--
Response count

type: long

--

*`kubernetes.proxy.http.request.count`*::
+
--
Request count

type: long

--

*`kubernetes.proxy.client.request.count`*::
+
--
Number of requests as client


type: long

--

[float]
=== sync

kubeproxy proxy sync metrics



*`kubernetes.proxy.sync.rules.duration.us.sum`*::
+
--
SyncProxyRules duration, sum of durations in microseconds

type: long

--

*`kubernetes.proxy.sync.rules.duration.us.count`*::
+
--
SyncProxyRules duration, number of operations

type: long

--

*`kubernetes.proxy.sync.rules.duration.us.bucket.*`*::
+
--
SyncProxyRules duration, histogram buckets

type: object

--

*`kubernetes.proxy.sync.networkprogramming.duration.us.sum`*::
+
--
Network programming duration, sum in microseconds

type: long

--

*`kubernetes.proxy.sync.networkprogramming.duration.us.count`*::
+
--
Network programming duration, number of operations

type: long

--

*`kubernetes.proxy.sync.networkprogramming.duration.us.bucket.*`*::
+
--
Network programming duration, histogram buckets

type: object

--

[float]
=== container

Expand Down
12 changes: 12 additions & 0 deletions metricbeat/docs/modules/kubernetes.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ metricbeat.modules:
metricsets:
- apiserver
hosts: ["https://${KUBERNETES_SERVICE_HOST}:${KUBERNETES_SERVICE_PORT}"]

# Kubernetes proxy server
- module: kubernetes
enabled: true
metricsets:
- proxy
hosts: ["localhost:10249"]
period: 10s
----

This module supports TLS connections when using `ssl` config field, as described in <<configuration-ssl>>.
Expand All @@ -105,6 +113,8 @@ The following metricsets are available:

* <<metricbeat-metricset-kubernetes-pod,pod>>

* <<metricbeat-metricset-kubernetes-proxy,proxy>>

* <<metricbeat-metricset-kubernetes-state_container,state_container>>

* <<metricbeat-metricset-kubernetes-state_deployment,state_deployment>>
Expand All @@ -131,6 +141,8 @@ include::kubernetes/node.asciidoc[]

include::kubernetes/pod.asciidoc[]

include::kubernetes/proxy.asciidoc[]

include::kubernetes/state_container.asciidoc[]

include::kubernetes/state_deployment.asciidoc[]
Expand Down
21 changes: 21 additions & 0 deletions metricbeat/docs/modules/kubernetes/proxy.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
////
This file is generated! See scripts/docs_collector.py
////

[[metricbeat-metricset-kubernetes-proxy]]
=== Kubernetes proxy metricset

include::../../../module/kubernetes/proxy/_meta/docs.asciidoc[]


==== Fields

For a description of each field in the metricset, see the
<<exported-fields-kubernetes,exported fields>> section.

Here is an example document generated by this metricset:

[source,json]
----
include::../../../module/kubernetes/proxy/_meta/data.json[]
----
3 changes: 2 additions & 1 deletion metricbeat/docs/modules_list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,12 @@ This file is generated! See scripts/docs_collector.py
.2+| .2+| |<<metricbeat-metricset-kibana-stats,stats>>
|<<metricbeat-metricset-kibana-status,status>>
|<<metricbeat-module-kubernetes,Kubernetes>> |image:./images/icon-yes.png[Prebuilt dashboards are available] |
.13+| .13+| |<<metricbeat-metricset-kubernetes-apiserver,apiserver>>
.14+| .14+| |<<metricbeat-metricset-kubernetes-apiserver,apiserver>>
|<<metricbeat-metricset-kubernetes-container,container>>
|<<metricbeat-metricset-kubernetes-event,event>>
|<<metricbeat-metricset-kubernetes-node,node>>
|<<metricbeat-metricset-kubernetes-pod,pod>>
|<<metricbeat-metricset-kubernetes-proxy,proxy>>
|<<metricbeat-metricset-kubernetes-state_container,state_container>>
|<<metricbeat-metricset-kubernetes-state_deployment,state_deployment>>
|<<metricbeat-metricset-kubernetes-state_node,state_node>>
Expand Down
1 change: 1 addition & 0 deletions metricbeat/include/list.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions metricbeat/metricbeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,14 @@ metricbeat.modules:
- apiserver
hosts: ["https://${KUBERNETES_SERVICE_HOST}:${KUBERNETES_SERVICE_PORT}"]

# Kubernetes proxy server
- module: kubernetes
enabled: true
metricsets:
- proxy
hosts: ["localhost:10249"]
period: 10s

#--------------------------------- Kvm Module ---------------------------------
- module: kvm
metricsets: ["dommemstat"]
Expand Down
Loading