Skip to content

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented Dec 11, 2025

Proposed commit message

Report subcomponent status for beats receivers

Make beats receivers report otel status for their subcomponents - inputs for filebeat and modules for metricbeat.

This is done via the otel status Event Attributes field. Under the inputs key, we add a map to the attributes, where input ids are keys, and statuses are values. The status structure is the same as the one used for streams in the control protocol. This is a temporary measure until there's a standard convention for doing this in upstream otel - then we'll switch to that. The purpose of this change is to let elastic-agent report per-stream and per-input status for inputs running in a beat receiver.

We currently need to do a hacky workaround to ensure status events are delivered in spite of the component status not changing. This is due to open-telemetry/opentelemetry-collector#14282.

The output of the healthcheckv2 extension with this change looks like the following:

{
  "components": {
    "receiver:metricbeatreceiver/_agent-component/system/metrics-default": {
      "healthy": true,
      "status": "StatusRecoverableError",
      "error": "Error fetching data for metricset system.process: error fetching process list: non fatal error; reporting partial metrics: error fetching PID metrics for 377 processes, most likely a \"permission denied\" error. Enable debug logging to determine the exact cause.",
      "status_time": "2025-12-10T18:19:53.552220344+01:00",
      "attributes": {
        "inputs": {
          "unique-system-metrics-input-2-cpu": {
            "error": "",
            "status": "Running"
          },
          "unique-system-metrics-input-2-process": {
            "error": "Error fetching data for metricset system.process: error fetching process list: non fatal error; reporting partial metrics: error fetching PID metrics for 377 processes, most likely a \"permission denied\" error. Enable debug logging to determine the exact cause.",
            "status": "Degraded"
          },
          "unique-system-metrics-input-cpu": {
            "error": "",
            "status": "Running"
          },
          "unique-system-metrics-input-process": {
            "error": "Error fetching data for metricset system.process: non fatal error; reporting partial metrics: error fetching PID metrics for 377 processes, most likely a \"permission denied\" error. Enable debug logging to determine the exact cause.",
            "status": "Running"
          }
        }
      }
    }
  }
}

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.

Related issues


This is an automatic backport of pull request #48015 done by [Mergify](https://mergify.com).

* Add input statuses to beat receiver status

# Conflicts:
#	x-pack/filebeat/fbreceiver/receiver_test.go

* Emit dummy status to force otel core to process it

* Add unit tests

* Add changelog entry

* Switch to otel statuses for inputs

(cherry picked from commit 6ba7b47)
@mergify mergify bot added the backport label Dec 11, 2025
@mergify mergify bot requested a review from a team as a code owner December 11, 2025 17:13
@mergify mergify bot requested review from belimawr and removed request for a team December 11, 2025 17:13
@mergify mergify bot added the backport label Dec 11, 2025
@mergify mergify bot requested a review from orestisfl December 11, 2025 17:13
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Dec 11, 2025
@github-actions
Copy link
Contributor

🤖 GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@github-actions github-actions bot added enhancement Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team labels Dec 11, 2025
@elasticmachine
Copy link
Contributor

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

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Dec 11, 2025
@swiatekm swiatekm enabled auto-merge (squash) December 12, 2025 11:10
@swiatekm swiatekm merged commit a221525 into 8.19 Dec 12, 2025
207 checks passed
@swiatekm swiatekm deleted the mergify/bp/8.19/pr-48015 branch December 12, 2025 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants