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 UDP packet size limit #52

Merged
merged 1 commit into from
May 30, 2019

Conversation

vassilevsky
Copy link
Contributor

@vassilevsky vassilevsky commented Feb 15, 2019

Hi ☃

This is a fix for #51.

The downside is that data points are no longer combined.

What do you think?

@vassilevsky vassilevsky force-pushed the udp-packet-size-limit branch 2 times, most recently from 31f160e to 2282262 Compare February 19, 2019 09:22
UDP packets cannot exceed MTU. If they do, the app gets
{error,emsgsize} from gen_udp:send. Similar issue:

jaegertracing/jaeger-client-node#124

This commit adds packet size check. Packets are sent
immediately upon reaching max size, even before the end
of batch window.

Size calculation from CollectedMetrics map would've been
costly. I changed the format to binary. Metrics are encoded
into Line Protocol immediately now, instead of right before
sending.

This also helps avoid data loss. The map did not record
all timestamps. It set the most recent timestamp
for all fields of the same measurement.

It also did not honor differences in tags, but I guess
there aren't any when metrics go through Exometer.
@vassilevsky vassilevsky force-pushed the udp-packet-size-limit branch from 2282262 to 18502dc Compare February 20, 2019 06:19
@vassilevsky
Copy link
Contributor Author

We've been using this branch in production for a long time and there were no problems. Could you merge it and release a new version of the Hex package? Thanks!

@mgumz mgumz merged commit b271047 into travelping:master May 30, 2019
@vassilevsky
Copy link
Contributor Author

Thank you :3

@vassilevsky vassilevsky deleted the udp-packet-size-limit branch June 26, 2019 10:21
@vassilevsky vassilevsky restored the udp-packet-size-limit branch June 26, 2019 10:21
@vassilevsky
Copy link
Contributor Author

Could you also please release a new version to Hex.pm? Thanks!

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