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

Increase metrics interval to 60s #3578

Merged
merged 6 commits into from
Oct 13, 2023

Conversation

pchila
Copy link
Member

@pchila pchila commented Oct 10, 2023

What does this PR do?

Increase metricset execution interval for monitoring inputs created by agent.

Why is it important?

To reduce the amount of data and the load related to collecting agent metrics

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

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Use cases

Screenshots

Logs

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?
  • ...

@pchila pchila added enhancement New feature or request Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team backport-skip labels Oct 10, 2023
@pchila pchila requested a review from a team as a code owner October 10, 2023 15:55
@pchila pchila self-assigned this Oct 10, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

@elasticmachine
Copy link
Contributor

elasticmachine commented Oct 10, 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-10-11T14:29:59.417+0000

  • Duration: 32 min 11 sec

Test stats 🧪

Test Results
Failed 0
Passed 6529
Skipped 59
Total 6588

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

Expand to view the GitHub comments

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

  • /test : Re-trigger the build.

  • /package : Generate the packages.

  • run integration tests : Run the Elastic Agent Integration tests.

  • run end-to-end tests : Generate the packages and run the E2E Tests.

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

@elasticmachine
Copy link
Contributor

elasticmachine commented Oct 10, 2023

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 98.795% (82/83) 👍
Files 67.45% (201/298) 👍 0.336
Classes 66.126% (367/555) 👍 0.36
Methods 53.585% (1166/2176) 👍 0.551
Lines 39.763% (13572/34132) 👍 1.158
Conditionals 100.0% (0/0) 💚

@@ -517,6 +518,8 @@ func (b *BeatsMonitor) monitoringNamespace() string {
}

func (b *BeatsMonitor) injectMetricsInput(cfg map[string]interface{}, componentIDToBinary map[string]string, monitoringOutputName string, componentList []component.Component) error {
metricsCollectionInterval := 60 * time.Second
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason not to make this a constant?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also would be great to add a "why" comment for future us.

Copy link
Member Author

@pchila pchila Oct 11, 2023

Choose a reason for hiding this comment

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

Added a constant in 4303ee0
Not sure what you mean with a "why" comment? You mean "Why do we set it to 1 minute?" type of comment ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, sorry, I should've been clearer. I think it would be good to know why we're using 1 minute, because typically most of our polling periods (thinking of Metricbeat modules) are 10s by default.

Copy link
Contributor

Choose a reason for hiding this comment

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

The purpose here was to reduce the load/data volume on the monitoring cluster without loosing the ability to get constant data from agent, that's why we ended up choosing 1 minute.

Copy link
Contributor

Choose a reason for hiding this comment

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

The purpose here was to reduce the load/data volume on the monitoring cluster without loosing the ability to get constant data from agent, that's why we ended up choosing 1 minute.

Right, I got that from the PR description as well. Let's put it in a comment above the const declaration so someone looking at the code a few months from now easily understands it as well (without needing to find the commit that introduced it -> this PR).

Copy link
Member Author

Choose a reason for hiding this comment

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

done in 4d71ff6

Copy link
Contributor

@ycombinator ycombinator left a comment

Choose a reason for hiding this comment

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

Left a couple of minor comments, but otherwise change LGTM.

@pchila pchila requested a review from ycombinator October 11, 2023 08:04
@pchila
Copy link
Member Author

pchila commented Oct 11, 2023

buildkite test this

@pchila
Copy link
Member Author

pchila commented Oct 12, 2023

buildkite test this

@elastic-sonarqube
Copy link

@pchila pchila merged commit 82896f5 into elastic:main Oct 13, 2023
11 checks passed
@cmacknz
Copy link
Member

cmacknz commented Oct 13, 2023

@jlind23 @joshdover thoughts on backporting this one to 8.11? My view is we could consider this a system level bug fix or optimization, it's not really a feature.

@pierrehilbert
Copy link
Contributor

I agree with @cmacknz about backporting this in 8.11 to get it in asap as this is not a new feature.

@jlind23
Copy link
Contributor

jlind23 commented Oct 16, 2023

@pierrehilbert @cmacknz Let's do it then! Please also think about updating the doc.

@pierrehilbert pierrehilbert added the backport-v8.11.0 Automated backport with mergify label Oct 16, 2023
mergify bot pushed a commit that referenced this pull request Oct 16, 2023
* Increase elastic-agent monitoring metrics interval to 60s

(cherry picked from commit 82896f5)
pchila added a commit that referenced this pull request Oct 16, 2023
* Increase elastic-agent monitoring metrics interval to 60s

(cherry picked from commit 82896f5)

Co-authored-by: Paolo Chilà <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-skip backport-v8.11.0 Automated backport with mergify enhancement New feature or request Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants