envoyproxy/ratelimit

Allow control of stats flush interval with env var

Closed this issue · 5 comments

The stats package https://pkg.go.dev/github.com/lyft/gostats suggests there is a config arg DefaultFlushIntervalS which allows changing how often stats are flushed. Tuning this would allow for the logging to be less noisy ( #321 ) while still keeping the useful stats.

Suggest adding env var GOSTATS_FLUSH_INTERVAL_SECONDS. Might also be worth binding to DefaultLoggingSinkDisabled as GOSTATS_DISABLED to disable it entirely?

I found that the gostats lib can be configured directly with env vars, see https://github.com/lyft/gostats/blob/master/settings.go

So setting GOSTATS_LOGGING_SINK_DISABLED=true disables logs entirely, and GOSTATS_FLUSH_INTERVAL_SECONDS can be used to tweak the flush interval.

No changes needed in this repo.

Oops actually the GOSTATS_FLUSH_INTERVAL_SECONDS does not work when combined with USE_STATSD=false.

Hello, do you have a better way to customize the log output of gostats? If it is convenient, please tell me, thank you!

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.

This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted" or "no stalebot". Thank you for your contributions.