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 TruncateIfTooLong to StatsdConfig #55

Merged
merged 1 commit into from
Nov 16, 2017
Merged

Conversation

yannmh
Copy link
Member

@yannmh yannmh commented Nov 16, 2017

Add TruncateIfTooLong parameter to StatsdConfig. When enabled
(default to True), StatsD truncates any event and service checks
when their size exceeds 8kB.

Fix #48. Help #25.

@yannmh yannmh self-assigned this Nov 16, 2017
Add `TruncateIfTooLong` parameter to `StatsdConfig`. When enabled
(default to `True`), `StatsD` truncates any event and service checks
when their size exceeds 8kB.
Copy link
Member

@truthbk truthbk left a comment

Choose a reason for hiding this comment

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

I don't see anything wrong with this. And pretty awesome that you added a test 🍰

My only question is if we need to add the truncate option to the calls, or if we should consider the StatsdConfig option as good enough. I don't have a strong preference, just wondering if it may be a bit of overkill.

Copy link
Member

@truthbk truthbk left a comment

Choose a reason for hiding this comment

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

Looks good! 🚑

@yannmh yannmh merged commit f5d9bbc into master Nov 16, 2017
@yannmh yannmh deleted the yann/truncate-by-default branch November 16, 2017 18:14
jackellenberger pushed a commit to jackellenberger/dogstatsd-ruby that referenced this pull request Dec 8, 2019
 # What
Instead of raising a RuntimeError and dropping the event when its
formatted string version is greater than 8kb, make an effort to truncate
the message portion of the event down to a sendable size.

Add the option to disable this feature by passing in :truncate => false
to @statsd.event.

 # Why
It's not acceptable to have a silent failure around a seemingly
arbitrary message length limitation, especially with Datadog's event
monitors being so feature poor. This would be less of a problem if you
could compose a monitor to query "has there been an error in the last 5
minutes, or has there not been a success in the last hour", but as it
currently stands silent failures are a big weakness for our Datadog
integration.

The C# client library
[accepted](DataDog/dogstatsd-csharp-client#55) a
similar change, so it should fly in the ruby CL as well.
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.

2 participants