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 support for ignoring/deleting generated links #41

Closed gagbo closed 1 year ago

gagbo commented 1 year ago

The generator takes an extra argument, through command-line or environment variable, that allows to opt-out of documentation generation. There is also the possibility to opt-in this deactivation on a per-function basis, using the --no-doc argument on the directive.

This also changes the name of the directive, from autometrics:doc to autometrics:inst, as now the directive doesn't always add documentation to the functions it instruments. For backwards compatibility, the doc attribute is still accepted, and will be removed in a later version.

Closes #38

gagbo commented 1 year ago

For the time being, the flag is --no-doc and the environment variable is AM_NO_DOCGEN (I used the AM_ prefix for the configuration of the prometheus URL already)

@arendjr @emschwartz Are there implementations that already use different names for those? That's probably a good time to change those names, in the Go implementation at least, to be uniform if that's important

Also, this PR probably needs to be merged after #40, and at that point I'll also add the changelog modifications to the PR here