This is an automated email from the ASF dual-hosted git repository.

michellet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 77bc51f  Adding logging for datasource/save requests (#14476)
77bc51f is described below

commit 77bc51f6aaea4c665db7c235820c1ca8a5a6f760
Author: michellethomas <[email protected]>
AuthorDate: Mon May 10 10:26:10 2021 -0700

    Adding logging for datasource/save requests (#14476)
    
    Co-authored-by: michelle_thomas <[email protected]>
---
 superset/views/datasource.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/superset/views/datasource.py b/superset/views/datasource.py
index 10cfc16..5934733 100644
--- a/superset/views/datasource.py
+++ b/superset/views/datasource.py
@@ -22,7 +22,7 @@ from flask_appbuilder import expose
 from flask_appbuilder.security.decorators import has_access_api
 from flask_babel import _
 
-from superset import app, db
+from superset import app, db, event_logger
 from superset.connectors.connector_registry import ConnectorRegistry
 from superset.datasets.commands.exceptions import DatasetForbiddenError
 from superset.exceptions import SupersetException, SupersetSecurityException
@@ -36,6 +36,10 @@ class Datasource(BaseSupersetView):
     """Datasource-related views"""
 
     @expose("/save/", methods=["POST"])
+    @event_logger.log_this_with_context(
+        action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.save",
+        log_to_statsd=False,
+    )
     @has_access_api
     @api
     @handle_api_exception

Reply via email to