Kube-apiserver Metrics
Collect metrics from Kubernetes API Server with Elastic Agent.
Version |
1.57.0 (View all) |
Compatible Kibana version(s) |
8.12.0 or higher |
Supported Serverless project types |
Security Observability |
Subscription level |
Basic |
Metrics
apiserver
This is the apiserver
dataset of the Kubernetes package, in charge of retrieving metrics
from the Kubernetes API (available at /metrics
).
This metricset needs access to the apiserver
component of Kubernetes, accessible typically
by any POD via the kubernetes.default
service or via environment
variables (KUBERNETES_SERVICE_HOST
and KUBERNETES_SERVICE_PORT
).
If Leader Election is activated (default behaviour) only the elastic agent
which holds the leadership lock
will retrieve metrics from the apiserver
.
This is relevant in multi-node kubernetes cluster and prevents duplicate data.
When the API uses https, the pod will need to authenticate using its default token and trust the server using the appropriate CA file.
Configuration example using https and token based authentication:
In order to access the /metrics
path of the API service, some Kubernetes environments might
require the following permission to be added to a ClusterRole.
rules:
- nonResourceURLs:
- /metrics
verbs:
- get
An example event for apiserver
looks as following:
{
"kubernetes": {
"apiserver": {
"major": {
"version": "1"
},
"minor": {
"version": "27"
},
"request": {
"component": "apiserver",
"duration": {
"us": {
"bucket": {
"5000": 2,
"25000": 13,
"50000": 13,
"100000": 13,
"200000": 14,
"400000": 14,
"600000": 14,
"800000": 14,
"1000000": 14,
"1250000": 14,
"1500000": 14,
"2000000": 14,
"3000000": 14,
"4000000": 14,
"5000000": 14,
"6000000": 14,
"8000000": 14,
"10000000": 14,
"15000000": 14,
"20000000": 14,
"30000000": 14,
"45000000": 14,
"60000000": 14,
"+Inf": 14
},
"count": 14,
"sum": 215052
}
},
"group": "flowcontrol.apiserver.k8s.io",
"resource": "flowschemas",
"scope": "resource",
"subresource": "status",
"verb": "APPLY",
"version": "v1beta3"
}
}
}
}
Exported fields
Field | Description | Type | Unit | Metric Type |
---|---|---|---|---|
@timestamp | Date/time when the event originated. This is the date/time extracted from the event, typically representing when the event was generated by the source. If the event source has no original timestamp, this value is typically populated by the first time the event was received by the pipeline. Required field for all events. | date | ||
agent.id | Unique identifier of this agent (if one exists). Example: For Beats this would be beat.id. | keyword | ||
cloud.account.id | The cloud account or organization id used to identify different entities in a multi-tenant environment. Examples: AWS account id, Google Cloud ORG Id, or other unique identifier. | keyword | ||
cloud.availability_zone | Availability zone in which this host, resource, or service is located. | keyword | ||
cloud.image.id | Image ID for the cloud instance. | keyword | ||
cloud.instance.id | Instance ID of the host machine. | keyword | ||
cloud.instance.name | Instance name of the host machine. | keyword | ||
cloud.machine.type | Machine type of the host machine. | keyword | ||
cloud.project.id | The cloud project identifier. Examples: Google Cloud Project id, Azure Project id. | keyword | ||
cloud.provider | Name of the cloud provider. Example values are aws, azure, gcp, or digitalocean. | keyword | ||
cloud.region | Region in which this host, resource, or service is located. | keyword | ||
container.id | Unique container id. | keyword | ||
container.image.name | Name of the image the container was built on. | keyword | ||
container.labels | Image labels. | object | ||
container.name | Container name. | keyword | ||
data_stream.dataset | The field can contain anything that makes sense to signify the source of the data. Examples include nginx.access , prometheus , endpoint etc. For data streams that otherwise fit, but that do not have dataset set we use the value "generic" for the dataset value. event.dataset should have the same value as data_stream.dataset . Beyond the Elasticsearch data stream naming criteria noted above, the dataset value has additional restrictions: * Must not contain - * No longer than 100 characters | constant_keyword | ||
data_stream.namespace | A user defined namespace. Namespaces are useful to allow grouping of data. Many users already organize their indices this way, and the data stream naming scheme now provides this best practice as a default. Many users will populate this field with default . If no value is used, it falls back to default . Beyond the Elasticsearch index naming criteria noted above, namespace value has the additional restrictions: * Must not contain - * No longer than 100 characters | constant_keyword | ||
data_stream.type | An overarching type for the data stream. Currently allowed values are "logs" and "metrics". We expect to also add "traces" and "synthetics" in the near future. | constant_keyword | ||
ecs.version | ECS version this event conforms to. ecs.version is a required field and must exist in all events. When querying across multiple indices -- which may conform to slightly different ECS versions -- this field lets integrations adjust to the schema version of the events. | keyword | ||
host.architecture | Operating system architecture. | keyword | ||
host.containerized | If the host is a container. | boolean | ||
host.domain | Name of the domain of which the host is a member. For example, on Windows this could be the host's Active Directory domain or NetBIOS domain name. For Linux this could be the domain of the host's LDAP provider. | keyword | ||
host.hostname | Hostname of the host. It normally contains what the hostname command returns on the host machine. | keyword | ||
host.id | Unique host id. As hostname is not always unique, use values that are meaningful in your environment. Example: The current usage of beat.name . | keyword | ||
host.ip | Host ip addresses. | ip | ||
host.mac | Host MAC addresses. The notation format from RFC 7042 is suggested: Each octet (that is, 8-bit byte) is represented by two [uppercase] hexadecimal digits giving the value of the octet as an unsigned integer. Successive octets are separated by a hyphen. | keyword | ||
host.name | Name of the host. It can contain what hostname returns on Unix systems, the fully qualified domain name, or a name specified by the user. The sender decides which value to use. | keyword | ||
host.os.build | OS build information. | keyword | ||
host.os.codename | OS codename, if any. | keyword | ||
host.os.family | OS family (such as redhat, debian, freebsd, windows). | keyword | ||
host.os.kernel | Operating system kernel version as a raw string. | keyword | ||
host.os.name | Operating system name, without the version. | keyword | ||
host.os.name.text | Multi-field of host.os.name . | match_only_text | ||
host.os.platform | Operating system platform (such centos, ubuntu, windows). | keyword | ||
host.os.version | Operating system version as a raw string. | keyword | ||
host.type | Type of host. For Cloud providers this can be the machine type like t2.medium . If vm, this could be the container, for example, or other information meaningful in your environment. | keyword | ||
kubernetes.apiserver.audit.event.count | Number of audit events | long | counter | |
kubernetes.apiserver.audit.rejected.count | Number of audit rejected events | long | counter | |
kubernetes.apiserver.client.request.count | Number of requests as client | long | counter | |
kubernetes.apiserver.etcd.object.count | Number of kubernetes objects at etcd | long | gauge | |
kubernetes.apiserver.major.version | API Server major version. | keyword | ||
kubernetes.apiserver.minor.version | API Server minor version. | keyword | ||
kubernetes.apiserver.process.cpu.sec | CPU seconds | double | counter | |
kubernetes.apiserver.process.fds.open.count | Number of open file descriptors | long | gauge | |
kubernetes.apiserver.process.memory.resident.bytes | Bytes in resident memory | long | byte | gauge |
kubernetes.apiserver.process.memory.virtual.bytes | Bytes in virtual memory | long | byte | gauge |
kubernetes.apiserver.process.started.sec | Seconds since the process started | double | gauge | |
kubernetes.apiserver.request.code | HTTP code | keyword | ||
kubernetes.apiserver.request.component | Component handling the request | keyword | ||
kubernetes.apiserver.request.content_type | Request HTTP content type | keyword | ||
kubernetes.apiserver.request.count | Number of requests | long | counter | |
kubernetes.apiserver.request.current.count | Inflight requests | long | counter | |
kubernetes.apiserver.request.dry_run | Wether the request uses dry run | keyword | ||
kubernetes.apiserver.request.duration.us.bucket.* | Request duration, histogram buckets | object | ||
kubernetes.apiserver.request.duration.us.count | Request duration, number of operations | long | counter | |
kubernetes.apiserver.request.duration.us.sum | Request duration, sum in microseconds | long | micros | counter |
kubernetes.apiserver.request.group | API group for the resource | keyword | ||
kubernetes.apiserver.request.handler | Request handler | keyword | ||
kubernetes.apiserver.request.host | Request host | keyword | ||
kubernetes.apiserver.request.kind | Kind of request | keyword | ||
kubernetes.apiserver.request.longrunning.count | Number of requests active long running requests | long | counter | |
kubernetes.apiserver.request.method | HTTP method | keyword | ||
kubernetes.apiserver.request.resource | Requested resource | keyword | ||
kubernetes.apiserver.request.scope | Request scope (cluster, namespace, resource) | keyword | ||
kubernetes.apiserver.request.subresource | Requested subresource | keyword | ||
kubernetes.apiserver.request.verb | HTTP verb | keyword | ||
kubernetes.apiserver.request.version | version for the group | keyword | ||
kubernetes.apiserver.response.size.bytes.bucket.* | Response size distribution in bytes for each group, version, verb, resource, subresource, scope and component. | object | ||
kubernetes.apiserver.response.size.bytes.count | Number of responses to requests | long | counter | |
kubernetes.apiserver.response.size.bytes.sum | Sum of responses sizes in bytes | long | byte | counter |
kubernetes.apiserver.watch.events.kind | Resource kind of the watch event | keyword | ||
kubernetes.apiserver.watch.events.size.bytes.bucket.* | Watch event size distribution in bytes | object | ||
kubernetes.apiserver.watch.events.size.bytes.count | Number of watch events | long | counter | |
kubernetes.apiserver.watch.events.size.bytes.sum | Sum of watch events sizes in bytes | long | byte | counter |
orchestrator.cluster.name | Name of the cluster. | keyword | ||
orchestrator.cluster.url | URL of the API used to manage the cluster. | keyword | ||
service.address | Address where data about this service was collected from. This should be a URI, network address (ipv4:port or [ipv6]:port) or a resource path (sockets). | keyword | ||
service.type | The type of the service data is collected from. The type can be used to group and correlate logs and metrics from one service type. Example: If logs or metrics are collected from Elasticsearch, service.type would be elasticsearch . | keyword |
Changelog
Version | Details | Kibana version(s) |
---|---|---|
1.57.0 | Enhancement View pull request | 8.12.0 or higher |
1.56.0 | Enhancement View pull request | 8.12.0 or higher |
1.55.1 | Enhancement View pull request | 8.11.0 or higher |
1.55.0 | Enhancement View pull request | 8.11.0 or higher |
1.54.0 | Enhancement View pull request | 8.11.0 or higher |
1.53.0 | Enhancement View pull request | 8.11.0 or higher |
1.52.0 | Enhancement View pull request | 8.11.0 or higher |
1.51.0 | Enhancement View pull request | 8.10.2 or higher |
1.50.0 | Enhancement View pull request | 8.10.2 or higher |
1.49.0 | Enhancement View pull request | 8.10.2 or higher |
1.48.0 | Enhancement View pull request | 8.10.2 or higher |
1.47.0 | Enhancement View pull request | 8.10.2 or higher |
1.46.0 | Enhancement View pull request | 8.10.1 or higher |
1.45.0 | Enhancement View pull request | 8.10.0 or higher |
1.44.0 | Enhancement View pull request | 8.10.0 or higher |
1.43.1 | Enhancement View pull request | 8.8.0 or higher |
1.43.0 | Enhancement View pull request | 8.8.0 or higher |
1.42.0 | Enhancement View pull request | 8.8.0 or higher |
1.41.0 | Enhancement View pull request | 8.8.0 or higher |
1.40.0 | Bug fix View pull request | 8.8.0 or higher |
1.40.0-beta.2 | Bug fix View pull request | — |
1.40.0-beta.1 | Bug fix View pull request | — |
1.40.0-beta | Enhancement View pull request | — |
1.39.0 | Enhancement View pull request | 8.6.1 or higher |
1.38.1 | Enhancement View pull request | 8.6.1 or higher |
1.38.0 | Enhancement View pull request | 8.6.1 or higher |
1.37.0 | Enhancement View pull request | 8.6.1 or higher |
1.36.0 | Enhancement View pull request | 8.6.1 or higher |
1.35.0 | Enhancement View pull request | 8.6.1 or higher |
1.34.1 | Enhancement View pull request | 8.6.1 or higher |
1.34.0 | Enhancement View pull request | 8.6.1 or higher |
1.33.0 | Enhancement View pull request | 8.6.1 or higher |
1.32.2 | Enhancement View pull request | 8.6.1 or higher |
1.32.1 | Enhancement View pull request | 8.6.1 or higher |
1.32.0 | Enhancement View pull request | 8.6.1 or higher |
1.31.2 | Enhancement View pull request | 8.6.1 or higher |
1.31.1 | Enhancement View pull request | 8.6.1 or higher |
1.31.0 | Enhancement View pull request | 8.6.0 or higher |
1.30.0 | Enhancement View pull request | 8.6.0 or higher |
1.29.2 | Bug fix View pull request | 8.5.0 or higher |
1.29.1 | Bug fix View pull request | 8.5.0 or higher |
1.29.0 | Bug fix View pull request | 8.5.0 or higher |
1.28.2 | Bug fix View pull request | 8.5.0 or higher |
1.28.1 | Enhancement View pull request | 8.5.0 or higher |
1.28.0 | Enhancement View pull request | 8.5.0 or higher |
1.27.1 | Enhancement View pull request | 8.5.0 or higher |
1.27.0 | Enhancement View pull request | 8.5.0 or higher |
1.26.0 | Enhancement View pull request | 8.4.0 or higher |
1.25.0 | Enhancement View pull request | 8.4.0 or higher |
1.24.0 | Enhancement View pull request | 8.4.0 or higher |
1.23.1 | Enhancement View pull request | 8.4.0 or higher |
1.23.0 | Enhancement View pull request | 8.4.0 or higher |
1.22.1 | Enhancement View pull request | 8.4.0 or higher |
1.22.0 | Enhancement View pull request | 8.4.0 or higher |
1.21.2 | Bug fix View pull request | 8.3.0 or higher |
1.21.1 | Enhancement View pull request | 8.3.0 or higher |
1.21.0 | Enhancement View pull request | 8.3.0 or higher |
1.20.0 | Enhancement View pull request | 8.2.0 or higher |
1.19.1 | Enhancement View pull request | 8.2.0 or higher |
1.19.0 | Enhancement View pull request | 8.2.0 or higher |
1.18.1 | Enhancement View pull request | 8.2.0 or higher |
1.18.0 | Enhancement View pull request | 8.2.0 or higher |
1.17.3 | Bug fix View pull request | 7.16.0 or higher |
1.17.2 | Bug fix View pull request | 7.16.0 or higher |
1.17.1 | Enhancement View pull request | — |
1.17.0 | Enhancement View pull request | — |
1.16.0 | Enhancement View pull request | — |
1.15.0 | Enhancement View pull request | — |
1.14.3 | Bug fix View pull request | — |
1.14.2 | Bug fix View pull request | — |
1.14.1 | Bug fix View pull request | — |
1.14.0 | Enhancement View pull request | — |
1.13.0 | Enhancement View pull request | — |
1.12.0 | Enhancement View pull request | — |
1.11.0 | Enhancement View pull request | — |
1.10.0 | Enhancement View pull request | — |
1.9.0 | Enhancement View pull request | 7.16.0 or higher |
1.8.1 | Bug fix View pull request | 7.16.0 or higher |
1.8.0 | Enhancement View pull request | 7.16.0 or higher |
1.7.0 | Enhancement View pull request | 7.16.0 or higher |
1.6.0 | Enhancement View pull request | 7.16.0 or higher |
1.5.0 | Enhancement View pull request | 7.16.0 or higher |
1.4.2 | Enhancement View pull request | — |
1.4.1 | Enhancement View pull request | 8.0.0 or higher |
1.4.0 | Enhancement View pull request | — |
1.3.3 | Bug fix View pull request | — |
1.3.2 | Enhancement View pull request | — |
1.3.1 | Enhancement View pull request | — |
1.3.0 | Enhancement View pull request | — |
1.2.1 | Bug fix View pull request | — |
1.2.0 | Enhancement View pull request | — |
1.1.1 | Bug fix View pull request | — |
1.1.0 | Enhancement View pull request | 7.15.0 or higher |
1.0.0 | Enhancement View pull request | — |
0.14.1 | Enhancement View pull request | — |
0.14.0 | Enhancement View pull request | — |
0.13.0 | Enhancement View pull request | — |
0.12.2 | Bug fix View pull request | — |
0.12.1 | Bug fix View pull request | — |
0.12.0 | Enhancement View pull request | — |
0.11.1 | Enhancement View pull request | — |
0.11.0 | Enhancement View pull request | — |
0.10.0 | Enhancement View pull request | — |
0.9.1 | Bug fix View pull request | — |
0.9.0 | Enhancement View pull request | — |
0.8.0 | Enhancement View pull request | — |
0.7.0 | Enhancement View pull request | — |
0.6.0 | Enhancement View pull request | — |
0.5.3 | Enhancement View pull request | — |
0.5.2 | Bug fix View pull request | — |
0.5.1 | Bug fix View pull request | — |
0.5.0 | Enhancement View pull request | — |
0.4.5 | Enhancement View pull request | — |
0.4.4 | Enhancement View pull request | — |
0.4.3 | Bug fix View pull request | — |
0.4.2 | Bug fix View pull request | — |
0.4.1 | Enhancement View pull request | — |
0.1.0 | Enhancement View pull request | — |