You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's some discussion of this in #71, but I wanted to ask the question more directly.
The reason I ask is that there are metric logging scenarios where there is no single method available to apply the @metric_scope annotation to.
An example, and the problem I am specifically looking at, is emitting per request metrics from a Flask application. Unless I'm missing something, there is no singular method you can apply the @metric_scope annotation to in Flask.
Instead, you need to create a metric logger in a before_request hook, and then emit metrics in a teardown_request hook, with the metric logger then available to you in the request itself to add additional metrics if desired.
There's some discussion of this in #71, but I wanted to ask the question more directly.
The reason I ask is that there are metric logging scenarios where there is no single method available to apply the
@metric_scope
annotation to.An example, and the problem I am specifically looking at, is emitting per request metrics from a Flask application. Unless I'm missing something, there is no singular method you can apply the
@metric_scope
annotation to in Flask.Instead, you need to create a metric logger in a
before_request
hook, and then emit metrics in ateardown_request
hook, with the metric logger then available to you in the request itself to add additional metrics if desired.Is this a supported way to use the package, or am I setting my self up for future pain by depending on the internals of the package?
The text was updated successfully, but these errors were encountered: