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

docs(spec): Add specification for output rate limiting #15665

Closed

Conversation

srebhan
Copy link
Member

@srebhan srebhan commented Jul 25, 2024

Summary

Propose a new rate-limiting feature for output plugins allowing to limit the metric-rate sent to services.

Checklist

  • No AI generated code was used in this PR

Related issues

related to #14802

@telegraf-tiger telegraf-tiger bot added the docs Issues related to Telegraf documentation and configuration descriptions label Jul 25, 2024
@srebhan srebhan added plugin/output 1. Request for new output plugins 2. Issues/PRs that are related to out plugins specification ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. labels Jul 25, 2024
Comment on lines +27 to +29
Therefore, a new `metric_rate_limit` setting is proposed allowing to set the
maximum number of metrics sent __per second__ via an output. By default, the
metric rate must be unlimited.
Copy link
Contributor

Choose a reason for hiding this comment

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

My only concern is that in many cases a cloud or database or service will put limits in terms of "MB per second". Here is some prior art from InfluxDB: influxdata/influxdb#19660

The logical next question from a user is "how do I know how many metrics translate to N MB per second".

Copy link
Member Author

Choose a reason for hiding this comment

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

I think this must be done in the output plugin as the message size depends on the serialization of the metrics and this is NOT known to the framework. The proposed solution is to limit the peak sends of metrics, not about server-side rate limiting.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this must be done in the output plugin as the message size depends on the serialization of the metrics and this is NOT known to the framework.

I have no disagreement with this and certainly wasn't implying moving this out of the output plugin.

The proposed solution is to limit the peak sends of metrics, not about server-side rate limiting.

Correct, but one of the reasons people want this option is the service they are sending to will have limits as to how much it can accept. For example, using the influxdb output, we know some free plans are limited to 17 kb/s. How can a user take that limit, and apply it their telegraf config?

I don't see customers or users asking for "limit to N metrics per second". Rather it is a data rate 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.

Maybe I am getting this convolluted by trying to solve two things at once:

  1. the scenario where telegraf reconnects to an output, and then sends a DOS-like set of metric batches to "catch up"
  2. the scenario where telegraf sends too many metrics over time to an output

Your proposal is clearly tackling the first, but I see users grabbing this option to also tackle 2 as well.

Can we consider 2 to avoid yet another option.

@powersj powersj removed the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Aug 1, 2024
@powersj powersj assigned srebhan and unassigned powersj and DStrand1 Aug 1, 2024
@srebhan srebhan marked this pull request as draft August 20, 2024 19:34
@srebhan srebhan closed this Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Issues related to Telegraf documentation and configuration descriptions plugin/output 1. Request for new output plugins 2. Issues/PRs that are related to out plugins specification
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants