From b486bccbb39237ba0a0ea9eab9e3cc06e8b352ff Mon Sep 17 00:00:00 2001 From: Chakru <161002324+chakru-r@users.noreply.github.com> Date: Fri, 25 Jul 2025 19:50:30 +0530 Subject: [PATCH] fix: cleanup commented out dead code (#14188) --- .../datahub/telemetry/TrackingService.java | 50 ------------------- 1 file changed, 50 deletions(-) diff --git a/metadata-service/auth-impl/src/main/java/com/datahub/telemetry/TrackingService.java b/metadata-service/auth-impl/src/main/java/com/datahub/telemetry/TrackingService.java index a4e1393852..6aa7b36de5 100644 --- a/metadata-service/auth-impl/src/main/java/com/datahub/telemetry/TrackingService.java +++ b/metadata-service/auth-impl/src/main/java/com/datahub/telemetry/TrackingService.java @@ -154,56 +154,6 @@ public class TrackingService { } } - // TODO: No callers: Remove post review - /* - public void track( - @Nonnull final String eventName, - @Nonnull final OperationContext opContext, - @Nullable final Authenticator authenticator, - @Nullable final EntityClient entityClient) { - if (mixpanelAPI == null || messageBuilder == null) { - log.warn("Mixpanel tracking is not enabled. Skipping event: {}", eventName); - return; - } - - try { - final String actorId = opContext.getActorContext().getActorUrn().toString(); - - // Create the event message using MessageBuilder - JSONObject message = messageBuilder.event(actorId, eventName, new JSONObject()); - - // Create properties object if it doesn't exist - JSONObject properties; - if (message.has("properties")) { - properties = message.getJSONObject("properties"); - } else { - properties = new JSONObject(); - message.put("properties", properties); - } - - // Add properties to the event - properties.put("distinct_id", actorId); - properties.put("actor", actorId); - properties.put("version", _gitVersion.getVersion()); - properties.put("time", System.currentTimeMillis() / 1000L); - - // Sanitize the properties - JSONObject sanitizedProperties = sanitizeEvent(properties); - if (sanitizedProperties != null) { - message.put("properties", sanitizedProperties); - } - - // log the message - log.info("Sending event {} to Mixpanel: {}", eventName, message.toString()); - mixpanelAPI.sendMessage(message); - log.debug("Successfully sent event {} to Mixpanel", eventName); - } catch (Exception e) { - log.warn("Failed to track event: {}", eventName, e); - } - } - - */ - /** * Parse a timestamp from various formats (numeric or string) and convert it to epoch milliseconds *