-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
1 parent
71ccc5a
commit b271047
Showing
5 changed files
with
120 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,5 @@ | |
]} | ||
]} | ||
]}. | ||
|
||
{cover_enabled, true}. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
-type precision() :: n | u | ms | s | m | h. | ||
-type protocol() :: http | udp. | ||
|
||
-record(state, {protocol :: protocol(), | ||
db :: binary(), % for http | ||
username :: undefined | binary(), % for http | ||
password :: undefined | binary(), % for http | ||
host :: inet:ip_address() | inet:hostname(), % for udp | ||
port :: inet:port_number(), % for udp | ||
timestamping :: boolean(), | ||
precision :: precision(), | ||
collected_metrics = <<>> :: binary(), | ||
batch_window_size :: non_neg_integer(), | ||
max_udp_size :: pos_integer(), | ||
tags :: map(), | ||
series_name :: atom() | binary(), | ||
formatting :: list(), | ||
metrics :: map(), | ||
autosubscribe :: boolean(), | ||
subscriptions_module :: module(), | ||
connection :: gen_udp:socket() | reference()}). | ||
|
||
-type state() :: #state{}. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters