chop-dbhi / prometheus-sql

Service that exposes Prometheus metrics for a SQL result set.
BSD 2-Clause "Simplified" License
202 stars 55 forks source link

Fixes #15 #22

Closed haxorof closed 7 years ago

haxorof commented 7 years ago

I have done an implementation but I must say that I am new to golang and come from a C++/Java background so please tell me to fix stuff if I done something which can be done in a better way etc. 😄

I have executed some manual test to verify that the existing stuff also works to not break compatibility.

bruth commented 7 years ago

Thanks @haxorof for putting this together. After my first pass I am not sure I like having four additional libraries introduced for a fairly simple set of validation logic (I tend to prefer limiting dependencies in general). Having a single function that takes the config and checks here it needs to and falling back to defaults is often sufficient and more clear since it is just Go rather than declarative rules in the struct tags.

haxorof commented 7 years ago

Thanks for the feedback @bruth! I will rework it a bit to reduce dependencies etc. I will push some new commit and let you know when I done that. 😄

haxorof commented 7 years ago

Now I removed the validation dependencies and hope it is closer to what you except it to be. Otherwise please tell me where I shall do some more adjustments.

haxorof commented 7 years ago

@bruth: Ready for another round. 😄 Hopefully I understood your comments correctly.

bruth commented 7 years ago

Nice, you understood 😄

bruth commented 7 years ago

Feel free to squash and merge when you are ready.