From 203b45f46301420c831478949c6530bfc9a95efc Mon Sep 17 00:00:00 2001 From: Suman Das <59254445+sumandas0@users.noreply.github.com> Date: Thu, 25 Apr 2024 12:11:29 +0530 Subject: [PATCH 1/2] fix: just tap the utm tags coming from product --- .../src/main/java/org/apache/atlas/web/rest/DiscoveryREST.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webapp/src/main/java/org/apache/atlas/web/rest/DiscoveryREST.java b/webapp/src/main/java/org/apache/atlas/web/rest/DiscoveryREST.java index 70c1f57cc3..144e1171d1 100644 --- a/webapp/src/main/java/org/apache/atlas/web/rest/DiscoveryREST.java +++ b/webapp/src/main/java/org/apache/atlas/web/rest/DiscoveryREST.java @@ -94,6 +94,7 @@ public class DiscoveryREST { private static final String INDEXSEARCH_TAG_NAME = "indexsearch"; private static final Set TRACKING_UTM_TAGS = new HashSet<>(Arrays.asList("ui_main_list", "ui_popup_searchbar")); + private static final String UTM_TAG_FROM_PRODUCT = "project_webapp"; @Inject public DiscoveryREST(AtlasTypeRegistry typeRegistry, AtlasDiscoveryService discoveryService, @@ -433,7 +434,7 @@ public AtlasSearchResult indexSearch(@Context HttpServletRequest servletRequest, } throw abe; } finally { - if(CollectionUtils.isNotEmpty(parameters.getUtmTags())) { + if(CollectionUtils.isNotEmpty(parameters.getUtmTags()) && parameters.getUtmTags().contains(UTM_TAG_FROM_PRODUCT)) { AtlasPerfMetrics.Metric indexsearchMetric = new AtlasPerfMetrics.Metric(INDEXSEARCH_TAG_NAME); indexsearchMetric.addTag("utmTag", "other"); for (String utmTag : parameters.getUtmTags()) { From b7e3f15b18beb0481fe00c1af2fe7cf2e447957a Mon Sep 17 00:00:00 2001 From: Suman Das <59254445+sumandas0@users.noreply.github.com> Date: Thu, 25 Apr 2024 13:10:08 +0530 Subject: [PATCH 2/2] fix: make change to add sourse as tag --- .../main/java/org/apache/atlas/web/rest/DiscoveryREST.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/webapp/src/main/java/org/apache/atlas/web/rest/DiscoveryREST.java b/webapp/src/main/java/org/apache/atlas/web/rest/DiscoveryREST.java index 144e1171d1..590e3cb0bf 100644 --- a/webapp/src/main/java/org/apache/atlas/web/rest/DiscoveryREST.java +++ b/webapp/src/main/java/org/apache/atlas/web/rest/DiscoveryREST.java @@ -434,15 +434,19 @@ public AtlasSearchResult indexSearch(@Context HttpServletRequest servletRequest, } throw abe; } finally { - if(CollectionUtils.isNotEmpty(parameters.getUtmTags()) && parameters.getUtmTags().contains(UTM_TAG_FROM_PRODUCT)) { + if(CollectionUtils.isNotEmpty(parameters.getUtmTags())) { AtlasPerfMetrics.Metric indexsearchMetric = new AtlasPerfMetrics.Metric(INDEXSEARCH_TAG_NAME); indexsearchMetric.addTag("utmTag", "other"); + indexsearchMetric.addTag("source", "other"); for (String utmTag : parameters.getUtmTags()) { if (TRACKING_UTM_TAGS.contains(utmTag)) { indexsearchMetric.addTag("utmTag", utmTag); break; } } + if (parameters.getUtmTags().contains(UTM_TAG_FROM_PRODUCT)) { + indexsearchMetric.addTag("source", UTM_TAG_FROM_PRODUCT); + } indexsearchMetric.addTag("name", INDEXSEARCH_TAG_NAME); indexsearchMetric.setTotalTimeMSecs(System.currentTimeMillis() - startTime); RequestContext.get().addApplicationMetrics(indexsearchMetric);