chore: improve analytics (#11714)

* chore: improve analytics

* lint

* log more events, add note in UPDATING.md

* handling base class

* more events\!

* get ref through

* right before @expose

* fix context

* touchups
This commit is contained in:
Maxime Beauchemin
2020-11-25 08:45:02 -08:00
committed by GitHub
parent 9215a31fa2
commit 0504cf1a00
13 changed files with 229 additions and 50 deletions

View File

@@ -47,6 +47,7 @@ from superset.annotation_layers.schemas import (
openapi_spec_methods_override,
)
from superset.constants import RouteMethod
from superset.extensions import event_logger
from superset.models.annotations import AnnotationLayer
from superset.views.base_api import BaseSupersetModelRestApi, statsd_metrics
@@ -110,6 +111,7 @@ class AnnotationLayerRestApi(BaseSupersetModelRestApi):
@safe
@statsd_metrics
@permission_name("delete")
@event_logger.log_this_with_context(log_to_statsd=False)
def delete(self, pk: int) -> Response:
"""Delete an annotation layer
---
@@ -159,6 +161,7 @@ class AnnotationLayerRestApi(BaseSupersetModelRestApi):
@safe
@statsd_metrics
@permission_name("post")
@event_logger.log_this_with_context(log_to_statsd=False)
def post(self) -> Response:
"""Creates a new Annotation Layer
---
@@ -218,6 +221,7 @@ class AnnotationLayerRestApi(BaseSupersetModelRestApi):
@safe
@statsd_metrics
@permission_name("put")
@event_logger.log_this_with_context(log_to_statsd=False)
def put(self, pk: int) -> Response:
"""Updates an Annotation Layer
---
@@ -284,6 +288,7 @@ class AnnotationLayerRestApi(BaseSupersetModelRestApi):
@safe
@statsd_metrics
@rison(get_delete_ids_schema)
@event_logger.log_this_with_context(log_to_statsd=False)
def bulk_delete(self, **kwargs: Any) -> Response:
"""Delete bulk Annotation layers
---