-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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 uint support to cratedb output #4117
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but see comment.
return strconv.FormatInt(int64(t), 10), nil | ||
} else { | ||
return strconv.FormatInt(MaxInt64, 10), nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the idea here is to silently truncate large numbers because CrateDB can't store them? I generally prefer to return an error in these situations, but I think there should be at least a comment explaining the reason for this code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is closely based on the behavior of the InfluxDB output but I can definitely leave a comment.
We could log an error here however in most cases the value would probably be oversized on every interval, so we would want to log only once. We can't return an error from Write()
because then Telegraf would retry the metric.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
(cherry picked from commit b114687)
Since 1.6, fields can be int64, uint64, float64, bool, string.
For uint64 values too large to store in CrateDB, we save as the maximum int64 value.
@felixge Can you review?
closes: #4110
Required for all PRs: