Skip to content

metricbeats: update monitor mappings to include new TBS metrics#48432

Merged
ericywl merged 10 commits into
elastic:mainfrom
ericywl:tbs-monitoring
Feb 20, 2026
Merged

metricbeats: update monitor mappings to include new TBS metrics#48432
ericywl merged 10 commits into
elastic:mainfrom
ericywl:tbs-monitoring

Conversation

@ericywl

@ericywl ericywl commented Jan 15, 2026

Copy link
Copy Markdown
Contributor

Proposed commit message

Update metricbeat beat module mapping to contain latest apm-server monitoring metrics fields to improve TBS.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works. Where relevant, I have used the stresstest.sh script to run them under stress conditions and race detector to verify their stability.
  • I have added an entry in ./changelog/fragments using the changelog tool.

Author's Checklist

  • Verify mappings are present in the metricbeat-* datastream.

How to test this PR locally

Step 1: Ensure Elasticsearch & Kibana is running

> cd apm-server
> docker-compose up elasticsearch kibana

Step 2: Create APM Server config

Create an apm-server.yml config file:

apm-server:
  host: "127.0.0.1:8200"

output.elasticsearch:
  enabled: true
  hosts: ["http://localhost:9200"]
  username: "admin"
  password: "changeme"

http:
  enabled: true
  host: localhost
  port: 5066

Step 3: Start APM Server

Run APM Server binary directly:

> cd apm-server
> ./apm-server -e -v -c apm-server.yml

Step 4: Configure Metricbeat WITHOUT xpack

Create metricbeat.yml config file:

metricbeat.modules:
- module: beat
  metricsets:
    - state
    - stats
  period: 10s
  hosts: ["http://localhost:5066"]

output.elasticsearch:
  hosts: ["http://localhost:9200"]
  username: "admin"
  password: "changeme"

Step 5: Start Metricbeat

Run Metricbeat binary directly:

> cd beats
> make python-env
> source build/python-env/bin/activate
> cd beats/metricbeat
> make mage
> mage build

> sudo chown root modules.d/system.yml
> sudo chown root metricbeat.yml
> sudo ./metricbeat -c metricbeat.yml -e

Step 6: Verify Datastream

Verify fields in datastream metricbeat-*

GET metricbeat-*/_search
{
  "size": 1,
  "query": {
    "bool": {
      "must": [
        {"term": {"metricset.name": "stats"}},
        {"term": {"beat.type": "apm-server"}}
      ]
    }
  },
  "_source": ["beat.stats.apm_server.sampling.tail.storage"],
  "sort": [{"@timestamp": {"order": "desc"}}]
}

"hits": [
  {
    "_index": ".ds-metricbeat-9.3.0-2026.01.13-000001",
    "_id": "o1aSmZoBfa9YIotqCAfv",
    "_score": null,
    "_source": {
      "beat": {
        "stats": {
          "apm_server": {
            "sampling": {
              "tail": {
                "storage": {
                  "disk_total": 994662584320,
                  "disk_usage_threshold_pct": 80.2,
                  "disk_used": 336527384576,
                  "lsm_size": 10553,
                  "storage_limit": 0,
                  "value_log_size": 0
                }
              }
            }
          }
        }
      }
    },
    "sort": [
      1763513067282
    ]
  }
]

Verify mappings for datastream metricbeat-*

GET metricbeat-*/_mapping?filter_path=**.apm_server.**.storage

