autometrics-dev / autometrics-py

Easily add metrics to your code that actually help you spot and debug issues in production. Built on Prometheus and OpenTelemetry.
https://autometrics.dev
Apache License 2.0
214 stars 7 forks source link

Investigate: Get qualified name for function so autometrics does not need to be the topmost decorator #56

Closed brettimus closed 1 year ago

brettimus commented 1 year ago

In the README, we write:

Autometrics by default will try to store information on which function calls a decorated function. As such you may want to place the autometrics in the top/first decorator, as otherwise you may get inner or wrapper as the caller function.

It would be nice to implement our decorator so that it does not rely on being the topmost decorator above a function.

This should be possible. For reference, check out the utility function used by Sentry in their SDK's decorators

actualwitch commented 1 year ago

resolved in https://github.com/autometrics-dev/autometrics-py/pull/59