News for hackers. Stuff that matters.
Re:Monitoring Microservices with Synthetic Transactions in Go by valevk on Thursday March 10, 2016 @11:54AM (#11260329)
Why does the author use double ticks? As far as I know you use only one.

  ID string ``json:"id"``
Re:Monitoring Microservices with Synthetic Transactions in Go by cronos on Thursday March 10, 2016 @01:16PM (#11260875)
The code examples are quite non-idiomatic and have lots of issues, to be honest.

- constant strings (defined as vars) as return values instead of the standard error type

- not formatted

- synthetic request's response body not closed - a memory leak

- log.Fatal (which results in os.Exit(1) immediately killing the program) for all the non-critical errors

- timestamp as a string instead of time.Time in the struct

- not re-using http.DefaultClient

- 3rd party package with a custom DSL instead of a simple time.Ticker

Sorry for the pedantry, but if such code examples live on the internet, newcomers to Go will learn from it (if not blindly copy-paste) and it will spread even further indirectly giving bad reputation to the language.

P.S. i do like this idea of continuous integration testing in production, will probably start using it at our company.

Re:Monitoring Microservices with Synthetic Transactions in Go by johns on Thursday March 10, 2016 @01:19PM (#11260907)
Why not post a comment on the post itself with constructive criticism?
Re:Monitoring Microservices with Synthetic Transactions in Go by cronos on Thursday March 10, 2016 @01:35PM (#11261040)
It seems like the author was in this thread.

But you're right, re-posted my comment in a less aggressive form on the post itself.

Re:Monitoring Microservices with Synthetic Transactions in Go by buro9 on Thursday March 10, 2016 @11:57AM (#11260342)
That is an error and would not compile.

This code example has not gone through gofmt or been compiled... it is pseudo-Go

Re:Monitoring Microservices with Synthetic Transactions in Go by gronnbeck on Thursday March 10, 2016 @11:57AM (#11260343)
Well, that is a typo. I'll fix it =) Thank you!
Re:Monitoring Microservices with Synthetic Transactions in Go by unfunco on Thursday March 10, 2016 @12:22PM (#11260485)
You should definitely run go fmt, at the moment it's rather difficult to read the examples.
Re:Monitoring Microservices with Synthetic Transactions in Go by gronnbeck on Thursday March 10, 2016 @12:31PM (#11260537)
I had to anonymize the code a bit and it seems like I messed up doing so in the gist. I am sorry! I will unsure to run it through gofmt the next time. Thank you for the feedback!
Re:Monitoring Microservices with Synthetic Transactions in Go by libria on Thursday March 10, 2016 @12:23PM (#11260488)
datadoghq link is broken as well.
Re:Monitoring Microservices with Synthetic Transactions in Go by gronnbeck on Thursday March 10, 2016 @12:31PM (#11260541)
Ah! Seems like I messed up the markdown. Fixed now. Thank you for your feedback.
Re:Monitoring Microservices with Synthetic Transactions in Go by JackuB on Thursday March 10, 2016 @12:51PM (#11260666)
And there is "DataDag" once :)
Re:Monitoring Microservices with Synthetic Transactions in Go by Huggernaut on Thursday March 10, 2016 @01:08PM (#11260796)
D'ya like DataDags?
Re:Monitoring Microservices with Synthetic Transactions in Go by aheim on Thursday March 10, 2016 @06:06PM (#11263255)
dagnabbit!