Skip to content
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.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ https://github.com/elastic/beats/compare/v8.19.11\...v8.19.12[View commits]

**Metricbeat**

* Added `mode` and `codec` fields to the `elasticsearch.index` metricset.
* Enforce configurable size limits on incoming requests for `remote_write` metricset (`max_compressed_body_bytes`, `max_decoded_body_bytes`). https://github.com/elastic/beats/pull/48218[#48218]

**Osquerybeat**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# REQUIRED
# Kind can be one of:
# - breaking-change: a change to previously-documented behavior
# - deprecation: functionality that is being removed in a later release
# - bug-fix: fixes a problem in a previous version
# - enhancement: extends functionality but does not break or fix existing behavior
# - feature: new functionality
# - known-issue: problems that we are aware of in a given version
# - security: impacts on the security of a product or a user’s deployment.
# - upgrade: important information for someone upgrading from a prior version
# - other: does not fit into any of the other categories
kind: feature

# REQUIRED for all kinds
# Change summary; a 80ish characters long description of the change.
summary: Addition of Elasticsearch index mode and codec settings in Metricbeat index stats module.

# REQUIRED for breaking-change, deprecation, known-issue
# Long description; in case the summary is not enough to describe the change
# this field accommodate a description without length limits.
# description:

# REQUIRED for breaking-change, deprecation, known-issue
# impact:

# REQUIRED for breaking-change, deprecation, known-issue
# action:

# REQUIRED for all kinds
# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc.
component: metricbeat

# AUTOMATED
# OPTIONAL to manually add other PR URLs
# PR URL: A link the PR that added the changeset.
# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added.
# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number.
# Please provide it if you are adding a fragment for a different PR.
# pr: https://github.com/owner/repo/1234

# AUTOMATED
# OPTIONAL to manually add other issue URLs
# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of).
# If not present is automatically filled by the tooling with the issue linked to the PR number.
# issue: https://github.com/owner/repo/1234
8 changes: 8 additions & 0 deletions docs/reference/metricbeat/exported-fields-elasticsearch.md
Original file line number Diff line number Diff line change
Expand Up @@ -1370,6 +1370,14 @@ index
: type: keyword


**`elasticsearch.index.mode`**
: type: keyword


**`elasticsearch.index.codec`**
: type: keyword


**`elasticsearch.index.name`**
: Index name.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ Here is an example document generated by this metricset:
"tier_preference": "data_content",
"creation_date": 1731657995821,
"version": "8505000",
"mode": "time_series",
"codec": "default",
"hidden": true,
"shards": {
"total": 1,
Expand Down
2 changes: 1 addition & 1 deletion metricbeat/module/elasticsearch/fields.go

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions metricbeat/module/elasticsearch/index/_meta/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@
"tier_preference": "data_content",
"creation_date": 1731657995821,
"version": "8505000",
"mode": "time_series",
"codec": "default",
"hidden": true,
"shards": {
"total": 1,
Expand Down
4 changes: 4 additions & 0 deletions metricbeat/module/elasticsearch/index/_meta/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
type: date
- name: version
type: keyword
- name: mode
type: keyword
- name: codec
type: keyword
- name: name
type: keyword
description: >
Expand Down
11 changes: 10 additions & 1 deletion metricbeat/module/elasticsearch/index/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ type Index struct {
TierPreference string `json:"tier_preference,omitempty"`
CreationDate string `json:"creation_date,omitempty"`
Version string `json:"version,omitempty"`
Mode string `json:"mode,omitempty"`
Codec string `json:"codec,omitempty"`
Shards shardStats `json:"shards"`
}

Expand Down Expand Up @@ -196,7 +198,7 @@ func eventsMapping(
}

indicesSettingsPattern := "*,-.*"
indicesSettingsFilterPaths := []string{"*.settings.index.creation_date", "*.settings.index.**._tier_preference", "*.settings.index.version.created"}
indicesSettingsFilterPaths := []string{"*.settings.index.creation_date", "*.settings.index.**._tier_preference", "*.settings.index.version.created", "*.settings.index.mode", "*.settings.index.codec"}
indicesSettings, err := elasticsearch.GetIndexSettings(httpClient, httpClient.GetURI(), indicesSettingsPattern, indicesSettingsFilterPaths)
if err != nil {
return fmt.Errorf("failure retrieving index settings from Elasticsearch: %w", err)
Expand Down Expand Up @@ -336,6 +338,13 @@ func addIndexSettings(idx *Index, indicesSettings mapstr.M) error {

idx.Version = indexVersion

if indexMode, err := getIndexSettingForIndex(indexSettings, idx.Index, "index.mode"); err == nil {
idx.Mode = indexMode
}
if indexCodec, err := getIndexSettingForIndex(indexSettings, idx.Index, "index.codec"); err == nil {
idx.Codec = indexCodec
}

return nil
}

Expand Down
Loading