Skip to content

[Apache Tomcat] Fix improperly configured fields harvester_limit and close.on_state_change.inactive #9990

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

niraj-elastic
Copy link
Contributor

@niraj-elastic niraj-elastic commented May 27, 2024

Description

harvester_limit was configured wrongly in hbs.yml file which leads to the following error while saving the integration.
error

This PR is raised to fix the above issue. After fix we are able to save the integration and agent policy is getting updated properly.

image

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.

How to test this PR locally

  • Clone integrations repo.
  • Install elastic-package locally.
  • Start elastic stack using elastic-package.
  • Move to integrations/packages/apache_tomcat) directory.
  • Run the following command to run tests. elastic-package test

Related issues

@niraj-elastic niraj-elastic requested a review from a team as a code owner May 27, 2024 10:04
@niraj-elastic niraj-elastic self-assigned this May 27, 2024
@niraj-elastic niraj-elastic added Team:Obs-InfraObs Observability Infrastructure Monitoring team [elastic/obs-infraobs-integrations] Integration:apache_tomcat Apache Tomcat labels May 27, 2024
@@ -1,4 +1,9 @@
# newer versions go on top
- version: "1.5.1"
changes:
- description: Fix harvester_limit parameter in hbs file.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- description: Fix harvester_limit parameter in hbs file.
- description: Fix `harvester_limit` parameter in .hbs file.

Copy link
Member

Choose a reason for hiding this comment

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

Also, add the other parameter?

Copy link
Member

Choose a reason for hiding this comment

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

Also, let's change the PR title to: "Fix improperly configured fields — harvester_limit and close.on_state_change.inactive"?

Copy link
Member

@shmsr shmsr May 27, 2024

Choose a reason for hiding this comment

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

Also, I am wondering as we are writing a changelog for our users, do they care if we change something in our *.hbs/ *.yml files? I know we all have been following this. But probably changelog should be more focused on how it changes things for our users.

Like, here with these changes users can now set the fields "Harvest Limit" and "File Handle Closure duration" properly so maybe the changelog should be:

Fix setting the value to fields "Harvest Limit" and "File Handle Closure duration"

But yes, I do not have a strong opinion on this. I'll leave it to you to decide. See: https://docs.elastic.co/integrations/apache_tomcat#changelog

Copy link
Member

Choose a reason for hiding this comment

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

We can have it as "Fix the Harvester Limit Configuration Parameter"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree with your point. let me change it.

@ali786XI ali786XI changed the title [Apache Tomcat] Fix harvester_limit issue. [Apache Tomcat] Fix harvester_limit issue May 27, 2024
@elasticmachine
Copy link

elasticmachine commented May 27, 2024

🚀 Benchmarks report

Package apache_tomcat 👍(4) 💚(4) 💔(1)

Expand to view
Data stream Previous EPS New EPS Diff (%) Result
cache 22727.27 18181.82 -4545.45 (-20%) 💔

To see the full report comment with /test benchmark fullreport

@ritalwar
Copy link
Contributor

@niraj-elastic Could you also link the related SDH/bug in this PR?

@devamanv devamanv added the bugfix Pull request that fixes a bug issue label May 27, 2024
@niraj-elastic niraj-elastic changed the title [Apache Tomcat] Fix harvester_limit issue [Apache Tomcat] Fix improperly configured fields harvester_limit and close.on_state_change.inactive May 27, 2024
@niraj-elastic niraj-elastic requested a review from shmsr May 27, 2024 11:56
{{/if}}
{{#if close.on_state_change.inactive}}
close.on_state_change.inactive:
close.on_state_change.inactive: {{close.on_state_change.inactive}}
Copy link
Contributor

Choose a reason for hiding this comment

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

How did we miss this change and did we not test it the last time?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure, i guess this scenario is not caught in CI as well. Here is PR of the change.

Copy link
Contributor

Choose a reason for hiding this comment

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

@ishleenk17 could this have been caught through some pipeline or system tests? Although it's good that we discovered it soon enough, but could this have been avoided?

Copy link
Contributor

Choose a reason for hiding this comment

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

@devamanv This PR fixes two issues first is that harvester_limit and close.on_state_change.inactive are not set, and second is that harvester_limit written in new line which is syntax error. The syntax error throws warning shown in description. But when we save this integration for the very first time we don't get this error which is weird. This error is only thrown when the value of these parameters are changed.

@ishleenk17
Copy link
Member

ishleenk17 commented May 27, 2024

@niraj-elastic : I just checked and the documentation of harvester_limit is now available after this PR merge in 8.13.
Let's link that as well in this PR itself.

@niraj-elastic niraj-elastic requested a review from devamanv May 27, 2024 13:12
@elasticmachine
Copy link

💚 Build Succeeded

History

cc @niraj-elastic

Copy link

Copy link
Member

@ishleenk17 ishleenk17 left a comment

Choose a reason for hiding this comment

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

Looks good!

Copy link
Contributor

@ali786XI ali786XI left a comment

Choose a reason for hiding this comment

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

LGTM

@niraj-elastic niraj-elastic merged commit e9264e1 into elastic:main May 28, 2024
@elasticmachine
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Pull request that fixes a bug issue Integration:apache_tomcat Apache Tomcat Team:Obs-InfraObs Observability Infrastructure Monitoring team [elastic/obs-infraobs-integrations]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants