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

feat(inputs.prometheus): Add option to limit body length #14661

Merged
merged 6 commits into from
Feb 2, 2024

Conversation

hhiroshell
Copy link
Contributor

Summary

Introduce a new config option to ensure that the length of the response body is less than the specified limit.
If the body length exceeds the limit, input.prometheus plugin doesn't send the metrics to subsequent plugins. This can prevent running out of buffer space and dropping metrics when very large data is received.

This is to redo the previous PR(#14548) in order to clean up the commit logs and contain the fix for review comments at the PR.

Checklist

  • No AI generated code was used in this PR

Related issues

resolves #14437

@telegraf-tiger telegraf-tiger bot added area/prometheus feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins labels Feb 1, 2024
Copy link
Contributor

@Hipska Hipska left a comment

Choose a reason for hiding this comment

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

Looks very good, just a minor thing.

plugins/inputs/prometheus/prometheus_test.go Outdated Show resolved Hide resolved
hhiroshell and others added 2 commits February 1, 2024 21:24
Co-authored-by: Thomas Casteleyn <thomas.casteleyn@me.com>
@hhiroshell
Copy link
Contributor Author

@Hipska
Thank you for the review!

@srebhan
Copy link
Member

srebhan commented Feb 1, 2024

@hhiroshell please fix the CI issues before we continue. Thanks for your work!

Copy link
Contributor

@powersj powersj left a comment

Choose a reason for hiding this comment

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

Thanks! I pushed a fix for tests.

Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

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

@hhiroshell just a few small comment from my side...

plugins/inputs/prometheus/prometheus.go Outdated Show resolved Hide resolved
plugins/inputs/prometheus/prometheus.go Outdated Show resolved Hide resolved
plugins/inputs/prometheus/prometheus_test.go Outdated Show resolved Hide resolved
plugins/inputs/prometheus/sample.conf Outdated Show resolved Hide resolved
@powersj powersj changed the title feat(inputs.prometheus): Add option to limit body length (redo) feat(inputs.prometheus): Add option to limit body length Feb 1, 2024
@powersj powersj added 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 Feb 1, 2024
hhiroshell and others added 2 commits February 2, 2024 18:45
Co-authored-by: Sven Rebhan <36194019+srebhan@users.noreply.github.com>
@telegraf-tiger
Copy link
Contributor

telegraf-tiger bot commented Feb 2, 2024

Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

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

Thanks @hhiroshell!

@srebhan srebhan merged commit 534289f into influxdata:master Feb 2, 2024
26 checks passed
@github-actions github-actions bot added this to the v1.30.0 milestone Feb 2, 2024
@hhiroshell hhiroshell deleted the fix/14437-2 branch February 2, 2024 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/prometheus feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Drop responses with excessively large bodies from Prometheus exporters
4 participants