Important: The fluent-plugin-kubernetes-metrics will reach End of Support on January 1, 2024. After that date, this repository will no longer receive updates from Splunk and will no longer be supported by Splunk. Until then, only critical security fixes and bug fixes will be provided.
The Fluentd input plugin collects Kubernetes cluster metrics which are exposed by the Kubelet API and forwards them to fluentd. The plugin collects metrics from:
- The kubelet summary API
- The kubelet stats API
- The cAdvisor metrics API
The Fluentd input plugin can be configured to fetch metrics from the Kubernetes API server or from the Kubelet. For more details on the specific metrics that are collected and aggregated with this plugin, please refer to the metrics information document.
See: Plugin Management.
$ gem install fluent-plugin-kubernetes-metrics
Add the following line to your Gemfile:
gem "fluent-plugin-kubernetes-metrics"
Then execute:
$ bundle
-
See also: Input Plugin Overview
The tag for the event.
Default value: kubernetes.metrics.*
.
How often the plugin should pull metrcs.
Default value: 15s
.
Path to a kubeconfig file that points to a cluster from which the plugin should collect metrics. Mostly useful when running fluentd outside of the cluster. When kubeconfig
is set, kubernetes_url
, client_cert
, client_key
, ca_file
, insecure_ssl
, bearer_token_file
, and secret_dir
are ignored.
URL of the kubernetes API server.
Path to the certificate file for this client.
Path to the private key file for this client.
Path to the CA file.
If insecure_ssl
is set to true
, apiserver's certificate is not verified.
Path to the file that contains the API token. The default value is the file "token" in secret_dir
.
Path of the location where the pod's service account credentials are stored.
Default value: /var/run/secrets/kubernetes.io/serviceaccount
.
The name of the node from which the plugin should collect metrics. This enables the plugin to fetch metrics from a kubelet API. Used only when the use_rest_client configuration parameter is enabled.
Array of the nodes from which the this plugin should collect metrics. This enables the plugin to fetch metrics from kubeapiserver. Used only when use_rest_client configuration parameter is not enabled.
The hostname or IP address that kubelet will use to connect to. If not supplied, status.hostIP of the node is used to fetch metrics from the Kubelet API (via the $KUBERNETES_NODE_IP environment variable).
Default value: "#{ENV['KUBERNETES_NODE_IP']}"
.
The port that kubelet is listening on.
Default value: 10250
.
Enable to use the rest client to get the metrics from summary api on each kubelet.
Default value: true
.
Enable to use SSL for rest client.
Default value: true
.
See License.