{
  ".ds-metricbeat-9.3.0-2026.01.14-000001": {
    "mappings": {
      "properties": {
        "beat": {
          "properties": {
            "stats": {
              "properties": {
                "apm_server": {
                  "properties": {
                    "sampling": {
                      "properties": {
                        "tail": {
                          "properties": {
                            "storage": {
                              "properties": {
                                "disk_total": {
                                  "type": "float"
                                },
                                "disk_usage_threshold_pct": {
                                  "type": "float"
                                },
                                "disk_used": {
                                  "type": "float"
                                },
                                "lsm_size": {
                                  "type": "long"
                                },
                                "storage_limit": {
                                  "type": "long"
                                },
                                "value_log_size": {
                                  "type": "long"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

Related issues

@ericywl ericywl requested review from a team as code owners January 15, 2026 05:22
@botelastic botelastic Bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jan 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🤖 GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)
@ericywl ericywl added Team:apm APM Server team issues/PRs >enhancement backport-active-8 Automated backport with mergify to all the active 8.[0-9]+ branches backport-active-9 Automated backport with mergify to all the active 9.[0-9]+ branches labels Jan 15, 2026
@ericywl ericywl self-assigned this Jan 15, 2026
@botelastic botelastic Bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jan 15, 2026
@github-actions

github-actions Bot commented Jan 15, 2026

Copy link
Copy Markdown
Contributor

🔍 Preview links for changed docs

@ericywl ericywl changed the title Tbs monitoring Jan 15, 2026

@pickypg pickypg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@consulthys

Copy link
Copy Markdown
Contributor

@ericywl thanks for this enhancement. Just out of curiosity, do you also intend to update the associated dashboards in the beat integration?

Comment thread metricbeat/module/beat/stats/_meta/test/apm-server.stats.712.json Outdated
Co-authored-by: Carson Ip <carsonip@users.noreply.github.com>
@ericywl ericywl removed the backport-active-8 Automated backport with mergify to all the active 8.[0-9]+ branches label Jan 15, 2026

@vishaangelova vishaangelova left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs LGTM

@ericywl ericywl merged commit 112c334 into elastic:main Feb 20, 2026
45 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

@Mergifyio backport 9.2 9.3

@mergify

mergify Bot commented Feb 20, 2026

Copy link
Copy Markdown
Contributor

backport 9.2 9.3

✅ Backports have been created

Details
mergify Bot pushed a commit that referenced this pull request Feb 20, 2026
* apm[monitoring]: update monitor fields to include new TBS metrics

* doc: add new apm-server TBS metrics

* Change disk_usage_threshold long -> disk_usage_threshold_pct float

* Run make update

* Update metricbeat/module/beat/stats/_meta/test/apm-server.stats.712.json

Co-authored-by: Carson Ip <carsonip@users.noreply.github.com>

* Add fragment

---------

Co-authored-by: Ruben van Staden <ruben.vanstaden@elastic.co>
Co-authored-by: Carson Ip <carsonip@users.noreply.github.com>
(cherry picked from commit 112c334)
mergify Bot pushed a commit that referenced this pull request Feb 20, 2026
* apm[monitoring]: update monitor fields to include new TBS metrics

* doc: add new apm-server TBS metrics

* Change disk_usage_threshold long -> disk_usage_threshold_pct float

* Run make update

* Update metricbeat/module/beat/stats/_meta/test/apm-server.stats.712.json

Co-authored-by: Carson Ip <carsonip@users.noreply.github.com>

* Add fragment

---------

Co-authored-by: Ruben van Staden <ruben.vanstaden@elastic.co>
Co-authored-by: Carson Ip <carsonip@users.noreply.github.com>
(cherry picked from commit 112c334)
ericywl added a commit that referenced this pull request Feb 24, 2026
…) (#48988)

* apm[monitoring]: update monitor fields to include new TBS metrics

* doc: add new apm-server TBS metrics

* Change disk_usage_threshold long -> disk_usage_threshold_pct float

* Run make update

* Update metricbeat/module/beat/stats/_meta/test/apm-server.stats.712.json



* Add fragment

---------



(cherry picked from commit 112c334)

Co-authored-by: Eric <22215921+ericywl@users.noreply.github.com>
Co-authored-by: Ruben van Staden <ruben.vanstaden@elastic.co>
Co-authored-by: Carson Ip <carsonip@users.noreply.github.com>
ericywl added a commit that referenced this pull request Mar 11, 2026
…) (#48989)

* apm[monitoring]: update monitor fields to include new TBS metrics

* doc: add new apm-server TBS metrics

* Change disk_usage_threshold long -> disk_usage_threshold_pct float

* Run make update

* Update metricbeat/module/beat/stats/_meta/test/apm-server.stats.712.json



* Add fragment

---------



(cherry picked from commit 112c334)

Co-authored-by: Eric <22215921+ericywl@users.noreply.github.com>
Co-authored-by: Ruben van Staden <ruben.vanstaden@elastic.co>
Co-authored-by: Carson Ip <carsonip@users.noreply.github.com>
@ericywl ericywl added backport-active-8 Automated backport with mergify to all the active 8.[0-9]+ branches and removed backport-active-8 Automated backport with mergify to all the active 8.[0-9]+ branches labels Mar 13, 2026
@elastic elastic deleted a comment from github-actions Bot Mar 13, 2026
@ericywl

ericywl commented Mar 13, 2026

Copy link
Copy Markdown
Contributor Author

@Mergifyio backport 8.19

@mergify

mergify Bot commented Mar 13, 2026

Copy link
Copy Markdown
Contributor

backport 8.19

✅ Backports have been created

Details

Cherry-pick of 112c334 has failed:

On branch mergify/bp/8.19/pr-48432
Your branch is up to date with 'origin/8.19'.

You are currently cherry-picking commit 112c3349e.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	new file:   changelog/fragments/1769485799-tbs-monitoring.yaml
	modified:   metricbeat/module/beat/_meta/fields.yml
	modified:   metricbeat/module/beat/fields.go
	modified:   metricbeat/module/beat/stats/_meta/fields.yml
	modified:   metricbeat/module/beat/stats/_meta/test/apm-server.stats.712.json

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
	deleted by us:   docs/reference/metricbeat/exported-fields-beat.md

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

mergify Bot pushed a commit that referenced this pull request Mar 13, 2026
* apm[monitoring]: update monitor fields to include new TBS metrics

* doc: add new apm-server TBS metrics

* Change disk_usage_threshold long -> disk_usage_threshold_pct float

* Run make update

* Update metricbeat/module/beat/stats/_meta/test/apm-server.stats.712.json

Co-authored-by: Carson Ip <carsonip@users.noreply.github.com>

* Add fragment

---------

Co-authored-by: Ruben van Staden <ruben.vanstaden@elastic.co>
Co-authored-by: Carson Ip <carsonip@users.noreply.github.com>
(cherry picked from commit 112c334)

# Conflicts:
#	docs/reference/metricbeat/exported-fields-beat.md
ericywl added a commit that referenced this pull request Apr 1, 2026
…de new TBS metrics (#49457)

* metricbeats: update monitor mappings to include new TBS metrics (#48432)

* apm[monitoring]: update monitor fields to include new TBS metrics

* doc: add new apm-server TBS metrics

* Change disk_usage_threshold long -> disk_usage_threshold_pct float

* Run make update

* Update metricbeat/module/beat/stats/_meta/test/apm-server.stats.712.json

Co-authored-by: Carson Ip <carsonip@users.noreply.github.com>

* Add fragment

---------

Co-authored-by: Ruben van Staden <ruben.vanstaden@elastic.co>
Co-authored-by: Carson Ip <carsonip@users.noreply.github.com>
(cherry picked from commit 112c334)

# Conflicts:
#	docs/reference/metricbeat/exported-fields-beat.md

* Remove disk related metrics

* Run make update

---------

Co-authored-by: Eric <22215921+ericywl@users.noreply.github.com>
Co-authored-by: Eric Yap <eric.yap@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-active-9 Automated backport with mergify to all the active 9.[0-9]+ branches >enhancement Team:apm APM Server team issues/PRs

6 participants