Skip to content

Add monotonic counts for some metrics#1551

Merged
ofek merged 4 commits into
DataDog:masterfrom
jalaziz:network_monotonic_count
May 22, 2018
Merged

Add monotonic counts for some metrics#1551
ofek merged 4 commits into
DataDog:masterfrom
jalaziz:network_monotonic_count

Conversation

@jalaziz

@jalaziz jalaziz commented May 15, 2018

Copy link
Copy Markdown
Contributor

What does this PR do?

Add monotonic counts for tcp segments and udp datagrams. This allows more
precise counting of incoming and outgoing segments and datagrams for a given
time period.

The following metrics are affected:

  • system.net.tcp.retrans_segs
  • system.net.tcp.in_segs
  • system.net.tcp.out_segs
  • system.net.udp.in_datagrams
  • system.net.udp.no_ports
  • system.net.udp.in_errors
  • system.net.udp.out_datagrams
  • system.net.udp.rcv_buf_errors
  • system.net.udp.snd_buf_errors
  • system.net.tcp.retrans_packs
  • system.net.tcp.sent_packs
  • system.net.tcp.rcv_packs

For backwards compatibility, the new metrics are suffixed with .count.

I've also added the ability to enable/disable rate-based and count-based metrics per the discussion in DataDog/dd-agent#2630

Motivation

This fixes DataDog/dd-agent#2630. It allows graphing and alerting on the precise number of segments, datagrams, or errors in a set time period.

Review checklist

  • PR has a meaningful title or PR has the documentation/no-changelog label attached
  • Feature or bugfix has tests
  • Git history is clean
  • If PR impacts documentation, docs team has been notified or an issue has
    been opened on the documentation repo

Additional Notes

It may be useful to warn if users accidentally disable both types of metrics, but I wasn't sure if that was necessary.

I also did not add counts for the bytes_rcvd, bytes_sent, packets_in, and packets_out metric. Counts could be useful, but rates seem more appropriate. Also, the naming of packets_in.count doesn't help.

I've also been debating switching the suffix to .count instead of _count, as it seems more appropriate.

Finally, I was not sure if I need to update metadata.csv.

Add monotonic counts for tcp segments and udp datagrams. This allows
more precise counting of incoming and outgoing segments and datagrams
for a given time period.

Count and rate metrics are also configurable, allowing users to prefer
one type over the other.

Fixes DataDog/dd-agent#2630
@jalaziz
jalaziz force-pushed the network_monotonic_count branch from ff550d7 to 4d263f5 Compare May 15, 2018 07:19
@masci masci changed the title [network] Add monotonic counts for some metrics Add monotonic counts for some metrics May 19, 2018

@ofek ofek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comment thread network/conf.yaml.default Outdated
# combine_connection_states: no

# By default, most metrics are submitted as rates.
# However, some metrics like tcp/dup retransmissions and errors are

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Typo: udp

@ofek ofek added this to the 6.3 milestone May 22, 2018

@ofek ofek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you very much!

@ofek
ofek merged commit 7aa7db0 into DataDog:master May 22, 2018
@jalaziz
jalaziz deleted the network_monotonic_count branch October 29, 2018 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Should system.net.tcp.retrans_segs actually use a monotonic count?

3 participants