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

Dns query response time #694

Closed
wants to merge 3 commits into from
Closed

Conversation

mjasion
Copy link

@mjasion mjasion commented Feb 14, 2016

Input plugin for measure dns response time

@@ -4,3 +4,5 @@ tivan
.idea
*~
*#

*.iml
Copy link
Contributor

Choose a reason for hiding this comment

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

please don't add this to the gitignore, these type of things should go in your global gitignore

Copy link
Author

Choose a reason for hiding this comment

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

I saw .idea entry ;-)
But ok. I have removed this commit :-)

dnsQueryTime := float64(0)

c := new(dns.Client)
c.ReadTimeout = time.Duration(d.Timeout) * time.Second
Copy link
Contributor

Choose a reason for hiding this comment

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

this should be just d.Timeout * time.Second

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe not, nevermind

@sparrc
Copy link
Contributor

sparrc commented Feb 14, 2016

This looks great, a couple comments:

  • Change the plugin name to dns_query
  • change recordType to record_type throughout

"recordType": d.RecordType,
}

acc.Add("dns", dnsQueryTime, tags)
Copy link
Contributor

Choose a reason for hiding this comment

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

change this to AddFields, and add something like:

fields = map[string]string{"query_time_ms": dnsQueryTime}

Copy link
Contributor

Choose a reason for hiding this comment

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

this is just in case we would like to add more metrics to this plugin in the future

@mjasion
Copy link
Author

mjasion commented Feb 15, 2016

@sparrc

  • plugin name is dns_query
  • field name is query_time_ms and rtt is used as result
  • config option is record_type
  • i have added ANY and AAAA record types

I can rebase the branch up to master before merge if you wish

@@ -157,6 +157,8 @@ Currently implemented sources:
* bcache
* couchdb
* disque
* dns
Copy link
Contributor

Choose a reason for hiding this comment

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

change to just * dns_query

Copy link
Author

Choose a reason for hiding this comment

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

@sparrc package name too?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, also the package (and directory) name

@sparrc
Copy link
Contributor

sparrc commented Feb 21, 2016

great, I'll get this merged once CI passes, thanks @mjasion

@mjasion
Copy link
Author

mjasion commented Feb 21, 2016

Yeah, im working on it :P i will ping you

@mjasion mjasion force-pushed the dns_query branch 2 times, most recently from 64779d3 to 35b8313 Compare February 21, 2016 20:12
Marcin Jasion added 2 commits February 21, 2016 21:13
small polishings

added more record types - AAAA and ANY
- domains are optional
- new record types
@mjasion
Copy link
Author

mjasion commented Feb 21, 2016

@sparrc CI passed :-)

@sparrc sparrc closed this in bb50d7e Feb 21, 2016
geodimm pushed a commit to miketonks/telegraf that referenced this pull request Mar 10, 2016
- renamed plugin to dns_query
- domains are optional
- new record types

closes influxdata#694
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