-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
refactor(logging): Clean up statsd
logging
#25847
base: master
Are you sure you want to change the base?
refactor(logging): Clean up statsd
logging
#25847
Conversation
@expose("/", methods=("GET",)) | ||
@statsd_metrics | ||
@event_logger.log_this | ||
@protect() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most API endpoints already use @statsd_metrics
. When this decorator is added to replace implicit log_to_statsd=True
like in this example, the statsd metric
superset_<Endpoint>
will be replaced by
superset_<Class>_<Endpoint>_success|warning|error
superset_<Class>_<Endpoint>_time
superset_<Class>_<Endpoint>_time_count
superset_<Class>_<Endpoint>_time_sum
So it is kind of a breaking change.
Thanks @sebastianliebscher for the refactor/cleanup. Given (as you mentioned) this is a breaking change, i.e., the logged statsD metric name will change it seems like we would have to wait until the breaking window opens for 4.0 (circa Q1 2024) before merging. In the interim I was wondering whether there is a workaround? One could double log the metric (which does pollute the metric space) and add deprecation logic in 3.1 (slated for late Q4 2023) and then remove the double logging in 4.0. |
@john-bodley This seems like too much for something that is not urgent. I think it would be better to just wait for the breaking window. |
Putting this one on our 5.0 project board as well. This one looks like it needs a big ol' rebase, though, at some point before October-ish. |
I'll just convert it to Draft for now, but please feel free to mark it as "Ready for Review" when it's rebased. |
SUMMARY
This PR removes the
log_to_statsd=
functionality from the@event_logger
and replaces usage with already existing@statsd_metrics
decorator. I basically movedBaseSupersetApiMixin
frombase_api.py
-->base.py
so that the flask views can use @statsd_metrics too.Currently, there are two decorators for basically the same use case:
@event_logger.log_this_with_context(log_to_statsd=True)
@statsd_metrics
The
@event_logger
just increments a statsd counter, while@statsd_metrics
additionally measures the execution time of a function.TESTING INSTRUCTIONS
ADDITIONAL INFORMATION