Prometheus exporter for Kubernetes resources
Why not using kube-state-metrics? Because they refused to generate custom metrics for group="" resources (Pods, Secrets, ...).
If you don't need custom metrics for group="" resources, try to use kube-state-metrics for custom resources.
Usage:
kube-resource-exporter [OPTIONS]
Application Options:
--version Show version
--version.template= Version go template, eg {{.Version}}
--log.level=[trace|debug|info|warning|error] Log level (default: info) [$LOG_LEVEL]
--log.format=[logfmt|json] Log format (default: logfmt) [$LOG_FORMAT]
--log.source=[|short|file|full] Show source for every log message (useful for debugging and bug reports) [$LOG_SOURCE]
--log.color=[|auto|yes|no] Enable color for logs [$LOG_COLOR]
--log.time Show log time [$LOG_TIME]
--kubeconfig= Kuberentes config path (should be empty if in-cluster) [$KUBECONFIG]
--metric.label.name= Label for resource name (default: name) [$METRIC_LABEL_NAME]
--metric.label.namespace= Label for resource namespace (default: namespace) [$METRIC_LABEL_NAMESPACE]
--metric.label.gvr= Label for resource GroupVersionResource (default: gvr) [$METRIC_LABEL_GVR]
--metric.list.limit= Result limit for list calls to reduce server stress (paging) [$METRIC_LIST_LIMIT]
--metric.parallelism= Defines how many metrics should be processed at the same time (default: 5) [$METRIC_PARALLELISM]
--scrape.time= Scrape time (default: 30m) [$SCRAPE_TIME]
--config= Path to config file [$CONFIG]
--cache.path= Cache path (to folder, file://path... or azblob://storageaccount.blob.core.windows.net/containername or k8scm://{namespace}/{configmap}}) [$CACHE_PATH]
--server.bind= Server address (default: :8080) [$SERVER_BIND]
--server.timeout.read= Server read timeout (default: 5s) [$SERVER_TIMEOUT_READ]
--server.timeout.write= Server write timeout (default: 10s) [$SERVER_TIMEOUT_WRITE]
Help Options:
-h, --help Show this help message
see example.yaml
Supports in-cluster authentication or via KUBECONFIG file.
automemlimit is used for automatically detecting GOMEMLIMIT inside containers.
| Env var | Description |
|---|---|
AUTOMEMLIMIT=off |
Disabling auto memlimit |
GOMEMLIMIT=0.9 |
Limits golang memory to 90% of system/cgroup memory (keep some mem available to system; default is 0.9) |