Skip to content

Commit

Permalink
Adding logging for datasource/save requests
Browse files Browse the repository at this point in the history
  • Loading branch information
michelle_thomas committed May 4, 2021
1 parent b4e527a commit 39d212c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion superset/views/datasource.py
Expand Up @@ -22,7 +22,7 @@
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
Expand All @@ -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
Expand Down

0 comments on commit 39d212c

Please sign in to comment.