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

When statsd wait metric it send 0 to backend #296

Closed
colixxx opened this issue Mar 5, 2020 · 4 comments
Closed

When statsd wait metric it send 0 to backend #296

colixxx opened this issue Mar 5, 2020 · 4 comments
Assignees

Comments

@colixxx
Copy link

colixxx commented Mar 5, 2020

When statsd wait metric it send 0 to backend (go-carbon)
image

How I can don't send 0 to backend?

@colixxx colixxx changed the title statsd send Count 0 to backend When statsd wait metric it send 0 to backend Mar 5, 2020
@tiedotguy
Copy link
Collaborator

Hi

This is controlled by the expiry-interval setting (unfortunately not documented, should be updated in #264).

By default it's 30s, you can set it to 0 to never expire, or -1 to expire immediately.

@colixxx
Copy link
Author

colixxx commented Mar 6, 2020

my config:
[graphite]
address = "localhost:2003"
dial_timeout = '5s'
write_timeout = '30s'

mode = 'legacy'

global_prefix = 'stats'
global_suffix = ''

prefix_counter = 'counters'
prefix_timer = 'timers'
prefix_gauge = 'gauges'
prefix_sets = 'sets'

With this config stated send 0 every 1 second.
How it is if by default every 30 sec?

@tiedotguy
Copy link
Collaborator

tiedotguy commented Mar 6, 2020

It's the interaction of two separate parts - flush interval and metric expiry.

The flush interval is how often metrics are aggregated and sent upstream, and is 1 second by default. The expiry interval is how long a metric needs to receive no data before it stops being sent upstream.

If you were to not send and metrics for 30 seconds, you would see your last value, 29 zeros, and then it would stop sending.

When I look at your graph, I can see there are periods of at least 30 seconds where the value appears to be 0 (I'm assuming all your non-zero values are > 400, and not 1 or 2 where it may not be visible on the graph). The rendered interval also appears to be 10 seconds. This makes me suspect there's also zeros being added on display, but that's speculation.

edit: expiry happens on flush, after sending metrics upstream. That's why a value of -1 will cause them to expire immediately.

@tiedotguy tiedotguy self-assigned this Mar 6, 2020
@colixxx
Copy link
Author

colixxx commented Mar 6, 2020

Thanks for the explanation, It's working!

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

No branches or pull requests

2 participants