Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add os_family, os_platform and os_version to host provider #5941

Merged
merged 8 commits into from
Nov 12, 2024

Conversation

belimawr
Copy link
Contributor

@belimawr belimawr commented Nov 5, 2024

What does this PR do?

This commit adds os_family, os_platform and os_version to the host provider, enabling differentiating Linux distributions. This is required to support Debian 12 and other distributions that are moving away from traditional log files in favour of Journald.

Why is it important?

It is required to support Debian 12 and other Linux distributions that are moving away from traditional log files in favour of Journald.

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
  • [ ] I have added an entry in ./changelog/fragments using the changelog tool
  • [ ] I have added an integration test or an E2E test

Disruptive User Impact

None

How to test this PR locally

  1. Package the Elastic-Agent
  2. Deploy it with any policy, even an empty policy with no monitoring will work
  3. Collect the diagnostics
  4. Look at variables.yml and ensure os_family, os_platform and os_version are populated under host. Here is an example from Debian 11:
      host:
        architecture: x86_64
        id: 9a7aa218396d47b1b17218a99918bae4
        ip:
            - 127.0.0.1/8
            - 10.0.2.15/24
            - ::1/128
            - fe80::a00:27ff:fe8d:c04d/64
        mac:
            - 08:00:27:8d:c0:4d
        name: bullseye
        os_family: debian
        os_platform: debian
        os_version: 11 (bullseye)
        platform: linux

Related issues

Questions to ask yourself

  • How are we going to support this in production?
  • How are we going to measure its adoption?
  • How are we going to debug this?
  • What are the metrics I should take care of?
  • ...

@belimawr belimawr added Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team skip-it Skips integration tests for a PR skip-ci labels Nov 5, 2024
@belimawr belimawr self-assigned this Nov 5, 2024
Copy link
Contributor

mergify bot commented Nov 5, 2024

This pull request does not have a backport label. Could you fix it @belimawr? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-./d./d is the label to automatically backport to the 8./d branch. /d is the digit

Copy link
Contributor

mergify bot commented Nov 5, 2024

backport-v8.x has been added to help with the transition to the new branch 8.x.
If you don't need it please use backport-skip label and remove the backport-8.x label.

@belimawr belimawr force-pushed the 10797-journald-for-system-integration branch from 5daf94a to 7eb75c7 Compare November 6, 2024 21:36
@belimawr belimawr removed skip-it Skips integration tests for a PR skip-ci labels Nov 6, 2024
@belimawr belimawr changed the title [WIP] Add os_version and os_family to host provider Add os_family, os_platform and os_version to host provider Nov 6, 2024
@belimawr belimawr marked this pull request as ready for review November 6, 2024 21:47
@belimawr belimawr requested a review from a team as a code owner November 6, 2024 21:47
@elasticmachine
Copy link
Contributor

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

@pkoutsovasilis
Copy link
Contributor

@belimawr could you add a changelog fragment? 🙂

Co-authored-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
…limawr/elastic-agent into 10797-journald-for-system-integration
@belimawr
Copy link
Contributor Author

belimawr commented Nov 7, 2024

@belimawr could you add a changelog fragment? 🙂

Done on 2a789ba

@strawgate
Copy link
Contributor

strawgate commented Nov 7, 2024

Per ECS -- https://www.elastic.co/guide/en/ecs/current/ecs-os.html these should be os.family, os.platform, os.version? i.e. os should be an object?

@belimawr
Copy link
Contributor Author

belimawr commented Nov 8, 2024

Per ECS -- https://www.elastic.co/guide/en/ecs/current/ecs-os.html these should be os.family, os.platform, os.version? i.e. os should be an object?

That makes sense, thanks @strawgate ! It didn't cross my mind to use ECS because those fields are not stored in ES, they're just information about the host.

I'll make those updates.

@strawgate
Copy link
Contributor

Oh, if these don't end up in metadata for documents then you're right it doesnt need to be ecs

@belimawr belimawr merged commit d9587c4 into elastic:main Nov 12, 2024
14 checks passed
mergify bot pushed a commit that referenced this pull request Nov 12, 2024
This commit adds `os_family`, `os_platform` and `os_version` to the host provider, enabling differentiating Linux distributions. This is required to support Debian 12 and other distributions that are moving away from traditional log files in favour of Journald.

---------

Co-authored-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
(cherry picked from commit d9587c4)
belimawr added a commit that referenced this pull request Nov 18, 2024
…) (#6005)

This commit adds `os_family`, `os_platform` and `os_version` to the host provider, enabling differentiating Linux distributions. This is required to support Debian 12 and other distributions that are moving away from traditional log files in favour of Journald.

---------

Co-authored-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
(cherry picked from commit d9587c4)

Co-authored-by: Tiago Queiroz <tiago.queiroz@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-8.x Automated backport to the 8.x branch with mergify Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants