-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to dynamically name for each function #10
Comments
Hi! Thank you for your feedback. I don't really understand what you want. Do you mean that you want to create the entry on the fly? |
on the call of a single function in a service. for example is i have a service that has multiple functions that all compose the module. how can i define the entry specific to the function without having to create a separate static configuration for each function in the module and inject in the service |
does my above comment make it clearer? or still need further comments? |
Sorry for the delay, I was a quite busy at the moment. I do understand your need, I'll try to find out some time to handle it. I need to think how can I manage it. I think it can be possible to have something like this: class MyClass {
@PromCounterMetric('myCounter')
doStuff() {
myCounter.inc();
}
} Or if the aim is to monitor how many time a function is called, can be cool to have something like that: class MyClass {
@PromCounterMetricAutoInc()
doStuff() {
}
} |
@sgraham785 I've updated the module with new decorators It's a simple decorator that will generate automatically counter without need to declare the counter.
|
this work well thanks. however, I have a service that has multiple functions and I would like to split and track each separately. the easiest way is to name the stat with the function, even append the name when it's invoked in the function? just starting the conversation cause I am not completely clear on how you implemented yet
The text was updated successfully, but these errors were encountered: