Can we have decorators for tracing and metrics #1804
srikanthkollu
started this conversation in
Ideas
Replies: 2 comments
-
Can we inject Decorators to all methods during server startup based on modules configured. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Should the decorator inject span as an attribute to the decorated function? It is certainly convenient but I think it is not worth having to update every function signature where the decorator could be used. May be we can skip doing that and let users use |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This makes very easy for developers to instrument code. It saves ton of time for developers to instrument their code. Methods just focus on business logic.
@tracer.with_span("span_name")
def my_func(..., span):
# do work()
...
span.set_attributes({"name", "abc"})
# finish work()
Beta Was this translation helpful? Give feedback.
All reactions