autometrics-dev / autometrics-go

Easily add metrics to your system -- and actually understand them using automatically customized Prometheus queries
https://autometrics.dev
Apache License 2.0
142 stars 9 forks source link

Add an option on the go generator to instrument all functions in the file #72

Closed gagbo closed 1 year ago

gagbo commented 1 year ago

This could be used to speed up the process of instrumenting a code base if you know you want to instrument everything in a given file.

koolay commented 1 year ago

also see: https://github.com/nikolaydubina/go-instrument

gagbo commented 1 year ago

Hello,

Thanks for the link I didn't know about this package. From what I see they take the same approach that autometrics chose, but instead of putting all the logic in the couple of PreInstrument and Instrument functions, everything is directly written in the body of the instrumented function.

This solution would become quickly too bothersome to use for autometrics because of all the code that would need to be inserted, and because putting the code in the instrumented codebase directly would force us to expose internals, hurting readability and exposing more surface area for bugs.

Maybe the point of sharing that link was solely to talk about tracing though? I'm not really sure because the point isn't clear just from your comment. If that's the case, for the time being autometrics is focused on delivering a useful metrics experience, and integration of tracing and/or logs information is still in the design phase; we're pretty open about this, so you can join the discussion and give your opinion on the central hub or on Discord