Skip to content

Conversation

@juliaElastic
Copy link
Contributor

  • Have you signed the contributor license agreement? yes
  • Have you followed the contributor guidelines? yes
  • If submitting code, have you built your formula locally prior to submission with gradle check? yes
  • If submitting code, is your pull request against main? Unless there is a good reason otherwise, we prefer pull requests against main and will backport as needed. yes
  • If submitting code, have you checked that your submission is for an OS and architecture that we support? yes
  • If you are submitting this code for a class then read our policy for that. yes

Added unhealthy_reason mapping.
Relates https://github.com/elastic/ingest-dev/issues/2522

@juliaElastic juliaElastic added >non-issue :Core/Infra/Plugins Plugin API and infrastructure labels Mar 12, 2024
@juliaElastic juliaElastic self-assigned this Mar 12, 2024
@elasticsearchmachine elasticsearchmachine added Team:Core/Infra Meta label for core/infra team external-contributor Pull request authored by a developer outside the Elasticsearch team v8.14.0 labels Mar 12, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

@juliaElastic juliaElastic changed the title [Fleet] added unhealthy_reason mapping [Fleet] added unhealthy_reason mapping to .fleet-agents index Mar 12, 2024
@juliaElastic juliaElastic requested a review from a team March 13, 2024 13:06
Copy link
Member

@nchaulet nchaulet left a comment

Choose a reason for hiding this comment

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

🚀

@juliaElastic juliaElastic merged commit 27f31b1 into elastic:main Mar 13, 2024
juliaElastic added a commit to elastic/kibana that referenced this pull request Mar 18, 2024
…178605)

## Summary

Closes elastic/ingest-dev#2522

Added `unhealthy_reason` aggregation when querying agent metrics.

The [mapping
change](elastic/elasticsearch#106246) and
[fleet-server change](elastic/fleet-server#3338)
is needed to be merged first to verify end to end.

Steps to verify:
- enroll an agent with docker
- add endpoint integration, expect an input and output unit error status
on the agent doc
- wait a few seconds so that the agent metrics are published
- verify that the agent metrics include `unhealthy_reason`, using the
query below

```
GET metrics-fleet_server.agent_status-default/_search
{
  "_source": ["fleet.agents"]
}

  "hits": [
      {
        "_index": ".ds-metrics-fleet_server.agent_status-default-2024.03.11-000001",
        "_id": "3JdPioUh-9j8DxQrAAABjjclRhU",
        "_score": 1,
        "_source": {
          "fleet": {
            "agents": {
              "enrolled": 12,
              "healthy": 0,
              "inactive": 0,
              "offline": 11,
              "total": 13,
              "unenrolled": 1,
              "unhealthy": 1,
              "updating": 0,
              "upgrading_step": {
                "downloading": 0,
                "extracting": 0,
                "failed": 0,
                "replacing": 0,
                "requested": 0,
                "restarting": 0,
                "rollback": 0,
                "scheduled": 0,
                "watching": 0
              },
              "unhealthy_reason": {
                  "input": 1,
                  "output": 1
                }
            }
          }
        }
      },
```


### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Core/Infra/Plugins Plugin API and infrastructure external-contributor Pull request authored by a developer outside the Elasticsearch team >non-issue Team:Core/Infra Meta label for core/infra team v8.14.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants