superset icon indicating copy to clipboard operation
superset copied to clipboard

refactor(logging): Clean up `statsd` logging

Open sebastianliebscher opened this issue 1 year ago • 4 comments

SUMMARY

This PR removes the log_to_statsd= functionality from the @event_logger and replaces usage with already existing @statsd_metrics decorator. I basically moved BaseSupersetApiMixin from base_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

  • run unit + integration tests
  • manually checked for new statsd metrics

ADDITIONAL INFORMATION

  • [ ] Has associated issue:
  • [ ] Required feature flags:
  • [ ] Changes UI
  • [ ] Includes DB Migration (follow approval process in SIP-59)
    • [ ] Migration is atomic, supports rollback & is backwards-compatible
    • [ ] Confirm DB migration upgrade and downgrade tested
    • [ ] Runtime estimates and downtime expectations provided
  • [ ] Introduces new feature or API
  • [ ] Removes existing feature or API

sebastianliebscher avatar Nov 02 '23 17:11 sebastianliebscher