Skip to content

[System] Add missing metric_type metadata #6395

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

Merged

Conversation

tetianakravchenko
Copy link
Contributor

What does this PR do?

Cpu and Memory data_streams already contain the metric_type, only those 2 fields were missing for some reason.

In all system package are missing metric_type for those 2 fields and for process.cgroup metrics - it will be a part for a different PR.

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.

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Screenshots

Signed-off-by: Tetiana Kravchenko <[email protected]>
@tetianakravchenko tetianakravchenko requested a review from a team as a code owner May 31, 2023 10:47
Signed-off-by: Tetiana Kravchenko <[email protected]>
@elasticmachine
Copy link

elasticmachine commented May 31, 2023

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2023-06-01T13:12:13.817+0000

  • Duration: 15 min 34 sec

Test stats 🧪

Test Results
Failed 0
Passed 145
Skipped 0
Total 145

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

@elasticmachine
Copy link

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 100.0% (3/3) 💚
Files 100.0% (4/4) 💚
Classes 100.0% (4/4) 💚
Methods 60.759% (48/79)
Lines 99.536% (2790/2803)
Conditionals 100.0% (0/0) 💚

@@ -91,6 +91,7 @@
description: swap readahead pages
- name: readahead.cached
type: long
metric_type: counter
Copy link
Contributor

Choose a reason for hiding this comment

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

I am unable to find a useful resource to validate this.
However the aggregation function that matters most on this field is the rate() function, supported by the counter. So, i do not find any risk to mark the field as counter type.

@tetianakravchenko , have you got a chance to validate this such as the kernel documentation?

cc @lalit-satapathy

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no, I couldn't find as well, just found where is it set - https://github.com/elastic/beats/blob/main/metricbeat/module/linux/memory/data.go#L87-L88, and that it corresponds to swap_ra_hit, I assumed it should be similar to the swap_ra (swap.readahead.pages), that is already set as counter

Also when double-checking I noticed that it is actually defined in the linux module, not in the system module. And this field is not defined in the list of fields in metricbeat - https://github.com/elastic/beats/blob/main/metricbeat/module/system/memory/_meta/fields.yml and not defined in example in our documentation - https://www.elastic.co/guide/en/beats/metricbeat/8.8/metricbeat-metricset-system-memory.html

@elastic/elastic-agent-data-plane could you please double-check if this field was added correctly here, or should it be deleted, since it is not present in metricbeat?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

as discussed with @agithomas: I think we agreed that it should be safe to keep it as counter

discussion regarding if this fields should be removed or not is out of the scope of this PR and there should be created another issue for that. @elastic/elastic-agent-data-plane wdyt?

Copy link
Contributor

Choose a reason for hiding this comment

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

@cmacknz cmacknz requested a review from leehinman June 1, 2023 14:05
@@ -91,6 +91,7 @@
description: swap readahead pages
- name: readahead.cached
type: long
metric_type: counter
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

@agithomas agithomas left a comment

Choose a reason for hiding this comment

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

LGTM!

@tetianakravchenko tetianakravchenko merged commit 66525d9 into elastic:main Jun 1, 2023
@tetianakravchenko tetianakravchenko deleted the system_package_metric_types branch June 1, 2023 15:19
@elasticmachine
Copy link

Package system - 1.31.1 containing this change is available at https://epr.elastic.co/search?package=system

sodhikirti07 pushed a commit that referenced this pull request Jun 15, 2023
* add missing metric_type metadata

Signed-off-by: Tetiana Kravchenko <[email protected]>

* fix the PR link in changelog

Signed-off-by: Tetiana Kravchenko <[email protected]>

---------

Signed-off-by: Tetiana Kravchenko <[email protected]>
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.

5 participants