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 configurable rate limiter for jar collector processing #183

Merged
merged 2 commits into from
Jan 20, 2021

Conversation

jack-berg
Copy link
Contributor

Closes #179.

this.ignoreJars = new ArrayList<>(agentConfig.getIgnoreJars());
int jarsPerSecond = agentConfig.getJarCollectorConfig().getJarsPerSecond();
if (jarsPerSecond <= 0) {
logger.log(Level.INFO, "Jars per second must be greater than 0. Defaulting to {0}.", DEFAULT_JARS_PER_SECOND);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we disable if 0 and use the default if negative?

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 could do that. I was thinking through that question myself and came to the conclusion that you could effectively disable by setting the config to really high number. Like, if someone set it to 1_000_000_000, there's no way the single thread processing these jars could run into that bound.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm ok with leaving this behavior as is and providing public documentation for the jar_collector config so that customers can disable it if desired.

Copy link
Contributor

@jasonjkeller jasonjkeller left a comment

Choose a reason for hiding this comment

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

This looks great to me. Let's ship it.

Along with this PR I think we should update the public agent config doc to include a section on the jar_collector config options:

  jar_collector:
    enabled: true # default true
    max_class_loaders: 300 # default 5000
    skip_temp_jars: true # default true
    jars_per_second: 5 # default 10

It doesn't look like we publicly document any of these config settings.

Since releasing doc updates is blocked by the release I've added a story for us to follow up with that work: #192

this.ignoreJars = new ArrayList<>(agentConfig.getIgnoreJars());
int jarsPerSecond = agentConfig.getJarCollectorConfig().getJarsPerSecond();
if (jarsPerSecond <= 0) {
logger.log(Level.INFO, "Jars per second must be greater than 0. Defaulting to {0}.", DEFAULT_JARS_PER_SECOND);
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm ok with leaving this behavior as is and providing public documentation for the jar_collector config so that customers can disable it if desired.

@jack-berg jack-berg merged commit 9787e34 into main Jan 20, 2021
@jack-berg jack-berg deleted the rate-limit-jar-collector branch January 20, 2021 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rate limit jar collection processing
3 participants