Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion packages/kafka/_dev/build/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,24 @@ Please refer to the following [document](https://www.elastic.co/guide/en/ecs/cur

Please refer to the following [document](https://www.elastic.co/guide/en/ecs/current/ecs-field-reference.html) for detailed information on ECS fields.

{{fields "partition"}}
{{fields "partition"}}

### raft

The `raft` dataset collects metrics related to Kafka's Raft consensus algorithm implementation (KRaft), which is used for metadata management in Kafka without requiring ZooKeeper. KRaft mode is available in Kafka 3.0.0 and later versions.

This dataset includes metrics such as:
- Append and fetch records rates
- Commit latency (average and maximum)
- Current epoch, leader, and vote information
- High watermark and log offset metrics
- Node state and voter information
- Poll idle ratio

{{event "raft"}}

**ECS Field Reference**

Please refer to the following [document](https://www.elastic.co/guide/en/ecs/current/ecs-field-reference.html) for detailed information on ECS fields.

{{fields "raft"}}
5 changes: 5 additions & 0 deletions packages/kafka/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# newer versions go on top
- version: "1.20.0"
changes:
- description: Add raft data stream.
type: enhancement
link: https://github.com/elastic/integrations/pull/14616
- version: "1.19.0"
changes:
- description: Allow @custom pipeline access to event.original without setting preserve_original_event.
Expand Down
78 changes: 78 additions & 0 deletions packages/kafka/data_stream/raft/agent/stream/stream.yml.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
metricsets: ["jmx"]
hosts:
{{#each hosts}}
- {{this}}
{{/each}}
path: {{metrics_path}}
namespace: metrics
period: {{period}}
http_method: {{http_method}}
{{#if bearer_token_file}}
bearer_token_file: {{bearer_token_file}}
ssl.verification_mode: {{ssl.verification_mode}}
{{/if}}
{{#if ssl.certificate_authorities}}
ssl.certificate_authorities:
{{#each ssl.certificate_authorities}}
- {{this}}
{{/each}}
{{/if}}
{{#if ssl.certificate}}
ssl.certificate: {{ssl.certificate}}
{{/if}}
{{#if ssl.key}}
ssl.key: {{ssl.key}}
{{/if}}
{{#if ssl.key_passphrase}}
ssl.key_passphrase: {{ssl.key_passphrase}}
{{/if}}
{{#if ssl.ca_trusted_fingerprint}}
ssl.ca_trusted_fingerprint: {{ssl.ca_trusted_fingerprint}}
{{/if}}
username: {{username}}
password: {{password}}
jmx.mappings:
# Raft metrics
- mbean: 'kafka.server:type=raft-metrics'
attributes:
- attr: append-records-rate
field: append_records_rate
- attr: commit-latency-avg
field: commit_latency_avg
- attr: commit-latency-max
field: commit_latency_max
- attr: current-epoch
field: current_epoch
- attr: current-leader
field: current_leader
- attr: current-vote
field: current_vote
- attr: fetch-records-rate
field: fetch_records_rate
- attr: high-watermark
field: high_watermark
- attr: log-end-epoch
field: log_end_epoch
- attr: log-end-offset
field: log_end_offset
- attr: number-unknown-voter-connections
field: number_unknown_voter_connections
- attr: poll-idle-ratio-avg
field: poll_idle_ratio_avg
- attr: current-state
field: current_state
- attr: number-of-voters
field: number_of_voters
{{#if headers}}
{{headers}}
{{/if}}
{{#if connect_timeout}}
connect_timeout: {{connect_timeout}}
{{/if}}
{{#if timeout}}
timeout: {{timeout}}
{{/if}}
{{#if processors}}
processors:
{{processors}}
{{/if}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
description: Pipeline for processing Kafka Raft metrics.
processors:
- rename:
field: jolokia.metrics
target_field: kafka.raft
ignore_missing: true
ignore_failure: true
- remove:
field: jolokia
ignore_missing: true
ignore_failure: true
on_failure:
- set:
field: error.message
value: >-
Processor '{{{ _ingest.on_failure_processor_type }}}'
{{{#_ingest.on_failure_processor_tag}}} with tag '{{{ _ingest.on_failure_processor_tag }}}'
{{{/_ingest.on_failure_processor_tag}}} failed with message '{{{ _ingest.on_failure_message }}}'
94 changes: 94 additions & 0 deletions packages/kafka/data_stream/raft/fields/agent.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
- name: cloud
title: Cloud
group: 2
description: Fields related to the cloud or infrastructure the events are coming from.
footnote: 'Examples: If Metricbeat is running on an EC2 host and fetches data from its host, the cloud info contains the data about this machine. If Metricbeat runs on a remote machine outside the cloud and fetches data from a service running in the cloud, the field contains cloud data from the machine the service is running on.'
type: group
fields:
- name: account.id
level: extended
type: keyword
ignore_above: 1024
dimension: true
description: '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.'
example: 666777888999
- name: availability_zone
level: extended
type: keyword
ignore_above: 1024
dimension: true
description: Availability zone in which this host is running.
example: us-east-1c
- name: instance.id
level: extended
type: keyword
ignore_above: 1024
description: Instance ID of the host machine.
example: i-1234567890abcdef0
dimension: true
- name: provider
level: extended
type: keyword
ignore_above: 1024
description: Name of the cloud provider. Example values are aws, azure, gcp, or digitalocean.
example: aws
dimension: true
- name: region
level: extended
type: keyword
ignore_above: 1024
dimension: true
description: Region in which this host is running.
example: us-east-1
- name: image.id
type: keyword
description: Image ID for the cloud instance.
- name: container
title: Container
group: 2
description: 'Container fields are used for meta information about the specific container that is the source of information. These fields help correlate data based containers from any runtime.'
type: group
fields:
- name: id
level: core
type: keyword
ignore_above: 1024
description: Unique container id.
dimension: true
- name: host
title: Host
group: 2
description: 'A host is defined as a general computing instance. ECS host.* fields should be populated with details about the host on which the event happened, or from which the measurement was taken. Host types include hardware, virtual machines, Docker containers, and Kubernetes nodes.'
type: group
fields:
- name: name
level: core
type: keyword
ignore_above: 1024
dimension: true
description: '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.'
- name: containerized
type: boolean
description: >
If the host is a container.

- name: os.build
type: keyword
example: "18D109"
description: >
OS build information.

- name: os.codename
type: keyword
example: "stretch"
description: >
OS codename, if any.

- name: agent
title: Agent
type: group
fields:
- name: id
type: keyword
ignore_above: 1024
dimension: true
16 changes: 16 additions & 0 deletions packages/kafka/data_stream/raft/fields/base-fields.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
- name: data_stream.type
type: constant_keyword
description: Data stream type.
- name: event.module
type: constant_keyword
description: Event module
value: jolokia
- name: data_stream.dataset
type: constant_keyword
description: Data stream dataset.
- name: data_stream.namespace
type: constant_keyword
description: Data stream namespace.
- name: '@timestamp'
type: date
description: Event timestamp.
3 changes: 3 additions & 0 deletions packages/kafka/data_stream/raft/fields/ecs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- external: ecs
name: service.address
dimension: true
77 changes: 77 additions & 0 deletions packages/kafka/data_stream/raft/fields/fields.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
- name: kafka.raft
type: group
description: >
Kafka Raft metrics.
fields:
- name: append_records_rate
type: double
description: >
The average number of records appended per sec as the leader of the raft quorum.
metric_type: gauge
- name: commit_latency_avg
type: double
description: >
The average time in milliseconds to commit an entry in the raft log.
metric_type: gauge
unit: ms
- name: commit_latency_max
type: double
description: >
The maximum time in milliseconds to commit an entry in the raft log.
metric_type: gauge
unit: ms
- name: current_epoch
type: long
description: >
The current quorum epoch.
metric_type: gauge
- name: current_leader
type: long
description: >
The current quorum leader's id; -1 indicates unknown.
metric_type: gauge
- name: current_vote
type: long
description: >
The current voted id.
metric_type: gauge
- name: fetch_records_rate
type: double
description: >
The average number of records fetched from the leader of the raft quorum.
metric_type: gauge
- name: high_watermark
type: long
description: >
The high watermark maintained on this member; -1 if it is unknown.
metric_type: gauge
- name: log_end_epoch
type: long
description: >
The current raft log end epoch.
metric_type: gauge
- name: log_end_offset
type: long
description: >
The current raft log end offset.
metric_type: gauge
- name: number_unknown_voter_connections
type: double
description: >
Number of unknown voters whose connection information is not cached; would never be larger than quorum-size.
metric_type: gauge
- name: poll_idle_ratio_avg
type: double
description: >
The ratio of time the Raft IO thread is idle as opposed to doing work (e.g. handling requests or replicating from the leader).
metric_type: gauge
unit: percent
- name: current_state
type: keyword
description: >
The current state of this member; possible values are leader, candidate, voted, follower, unattached, observer.
- name: number_of_voters
type: double
description: >
Number of voters for a KRaft topic partition.
metric_type: gauge
Loading