Skip to content

Conversation

@ericywl
Copy link

@ericywl ericywl commented Dec 15, 2025

Proposed commit message

Add back apm-server monitoring metrics removed in #12793, plus new TBS metrics outlined in elastic/apm-server#15533

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.
  • I have verified that any added dashboard complies with Kibana's Dashboard good practices

Author's Checklist

  • Verify mappings are present in the metrics-elastic_agent.apm_server* datastream.

How to test this PR locally

Step 1: Ensure Elasticsearch & Kibana is running

  1. Spin up a stack in QA: https://console.qa.cld.elstc.co/
> cd integrations/packages/elastic_agent

> export ELASTIC_PACKAGE_KIBANA_HOST=https://alice-863450.kb.us-central1.gcp.qa.cld.elstc.co
> export ELASTIC_PACKAGE_ELASTICSEARCH_HOST=https://alice-863450.es.us-central1.gcp.qa.cld.elstc.co
> export ELASTIC_PACKAGE_ELASTICSEARCH_USERNAME="elastic"
> export ELASTIC_PACKAGE_ELASTICSEARCH_PASSWORD="xxx"

> elastic-package stack up -v -d --provider environment
  1. Check stack health
> elastic-package stack status

Status of Elastic stack services:
╭───────────────┬─────────┬───────────────────╮
│    SERVICE    │ VERSION │      STATUS       │
├───────────────┼─────────┼───────────────────┤
│ elasticsearch │ 9.2.1   │ healthy           │
│ kibana        │ 9.2.1   │ healthy           │
│ fleet-server  │ unknown │ healthy           │
│ elastic-agent │ 9.2.1   │ running (healthy) │
╰───────────────┴─────────┴───────────────────╯

Step 2: Apply Integration Changes

  • Install the elastic_agent integration with the updated mappings in this PR
> cd integrations/packages/elastic_agent

> elastic-package build
> elastic-package stack up -v -d --services package-registry
> elastic-package install -v

Step 3: Enroll Elastic Agent in Fleet

  1. Go to the QA Kibana UI
  2. Data management -> Integrations -> Installed integrations -> Elastic APM -> Add Elastic APM
  3. Add Elastic Agent to your hosts -> Add agent -> Go to Step 4

Step 4: Install EA Locally in a Container

  1. Create docker container to run EA in.
> docker run --rm -it -p 8220:8220 -p 8200:8200 buildpack-deps:24.04 /bin/bash
  1. From within the container, update and add neovim to edit apm-server.yml later on.
> apt update -y && apt install -y neovim
  1. Install elastic-agent with commands from Kibana UI listed in Step 3.
> curl -L -O https://artifacts.elastic.co/downloads/beats/elastic-agent/elastic-agent-9.2.1-linux-arm64.tar.gz 
> tar xzvf elastic-agent-9.2.1-linux-arm64.tar.gz
> cd elastic-agent-9.2.1-linux-arm64

> ./elastic-agent install --url=<REDACTED> --enrollment-token=<REDACTED> --install-servers
  1. Check the Elastic Agent health
> elastic-agent status

┌─ fleet
│  └─ status: (HEALTHY) Connected
└─ elastic-agent
   └─ status: (HEALTHY) Running

Step 5: Verify Data

Verify mappings in the metrics-elastic_agent.apm_server* datastream from Dev Tools.

  1. Get the index name by running the cmd below and copying the data_streams.indices.index_name field.
GET _data_stream/metrics-elastic_agent.apm_server*
  1. Contains the proper mappings due to the changes made in this PR.
GET .ds-metrics-elastic_agent.apm_server-default-2025.11.19-000001/_mapping?filter_path=**.apm_server.**.storage

{
  ".ds-metrics-elastic_agent.apm_server-default-2025.11.19-000002": {
    "mappings": {
      "properties": {
        "beat": {
          "properties": {
            "stats": {
              "properties": {
                "apm_server": {
                  "properties": {
                    "sampling": {
                      "properties": {
                        "tail": {
                          "properties": {
                            "storage": {
                              "properties": {
                                "disk_total": {
                                  "type": "long",
                                  "meta": {
                                    "unit": "byte"
                                  },
                                  "time_series_metric": "gauge"
                                },
                                "disk_usage_threshold": {
                                  "type": "long",
                                  "time_series_metric": "gauge"
                                },
                                "disk_used": {
                                  "type": "long",
                                  "meta": {
                                    "unit": "byte"
                                  },
                                  "time_series_metric": "gauge"
                                },
                                "lsm_size": {
                                  "type": "long",
                                  "meta": {
                                    "unit": "byte"
                                  },
                                  "time_series_metric": "gauge"
                                },
                                "storage_limit": {
                                  "type": "long",
                                  "meta": {
                                    "unit": "byte"
                                  },
                                  "time_series_metric": "gauge"
                                },
                                "value_log_size": {
                                  "type": "long",
                                  "meta": {
                                    "unit": "byte"
                                  },
                                  "time_series_metric": "gauge"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

Related issues

@ericywl ericywl requested a review from a team as a code owner December 15, 2025 07:38
@ericywl ericywl self-assigned this Dec 15, 2025
@ericywl ericywl added Team:Elastic-Agent Platform - Ingest - Agent [elastic/elastic-agent] Integration:elastic_agent Elastic Agent Team:Elastic-Agent-Data-Plane Agent Data Plane team [elastic/elastic-agent-data-plane] >enhancement labels Dec 15, 2025
@elasticmachine
Copy link

Pinging @elastic/elastic-agent (Team:Elastic-Agent)

@elasticmachine
Copy link

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

@elastic-vault-github-plugin-prod
Copy link

elastic-vault-github-plugin-prod bot commented Dec 15, 2025

🚀 Benchmarks report

Package elastic_agent 👍(0) 💚(1) 💔(1)

Expand to view
Data stream Previous EPS New EPS Diff (%) Result
elastic_agent_logs 37037.04 31250 -5787.04 (-15.63%) 💔

To see the full report comment with /test benchmark fullreport

Copy link
Contributor

@belimawr belimawr left a comment

Choose a reason for hiding this comment

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

@ericywl, it seems you forgot to update the version in manifest.yml and the changelog (changelog.yml) as added as belonging to the currently released version.

Could you update those two files?

@ericywl
Copy link
Author

ericywl commented Dec 18, 2025

@ericywl, it seems you forgot to update the version in manifest.yml and the changelog (changelog.yml) as added as belonging to the currently released version.

My bad, not familiar with this, let me update them

@ericywl ericywl requested a review from belimawr December 29, 2025 03:30
@elasticmachine
Copy link

💚 Build Succeeded

History

cc @ericywl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>enhancement Integration:elastic_agent Elastic Agent Team:Elastic-Agent Platform - Ingest - Agent [elastic/elastic-agent] Team:Elastic-Agent-Data-Plane Agent Data Plane team [elastic/elastic-agent-data-plane]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants