Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: rebase with master and fix graphql mocks with latest changes #1

Merged
merged 191 commits into from
Jul 15, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
191 commits
Select commit Hold shift + click to select a range
7261eb9
fix(react): update ispartofbuilderfromdataflow, update ui in datajob …
topwebtek7 May 28, 2021
b512920
fix(ingestion): improve robustness of glue ingestion source (#2626)
thomasplarsson Jun 1, 2021
2f3de31
feat(react): custom properties are now sortable by name in the UI (#2…
Jun 2, 2021
9bff4e1
fix(ci): update trigger to always generate docker images (#2636)
Jun 3, 2021
6b9d0d0
fix(ingest): include urn as key for kafka emitter (#2634)
hsheth2 Jun 3, 2021
47554d2
fix(react): url encoding urns and tag profile fix (#2623)
gabe-lyons Jun 3, 2021
4e73011
feat(react): replace user urn with username (#2599)
shubham49 Jun 3, 2021
a0ad590
fix(ingest): improve redshift ingestion performance (#2635)
hsheth2 Jun 3, 2021
7a0bab6
docs: update roadmap with accomplished items (#2617)
shirshanka Jun 3, 2021
97e9660
feat: No Code Metadata Modeling (#2629)
jjoyce0510 Jun 3, 2021
b688918
docs(no-code): removing unused snapshot annotations (#2642)
gabe-lyons Jun 3, 2021
81c9fc3
feat(datahub-upgrade): Use the "head" image tag. (#2641)
jjoyce0510 Jun 3, 2021
c98446c
fix(datahub-upgrade): remove debug flag (#2640)
jjoyce0510 Jun 3, 2021
7f0c6bb
fix(build): don't purge ingestion codegen files on gradle clean (#2645)
hsheth2 Jun 4, 2021
5ca484a
fix(analytics): fix index names (#2647)
Jun 4, 2021
d5934f7
fix(nocode): Fix docker image tag for run_upgrade script (#2648)
Jun 4, 2021
e187b07
docs(nocode): Update migration docs with workaround for stuck upgrade…
Jun 4, 2021
9e79272
fix: use head tag by default in quickstart (#2650)
hsheth2 Jun 4, 2021
cc3caa9
fix(datahub-upgrade): fixing mis-spelled schema registry url (#2652)
jjoyce0510 Jun 4, 2021
d26903f
fix(gms): Return empty snapshots when one does not exist (#2646)
jjoyce0510 Jun 4, 2021
f91062d
docs(nocode): fix links to datahub-upgrade (#2651)
hsheth2 Jun 4, 2021
9829576
feat(datahub-upgrade): improve no code upgrade logging (#2653)
jjoyce0510 Jun 4, 2021
a483933
fix(docker): pin containers to golden hash for release (#2654)
hsheth2 Jun 4, 2021
ee454eb
feat(nocode): Add datahub-upgrade job to helm chart and set version t…
Jun 4, 2021
b1ff56f
docs(nocode): Adding documentation for no-migration upgrade option (#…
gabe-lyons Jun 5, 2021
e73c652
revert: "fix(docker): pin containers to golden hash for release (#265…
hsheth2 Jun 5, 2021
051fa25
fix(docker): use debug tag in local dev images (#2658)
hsheth2 Jun 5, 2021
31eae24
fix(ingest): support mssql encryption via ODBC (#2657)
hsheth2 Jun 5, 2021
9c030d8
fix(NoCode): Update snapshot json to latest (#2655)
Jun 7, 2021
2123c8b
fix(ingest): exclude mssql-odbc from "all" extra (#2660)
hsheth2 Jun 7, 2021
d3a1e2c
docs(nocode): adding documentation to handle backwards incompatibilit…
gabe-lyons Jun 8, 2021
83c5259
docs(nocode): fix typo in autocomplete annotation (#2664)
Jun 8, 2021
2f7b4f9
build(docker): test docker builds in pull request CI (#2661)
hsheth2 Jun 8, 2021
c0ace2c
fix(ingest): fix MyPy stubs (#2666)
kevinhu Jun 8, 2021
ebdaa0e
feat(ingest): Feast ingestion integration (#2605)
kevinhu Jun 9, 2021
28b5856
fix(no-code): Adding Chart input relationship annotations (#2669)
gabe-lyons Jun 9, 2021
91eb3cc
Add get_identifier to hive source in metadata ingestion (#2667)
zack3241 Jun 9, 2021
18557ed
feat(k8s): Add imagePullSecrets to all K8's jobs (#2671)
zack3241 Jun 10, 2021
61a8994
fix(analytics): Support sasl authentication to kafka (#2675)
thomasplarsson Jun 10, 2021
24268c2
feat(ingest): headers for codegen Python scripts (#2637)
kevinhu Jun 11, 2021
5eee818
fix(ingest): pin to new mypy version (#2670)
hsheth2 Jun 11, 2021
2cb0618
Fix 2592 neo4j connection options (#2632)
Jun 11, 2021
1857f85
fix(ingest): upgrade acryl-pyhive to use sasl3 instead of sasl (#2684)
hsheth2 Jun 12, 2021
1b53922
feat(ingest): support Oracle service names (#2676)
hsheth2 Jun 12, 2021
a7fc76f
feat(sql_views): added views as datasets for SQLAlchemy DBs (#2663)
vlavorini Jun 12, 2021
0b75b4a
removing whitespace from service aspect (#2688)
gabe-lyons Jun 13, 2021
9fb2e6a
Only work with dbt catalog data if load_catalog is False (#2686)
remisalmon Jun 14, 2021
1c364b5
feat(docs): Docs for S3 ingestion with AWS Glue (#2672)
kevinhu Jun 15, 2021
7591c89
feat(datahub cli): DataHub CLI Quickstart (#2689)
jjoyce0510 Jun 15, 2021
cc95916
feat(gms): Merge MAE, MCE consumers into GMS (#2690)
jjoyce0510 Jun 15, 2021
f3f562f
fix(NoCode): Fix product analytics (#2697)
Jun 15, 2021
5b595b4
feat(gms): support basic auth header when connecting to elasticSearc…
JeffSkinner Jun 16, 2021
a057932
Add support for different oidc client authentication methods (#2691)
kwark Jun 16, 2021
523c3bf
feat(aspects): support fetching of versioned aspects (#2677)
gabe-lyons Jun 16, 2021
a5f9b8d
feat(entities): add markdown description update/viewer feature in dat…
topwebtek7 Jun 16, 2021
63fe829
feat(ingest): Add test case and docs for SQL view ingestion (#2709)
kevinhu Jun 16, 2021
26dcece
fix(ingest): use `looker` data platform (#2708)
hsheth2 Jun 16, 2021
7e9a044
test(ingest): simplify docker cleanup commands (#2699)
hsheth2 Jun 16, 2021
0849874
feat: Adding annotation option to frontend service (#2674)
kuntalkumarbasu Jun 17, 2021
5d93f24
feat(ingest): expose additional types to Python via codegen (#2712)
hsheth2 Jun 17, 2021
943c54a
Removed key not in catalog filter from dbt and added node filter usin…
vijayan-nallasami-curve Jun 17, 2021
26329e0
added node_type_pattern in dbt yaml file (#2705)
vijayan-nallasami-curve Jun 17, 2021
0750332
fix(editable descriptions): adding indexing for editable descriptions…
gabe-lyons Jun 17, 2021
1efc08d
feat(quickstart): use versioned docker images when on a release tag (…
hsheth2 Jun 17, 2021
550a9de
fix(noCode): Improving efficiency of EntityService "listLatestAspects…
jjoyce0510 Jun 18, 2021
38471ac
fix(react): update schema description edit behavior (#2718)
topwebtek7 Jun 18, 2021
b6a849a
Update version for helm (#2719)
Jun 18, 2021
852e16c
fixing docs sidebar (#2721)
gabe-lyons Jun 18, 2021
8df7322
fix(docs): update extending-the-metadata-model.md (#2727)
gabe-lyons Jun 21, 2021
9b4df56
fix(docker): update default tags to head (#2730)
Jun 22, 2021
4944143
fix(looker): fix invalid URN syntax error (#2737)
remisalmon Jun 22, 2021
2c20bce
fix(ci): increase Feast docker setup timeout (#2722)
kevinhu Jun 22, 2021
554e163
fix(ingest): types for dbt (#2716)
kevinhu Jun 22, 2021
a89094d
feat(ingest): add support for Glue ETL jobs (#2687)
kevinhu Jun 22, 2021
4ddc4c2
fix(ingest): fix lookml platform URN (#2742)
kevinhu Jun 22, 2021
7171e97
fix(ingest): update lookml test (#2741)
hsheth2 Jun 22, 2021
4806145
fix(gms): fixes for version aspect fetching (#2723)
gabe-lyons Jun 22, 2021
3f5e371
feat(graph): support using elasticsearch as graph backend. (#2726)
gabe-lyons Jun 22, 2021
fffc617
feat(ingest): print docker logs on timeout (#2743)
kevinhu Jun 23, 2021
96dde2c
fix(ci): increase wait-for-it timeout to fix flaky feast test (#2747)
kevinhu Jun 23, 2021
5a4d194
feat(docker): reduce quickstart footprint (#2744)
jjoyce0510 Jun 23, 2021
8fc1947
feat(quickstart): remove orphaned docker containers on quickstart thr…
jjoyce0510 Jun 23, 2021
f0b4adc
fix(gms): add rest.li validation in gms (#2745)
jjoyce0510 Jun 23, 2021
2a7082b
fix(datahub-upgrade): add support for postgres migration (#2740)
jjoyce0510 Jun 23, 2021
e640f5e
fix(docker): modernize docker images and fix vulnerabilities (#2746)
Jun 23, 2021
22a2ed8
feat(ingest): ingest last-modified from dbt sources.json (#2729)
kevinhu Jun 23, 2021
91f5d4f
feat(ingest): add option to specify source platform database in lookm…
remisalmon Jun 23, 2021
7615ddb
fix(gms): make get return entity type (#2739)
jjoyce0510 Jun 23, 2021
f4ff540
fix(elastic-as-graph): adding elasticsearch setup back in (#2752)
gabe-lyons Jun 24, 2021
2df8214
fix(browse): sort by doc count descending (#2751)
Jun 24, 2021
938dbc8
Revert "fix(gms): add rest.li validation in gms (#2745)" (#2754)
gabe-lyons Jun 24, 2021
8246801
fix(docker): use head tag for datahub-ingestion (#2760)
hsheth2 Jun 24, 2021
62ba937
feat(elastic-as-graph): defaulting to elastic in quickstart (#2753)
gabe-lyons Jun 24, 2021
c225242
fix(react): reverse result of topological sort, autofocus in add tag …
topwebtek7 Jun 24, 2021
937f02c
feat: usage stats (part 1) (#2750)
hsheth2 Jun 25, 2021
19b2a42
feat: usage stats (part 2) (#2762)
hsheth2 Jun 25, 2021
64a5ea5
docs: update for Jun townhall (#2764)
hsheth2 Jun 25, 2021
c04f856
fix(frontend): auth session ttl specified in hours instead of days. M…
thomasplarsson Jun 25, 2021
7a93a41
fix(react): move percent sign after number and update meta tag (#2765)
hsheth2 Jun 25, 2021
3caa09d
fix(docker): Fix dependency vulnerability (#2763)
Jun 25, 2021
c74c20a
fix(datahub-upgrade): removing the CleanupStep from datahub upgrade (…
jjoyce0510 Jun 25, 2021
4241391
docs(ingest): move usage stats docs into the "sources" section (#2766)
hsheth2 Jun 25, 2021
88a7f52
fix(react): update the query frequency text label (#2767)
hsheth2 Jun 25, 2021
1bd22b4
feat(k8s): add GCP deploy recipe (#2768)
Jun 25, 2021
a0d188c
fix(react): fix graphql apollo cache update issue cause of usagestats…
topwebtek7 Jun 25, 2021
09cbc54
feat(logs): improve logging in GMS and datahub-frontend (#2761)
jjoyce0510 Jun 25, 2021
ae8a889
fix(nocode): removing service PDL (#2772)
Jun 25, 2021
29be543
fix(react): update platform text in dataset profile header (#2771)
topwebtek7 Jun 25, 2021
942196e
feat(logs): add thresholding, misc cleanup (#2773)
jjoyce0510 Jun 25, 2021
c05459b
docs: upgrade docusaurus, minor ingestion updates (#2774)
hsheth2 Jun 28, 2021
09bbcea
feat(ingest): add non-random sampling for mongo (#2778)
kevinhu Jun 28, 2021
157c785
feat(react-graphql-mock): mock graphql queries and mutations with mir…
May 8, 2021
c85dd30
feat(react): configure Cypress + MirageJS + GraphQL mock for function…
May 22, 2021
a093bb6
fix(react): fix mutation helper for updateentitylink
topwebtek7 Jun 25, 2021
1745f9e
feat(react): update graphql issues with mock data
topwebtek7 Jun 28, 2021
313da07
fix(docker): Upgrade to 4.1.44 netty-all library (#2784)
Jun 29, 2021
5e69a43
refactor(ingest): use common get_sys_time method (#2782)
hsheth2 Jun 29, 2021
14294e8
fix(docs): links to Feast entities (#2780)
kevinhu Jun 29, 2021
84058c8
feat(k8s): Upgrade to v0.8.4 (#2792)
Jun 29, 2021
849b6b4
fix(frontend): making nested SSL configs optional (#2785)
jjoyce0510 Jun 29, 2021
7083de9
fix(ingest): use correct platform for MongoDB ingestion (#2783)
kevinhu Jun 29, 2021
c433354
Update quickstart to include system prune (#2794)
jjoyce0510 Jun 29, 2021
68111e0
docs(website): add releases page (#2776)
hsheth2 Jun 29, 2021
79f60d8
refactor(ingest): remove deprecated methods and warn on deprecated im…
hsheth2 Jun 29, 2021
2ee9ecf
fix(usage-stats): add indices target for usage stats query (#2798)
Jun 29, 2021
57ddb41
fix(ingest): handle case when view definition handler is not implemen…
hsheth2 Jun 30, 2021
c8fe8d4
fix(ingest): quote table names in hive (#2801)
hsheth2 Jun 30, 2021
69d9cf4
fix(datahub-upgrade): add runtime dependency on logbackClassic (#2799)
jjoyce0510 Jun 30, 2021
6fee59e
fix(search): Filter out "removed" entities from autocomplete and anal…
Jun 30, 2021
2aa95ec
feat(ingest): Improve lookml sql derived tables detection, add cascad…
remisalmon Jun 30, 2021
4da7672
feat(ingest): SageMaker feature store ingestion (#2758)
kevinhu Jun 30, 2021
ef75bc6
fix(ingest): better warnings and error handling for rest sink (#2800)
hsheth2 Jun 30, 2021
8df8ff9
fix(usage-stats): Add usage stats factory to mae processor config (#2…
Jun 30, 2021
906ad67
refactor(ingest): extract sqlalchemy uri generation logic (#2786)
hsheth2 Jun 30, 2021
c7ce817
fix(quickstart): Fixing manual mysql quickstart (#2811)
jjoyce0510 Jun 30, 2021
e51f86a
feat(ingest): support ingesting from multiple snowflake dbs (#2793)
hsheth2 Jun 30, 2021
8f0f322
feat(backup): Add restore indices and restore backup tasks (#2779)
Jun 30, 2021
8a074ea
docs(website): hide outdated FAQs page (#2809)
hsheth2 Jun 30, 2021
d663814
feat(ingest): refactor mce comparison and add pytest update golden fi…
hsheth2 Jun 30, 2021
725abf5
fix(k8s): upgrade helm version (#2810)
Jun 30, 2021
6fe663b
feat(ingest): basic support for complex hive types (#2804)
hsheth2 Jul 1, 2021
ad08113
fix(datahub-upgrade): fix vulnerabilities (#2813)
Jul 1, 2021
eb60da9
chore(helm): upgrade version to v0.8.5 (#2814)
Jul 1, 2021
050d940
feat(datahub-frontend): Adding basic file-based authentication to dat…
jjoyce0510 Jul 2, 2021
d6c3043
fix(ingest): view handling resilience for redshift (#2816)
hsheth2 Jul 2, 2021
4c39d86
docs(ingest): add extra info for Redshift behind a proxy (#2817)
hsheth2 Jul 2, 2021
92db0f4
fix(docs): update OIDC docs (#2823)
jjoyce0510 Jul 2, 2021
7702f1f
docs(docker): fix check command reference (#2822)
hsheth2 Jul 2, 2021
8d63624
docs(elastic-for-graph): Add migrating from neo4j to elastic instruct…
gabe-lyons Jul 3, 2021
6ef0bf0
fix(ingest): convert superset timestamps to micros (#2827)
hsheth2 Jul 3, 2021
1b47885
feat(ci): separate metadata-ingestion into a separate workflow (#2828)
hsheth2 Jul 3, 2021
2a9fdfc
fix(cli): change docker nuke to also remove stopped containers (#2825)
hsheth2 Jul 3, 2021
850c2f2
fix(mae-consumer): support standalone mae consumer without neo4j (#2824)
gabe-lyons Jul 3, 2021
3d9f4ec
docs: update H2 2021 roadmap (#2829)
shirshanka Jul 3, 2021
288d17f
docs(ingest): update links to Kafka docs (#2834)
hsheth2 Jul 6, 2021
6b59cde
fix(ingest): mask password in info-level logs (#2835)
hsheth2 Jul 6, 2021
523fa32
fix(ingest): various BigQuery source fixes (#2836)
hsheth2 Jul 7, 2021
2d1dd95
docs(ingest): clarify that the Kafka options are pass-through (#2837)
hsheth2 Jul 7, 2021
739e0ef
fix(ingest): do not fail dbt ingestion when encountering missing node…
kevinhu Jul 7, 2021
56a5e33
feat (helm datahub-gms): add ingress template to datahub-gms helm cha…
datascienceChris Jul 7, 2021
851fe13
feat(react): fix apollo client cache issues in entities profile pages…
topwebtek7 Jul 7, 2021
2f921d1
fix(ingest): avoid setting timestamps unless source system provides i…
hsheth2 Jul 8, 2021
78ab198
fix(docs): fix some broken links in the docs (#2846)
hsheth2 Jul 8, 2021
c2f2973
fix(ingest): Fix glob pattern and handle possible recursion in lookml…
frsann Jul 8, 2021
74e34dd
feat(ingest): prettify stack traces in CLI (#2845)
hsheth2 Jul 8, 2021
acb638c
fix(analytics): Fix SSL issue with analytics on frontend (#2840)
Jul 8, 2021
799b063
fix(ingest): check for dbt materialization before proceeding (#2842)
kevinhu Jul 8, 2021
a117b63
feat(docs): throttle and retry requests in doc generation (#2847)
hsheth2 Jul 8, 2021
a2106ca
feat(ingest): SageMaker jobs and models (#2830)
kevinhu Jul 8, 2021
83fd69d
docs(ingest): remove hanging sentence from docs (#2853)
hsheth2 Jul 8, 2021
f6e7229
fix(ingest): delete pycache files when running clean (#2852)
hsheth2 Jul 9, 2021
fd02f71
fix(ingest): handle 'fields' list missing in bigquery-usage (#2844)
hsheth2 Jul 9, 2021
5cbbebe
feat(k8s): Extract helm charts into a separate repo (#2848)
Jul 9, 2021
0e36df4
fix(react): fix searchbar width issue in small screen (#2856)
topwebtek7 Jul 9, 2021
eff502b
feat(react): implement visualizing historical versions of dataset sch…
topwebtek7 Jul 9, 2021
94fd17a
feat(docs): carousels for videos and articles (#2857)
kevinhu Jul 9, 2021
95b73c4
fix(frontend): handling null aspects in AspectType (#2860)
gabe-lyons Jul 10, 2021
973c08d
fix: fixing lint issue (#2861)
gabe-lyons Jul 10, 2021
220dfe7
feat(ingest): support dynamic imports for transfomer methods (#2858)
hsheth2 Jul 12, 2021
e22bd95
feat(docs): swap Medium and videos sections (#2859)
kevinhu Jul 12, 2021
c4e2b9a
feat(ingest): add browse paths + dataplatform for Feast features (#2849)
kevinhu Jul 12, 2021
91e5fd4
fix(build): increase retries for dependency fetches (#2867)
hsheth2 Jul 13, 2021
d7248fd
build(ingest): separate metadata-ingestion build workflow fully (#2862)
hsheth2 Jul 13, 2021
8c3d266
fix(quickstart): update compose spec version (#2873)
hsheth2 Jul 13, 2021
9e3c520
docs(quickstart): add default password to quickstart (#2875)
hsheth2 Jul 13, 2021
bc84c82
feat(ingest): extract dbt meta fields (#2876)
kevinhu Jul 13, 2021
904d441
feat(ingest): update golden files only when diff fails (#2869)
kevinhu Jul 13, 2021
f01bb8b
build(ingestion): add version prompt to release script (#2866)
hsheth2 Jul 13, 2021
a6dc9e0
fix(react): fix bug in description update modal (#2874)
topwebtek7 Jul 14, 2021
100c90d
Merge branch 'master' into FeatCypressMiragejs
topwebtek7 Jul 14, 2021
f98d64c
fix(react): update dataset graphql mock
topwebtek7 Jul 14, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(analytics): Fix SSL issue with analytics on frontend (datahub-pro…
  • Loading branch information
Dexter Lee authored Jul 8, 2021
commit acb638cb6580b69d49ebed1d4d9cb3816035c17d
39 changes: 25 additions & 14 deletions datahub-frontend/app/react/analytics/AnalyticsService.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public class AnalyticsService {
private final Logger _logger = LoggerFactory.getLogger(AnalyticsService.class.getName());

private final RestHighLevelClient _elasticClient;
private final Optional<String> _indexPrefix;

private static final String INDEX_NAME = "datahub_usage_event";
private static final String FILTERED = "filtered";
private static final String DATE_HISTOGRAM = "date_histogram";
private static final String UNIQUE = "unique";
Expand All @@ -58,17 +58,24 @@ public class AnalyticsService {
public static final String DATA_JOB_INDEX = "datajobindex_v2";
public static final String DATASET_INDEX = "datasetindex_v2";

public AnalyticsService(final RestHighLevelClient elasticClient) {
public AnalyticsService(final RestHighLevelClient elasticClient, final Optional<String> indexPrefix) {
_elasticClient = elasticClient;
_indexPrefix = indexPrefix;
}

private String getIndexName(String baseIndexName) {
return _indexPrefix.map(p -> p + "_").orElse("") + baseIndexName;
}

public List<NamedLine> getTimeseriesChart(String indexName, DateRange dateRange, DateInterval granularity,
Optional<String> dimension, // Length 1 for now
Map<String, List<String>> filters, Optional<String> uniqueOn) {

String finalIndexName = getIndexName(indexName);
_logger.debug(
String.format("Invoked getTimeseriesChart with indexName: %s, dateRange: %s, granularity: %s, dimension: %s,",
indexName, dateRange, granularity, dimension)
+ String.format("filters: %s, uniqueOn: %s", filters, uniqueOn));
finalIndexName, dateRange, granularity, dimension) + String.format("filters: %s, uniqueOn: %s", filters,
uniqueOn));

AggregationBuilder filteredAgg = getFilteredAggregation(filters, ImmutableMap.of(), Optional.of(dateRange));

Expand All @@ -84,7 +91,7 @@ public List<NamedLine> getTimeseriesChart(String indexName, DateRange dateRange,
filteredAgg.subAggregation(dateHistogram);
}

SearchRequest searchRequest = constructSearchRequest(indexName, filteredAgg);
SearchRequest searchRequest = constructSearchRequest(finalIndexName, filteredAgg);
Aggregations aggregationResult = executeAndExtract(searchRequest).getAggregations();
try {
if (dimension.isPresent()) {
Expand Down Expand Up @@ -117,10 +124,10 @@ private List<NumericDataPoint> extractPointsFromAggregations(Aggregations aggreg
public List<NamedBar> getBarChart(String indexName, Optional<DateRange> dateRange, List<String> dimensions,
// Length 1 or 2
Map<String, List<String>> filters, Optional<String> uniqueOn) {
String finalIndexName = getIndexName(indexName);
_logger.debug(
String.format("Invoked getBarChart with indexName: %s, dateRange: %s, dimensions: %s,",
indexName, dateRange, dimensions)
+ String.format("filters: %s, uniqueOn: %s", filters, uniqueOn));
String.format("Invoked getBarChart with indexName: %s, dateRange: %s, dimensions: %s,", finalIndexName,
dateRange, dimensions) + String.format("filters: %s, uniqueOn: %s", filters, uniqueOn));

assert (dimensions.size() == 1 || dimensions.size() == 2);
AggregationBuilder filteredAgg = getFilteredAggregation(filters, ImmutableMap.of(), dateRange);
Expand All @@ -136,7 +143,7 @@ public List<NamedBar> getBarChart(String indexName, Optional<DateRange> dateRang
}
filteredAgg.subAggregation(termAgg);

SearchRequest searchRequest = constructSearchRequest(indexName, filteredAgg);
SearchRequest searchRequest = constructSearchRequest(finalIndexName, filteredAgg);
Aggregations aggregationResult = executeAndExtract(searchRequest).getAggregations();

try {
Expand Down Expand Up @@ -169,10 +176,10 @@ private List<BarSegment> extractBarSegmentsFromAggregations(Aggregations aggrega

public List<Row> getTopNTableChart(String indexName, Optional<DateRange> dateRange, String groupBy,
Map<String, List<String>> filters, Optional<String> uniqueOn, int maxRows) {
String finalIndexName = getIndexName(indexName);
_logger.debug(
String.format("Invoked getTopNTableChart with indexName: %s, dateRange: %s, groupBy: %s",
indexName, dateRange, groupBy)
+ String.format("filters: %s, uniqueOn: %s", filters, uniqueOn));
String.format("Invoked getTopNTableChart with indexName: %s, dateRange: %s, groupBy: %s", finalIndexName,
dateRange, groupBy) + String.format("filters: %s, uniqueOn: %s", filters, uniqueOn));

AggregationBuilder filteredAgg = getFilteredAggregation(filters, ImmutableMap.of(), dateRange);

Expand All @@ -183,7 +190,7 @@ public List<Row> getTopNTableChart(String indexName, Optional<DateRange> dateRan
}
filteredAgg.subAggregation(termAgg);

SearchRequest searchRequest = constructSearchRequest(indexName, filteredAgg);
SearchRequest searchRequest = constructSearchRequest(finalIndexName, filteredAgg);
Aggregations aggregationResult = executeAndExtract(searchRequest).getAggregations();

try {
Expand All @@ -200,10 +207,14 @@ public List<Row> getTopNTableChart(String indexName, Optional<DateRange> dateRan

public int getHighlights(String indexName, Optional<DateRange> dateRange, Map<String, List<String>> filters,
Map<String, List<String>> mustNotFilters, Optional<String> uniqueOn) {
String finalIndexName = getIndexName(indexName);
_logger.debug(String.format("Invoked getHighlights with indexName: %s, dateRange: %s", finalIndexName, dateRange)
+ String.format("filters: %s, uniqueOn: %s", filters, uniqueOn));

AggregationBuilder filteredAgg = getFilteredAggregation(filters, mustNotFilters, dateRange);
uniqueOn.ifPresent(s -> filteredAgg.subAggregation(getUniqueQuery(s)));

SearchRequest searchRequest = constructSearchRequest(indexName, filteredAgg);
SearchRequest searchRequest = constructSearchRequest(finalIndexName, filteredAgg);
Filter aggregationResult = executeAndExtract(searchRequest);
try {
if (uniqueOn.isPresent()) {
Expand Down
37 changes: 22 additions & 15 deletions datahub-frontend/app/react/analytics/AnalyticsServiceModule.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package react.analytics;

import com.google.inject.AbstractModule;
import java.util.Optional;
import org.apache.http.ssl.SSLContextBuilder;
import play.Environment;
import javax.annotation.Nonnull;
Expand All @@ -14,6 +15,8 @@
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.security.cert.CertificateException;
import utils.ConfigUtil;


/**
* Guice module responsible for configuring & creating an instance of {@link AnalyticsService}.
Expand All @@ -33,6 +36,7 @@ public class AnalyticsServiceModule extends AbstractModule {
private static final String ELASTIC_CLIENT_CONNECTION_REQUEST_TIMEOUT_PATH = "analytics.elastic.connectionRequestTimeout";
private static final String ELASTIC_CLIENT_USERNAME_PATH = "analytics.elastic.username";
private static final String ELASTIC_CLIENT_PASSWORD_PATH = "analytics.elastic.password";
private static final String ELASTIC_INDEX_PREFIX = "analytics.elastic.indexPrefix";

/*
Required SSL Config Paths
Expand Down Expand Up @@ -61,29 +65,32 @@ public AnalyticsServiceModule(final Environment environment, final com.typesafe.
@Override
protected void configure() {
final SSLContext context = createSSLContext();
final AnalyticsService backend = new AnalyticsService(ElasticClientFactory.createElasticClient(
_configs.hasPath(ELASTIC_CLIENT_USE_SSL_PATH) && _configs.getBoolean(ELASTIC_CLIENT_USE_SSL_PATH),
final AnalyticsService backend = new AnalyticsService(
ElasticClientFactory.createElasticClient(
ConfigUtil.getBoolean(_configs, ELASTIC_CLIENT_USE_SSL_PATH),
_configs.getString(ELASTIC_CLIENT_HOST_PATH),
_configs.getInt(ELASTIC_CLIENT_PORT_PATH),
_configs.hasPath(ELASTIC_CLIENT_THREAD_COUNT_PATH) ? _configs.getInt(ELASTIC_CLIENT_THREAD_COUNT_PATH) : DEFAULT_THREAD_COUNT,
_configs.hasPath(ELASTIC_CLIENT_CONNECTION_REQUEST_TIMEOUT_PATH) ? _configs.getInt(ELASTIC_CLIENT_CONNECTION_REQUEST_TIMEOUT_PATH) : DEFAULT_CONNECTION_TIMEOUT,
_configs.hasPath(ELASTIC_CLIENT_USERNAME_PATH) ? _configs.getString(ELASTIC_CLIENT_USERNAME_PATH) : null,
_configs.hasPath(ELASTIC_CLIENT_PASSWORD_PATH) ? _configs.getString(ELASTIC_CLIENT_PASSWORD_PATH) : null,
ConfigUtil.getInt(_configs, ELASTIC_CLIENT_THREAD_COUNT_PATH, DEFAULT_THREAD_COUNT),
ConfigUtil.getInt(_configs, ELASTIC_CLIENT_CONNECTION_REQUEST_TIMEOUT_PATH, DEFAULT_CONNECTION_TIMEOUT),
ConfigUtil.getString(_configs, ELASTIC_CLIENT_USERNAME_PATH, null),
ConfigUtil.getString(_configs, ELASTIC_CLIENT_PASSWORD_PATH, null),
context
));
),
Optional.ofNullable(ConfigUtil.getString(_configs, ELASTIC_INDEX_PREFIX, null))
);
bind(AnalyticsService.class).toInstance(backend);
}

private SSLContext createSSLContext() {

final String sslProtocol = _configs.hasPath(ELASTIC_CLIENT_SSL_PROTOCOL_PATH) ? _configs.getString(ELASTIC_CLIENT_SSL_PROTOCOL_PATH) : null;
final String sslTrustStoreFile = _configs.hasPath(ELASTIC_CLIENT_SSL_TRUST_STORE_FILE_PATH) ? _configs.getString(ELASTIC_CLIENT_SSL_TRUST_STORE_FILE_PATH) : null;
final String sslTrustStoreType = _configs.hasPath(ELASTIC_CLIENT_SSL_TRUST_STORE_TYPE_PATH) ? _configs.getString(ELASTIC_CLIENT_SSL_TRUST_STORE_TYPE_PATH) : null;
final String sslTrustStorePassword = _configs.hasPath(ELASTIC_CLIENT_SSL_TRUST_STORE_PASSWORD_PATH) ? _configs.getString(ELASTIC_CLIENT_SSL_TRUST_STORE_PASSWORD_PATH): null;
final String sslKeyStoreFile = _configs.hasPath(ELASTIC_CLIENT_SSL_KEY_STORE_FILE_PATH) ? _configs.getString(ELASTIC_CLIENT_SSL_KEY_STORE_FILE_PATH) : null;
final String sslKeyStoreType = _configs.hasPath(ELASTIC_CLIENT_SSL_KEY_STORE_TYPE_PATH) ? _configs.getString(ELASTIC_CLIENT_SSL_KEY_STORE_TYPE_PATH) : null;
final String sslKeyStorePassword = _configs.hasPath(ELASTIC_CLIENT_SSL_KEY_STORE_PASSWORD_PATH) ? _configs.getString(ELASTIC_CLIENT_SSL_KEY_STORE_PASSWORD_PATH) : null;
final String sslSecureRandomImplementation = _configs.hasPath(ELASTIC_CLIENT_SSL_SECURE_RANDOM_IMPL_PATH) ? _configs.getString(ELASTIC_CLIENT_SSL_SECURE_RANDOM_IMPL_PATH) : null;
final String sslProtocol = ConfigUtil.getString(_configs, ELASTIC_CLIENT_SSL_PROTOCOL_PATH, null);
final String sslTrustStoreFile = ConfigUtil.getString(_configs, ELASTIC_CLIENT_SSL_TRUST_STORE_FILE_PATH, null);
final String sslTrustStoreType = ConfigUtil.getString(_configs, ELASTIC_CLIENT_SSL_TRUST_STORE_TYPE_PATH, null);
final String sslTrustStorePassword = ConfigUtil.getString(_configs, ELASTIC_CLIENT_SSL_TRUST_STORE_PASSWORD_PATH, null);
final String sslKeyStoreFile = ConfigUtil.getString(_configs, ELASTIC_CLIENT_SSL_KEY_STORE_FILE_PATH, null);
final String sslKeyStoreType = ConfigUtil.getString(_configs, ELASTIC_CLIENT_SSL_KEY_STORE_TYPE_PATH, null);
final String sslKeyStorePassword = ConfigUtil.getString(_configs, ELASTIC_CLIENT_SSL_KEY_STORE_PASSWORD_PATH, null);
final String sslSecureRandomImplementation = ConfigUtil.getString(_configs, ELASTIC_CLIENT_SSL_SECURE_RANDOM_IMPL_PATH, null);

final SSLContextBuilder sslContextBuilder = new SSLContextBuilder();
if (sslProtocol != null) {
Expand Down
30 changes: 19 additions & 11 deletions datahub-frontend/app/react/controllers/TrackingController.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.Properties;
import utils.ConfigUtil;


public class TrackingController extends Controller {

Expand Down Expand Up @@ -86,6 +89,11 @@ protected void finalize() {
_producer.close();
}

private void setConfig(Properties props, String key, String configKey) {
Optional.ofNullable(ConfigUtil.getString(_config, configKey, null))
.ifPresent(v -> props.put(key, v));
}

private KafkaProducer createKafkaProducer() {
final Properties props = new Properties();
props.put(ProducerConfig.CLIENT_ID_CONFIG, "datahub-frontend");
Expand All @@ -97,22 +105,22 @@ private KafkaProducer createKafkaProducer() {
if (_config.hasPath(securityProtocolConfig)
&& KAFKA_SSL_PROTOCOLS.contains(_config.getString(securityProtocolConfig))) {
props.put(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG, _config.getString(securityProtocolConfig));
props.put(SslConfigs.SSL_KEY_PASSWORD_CONFIG, _config.getString("analytics.kafka.ssl.key.password"));
setConfig(props, SslConfigs.SSL_KEY_PASSWORD_CONFIG, "analytics.kafka.ssl.key.password");

props.put(SslConfigs.SSL_KEYSTORE_TYPE_CONFIG, _config.getString("analytics.kafka.ssl.keystore.type"));
props.put(SslConfigs.SSL_KEYSTORE_LOCATION_CONFIG, _config.getString("analytics.kafka.ssl.keystore.location"));
props.put(SslConfigs.SSL_KEYSTORE_PASSWORD_CONFIG, _config.getString("analytics.kafka.ssl.keystore.password"));
setConfig(props, SslConfigs.SSL_KEYSTORE_TYPE_CONFIG, "analytics.kafka.ssl.keystore.type");
setConfig(props, SslConfigs.SSL_KEYSTORE_LOCATION_CONFIG, "analytics.kafka.ssl.keystore.location");
setConfig(props, SslConfigs.SSL_KEYSTORE_PASSWORD_CONFIG, "analytics.kafka.ssl.keystore.password");

props.put(SslConfigs.SSL_TRUSTSTORE_TYPE_CONFIG, _config.getString("analytics.kafka.ssl.truststore.type"));
props.put(SslConfigs.SSL_TRUSTSTORE_LOCATION_CONFIG, _config.getString("analytics.kafka.ssl.truststore.location"));
props.put(SslConfigs.SSL_TRUSTSTORE_PASSWORD_CONFIG, _config.getString("analytics.kafka.ssl.truststore.password"));
setConfig(props, SslConfigs.SSL_TRUSTSTORE_TYPE_CONFIG, "analytics.kafka.ssl.truststore.type");
setConfig(props, SslConfigs.SSL_TRUSTSTORE_LOCATION_CONFIG, "analytics.kafka.ssl.truststore.location");
setConfig(props, SslConfigs.SSL_TRUSTSTORE_PASSWORD_CONFIG, "analytics.kafka.ssl.truststore.password");

props.put(SslConfigs.SSL_PROTOCOL_CONFIG, _config.getString("analytics.kafka.ssl.protocol"));
props.put(SslConfigs.SSL_ENDPOINT_IDENTIFICATION_ALGORITHM_CONFIG, _config.getString("analytics.kafka.ssl.endpoint.identification.algorithm"));
setConfig(props, SslConfigs.SSL_PROTOCOL_CONFIG, "analytics.kafka.ssl.protocol");
setConfig(props, SslConfigs.SSL_ENDPOINT_IDENTIFICATION_ALGORITHM_CONFIG, "analytics.kafka.ssl.endpoint.identification.algorithm");

if (_config.getString(securityProtocolConfig).equals(SecurityProtocol.SASL_SSL.name())) {
props.put(SaslConfigs.SASL_MECHANISM, _config.getString("analytics.kafka.sasl.mechanism"));
props.put(SaslConfigs.SASL_JAAS_CONFIG, _config.getString("analytics.kafka.sasl.jaas.config"));
setConfig(props, SaslConfigs.SASL_MECHANISM, "analytics.kafka.sasl.mechanism");
setConfig(props, SaslConfigs.SASL_JAAS_CONFIG, "analytics.kafka.sasl.jaas.config");
}
}

Expand Down
18 changes: 18 additions & 0 deletions datahub-frontend/app/utils/ConfigUtil.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package utils;

import com.typesafe.config.Config;


public class ConfigUtil {
public static boolean getBoolean(Config config, String key) {
return config.hasPath(key) && config.getBoolean(key);
}

public static int getInt(Config config, String key, int defaultValue) {
return config.hasPath(key) ? config.getInt(key) : defaultValue;
}

public static String getString(Config config, String key, String defaultValue) {
return config.hasPath(key) ? config.getString(key) : defaultValue;
}
}
4 changes: 3 additions & 1 deletion datahub-frontend/conf/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -184,4 +184,6 @@ analytics.elastic.sslContext.sslKeyStorePassword = ${?ELASTIC_CLIENT_SSL_KEY_STO

# Optional username + password for use with SSL
analytics.elastic.username = ${?ELASTIC_CLIENT_USERNAME}
analytics.elastic.password = ${?ELASTIC_CLIENT_PASSWORD}
analytics.elastic.password = ${?ELASTIC_CLIENT_PASSWORD}

analytics.elastic.indexPrefix = ${?ELASTIC_INDEX_PREFIX}
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,20 @@ spec:
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
volumes:
{{- with .Values.global.credentialsAndCertsSecrets }}
- name: datahub-certs-dir
secret:
defaultMode: 0444
secretName: {{ .name }}
{{- end }}
{{- if .Values.exporters.jmx.enabled }}
- name: config-jmx-exporter
configMap:
name: {{ include "datahub-gms.fullname" . }}-config-jmx-exporter
{{- end }}
{{- with .Values.extraVolumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.exporters.jmx.enabled }}
- name: config-jmx-exporter
configMap:
name: {{ include "datahub-frontend.fullname" . }}-config-jmx-exporter
{{- end }}
initContainers:
{{- with .Values.extraInitContainers }}
{{- toYaml . | nindent 8 }}
Expand Down Expand Up @@ -82,8 +88,26 @@ spec:
value: "{{ .Values.global.datahub.appVersion }}"
- name: DATAHUB_PLAY_MEM_BUFFER_SIZE
value: "{{ .Values.datahub.play.mem.buffer.size }}"
- name: DATAHUB_ANALYTICS_ENABLED
value: "{{ .Values.global.datahub_analytics_enabled }}"
{{- if .Values.global.datahub_analytics_enabled }}
- name: KAFKA_BOOTSTRAP_SERVER
value: "{{ .Values.global.kafka.bootstrap.server }}"
{{- if .Values.global.springKafkaConfigurationOverrides }}
{{- range $configName, $configValue := .Values.global.springKafkaConfigurationOverrides }}
- name: KAFKA_PROPERTIES_{{ $configName | replace "." "_" | upper }}
value: {{ $configValue }}
{{- end }}
{{- end }}
{{- if .Values.global.credentialsAndCertsSecrets }}
{{- range $envVarName, $envVarValue := .Values.global.credentialsAndCertsSecrets.secureEnv }}
- name: KAFKA_PROPERTIES_{{ $envVarName | replace "." "_" | upper }}
valueFrom:
secretKeyRef:
name: {{ $.Values.global.credentialsAndCertsSecrets.name }}
key: {{ $envVarValue }}
{{- end }}
{{- end }}
- name: ELASTIC_CLIENT_HOST
value: "{{ .Values.global.elasticsearch.host }}"
- name: ELASTIC_CLIENT_PORT
Expand All @@ -101,14 +125,22 @@ spec:
name: "{{ .password.secretRef }}"
key: "{{ .password.secretKey }}"
{{- end }}
{{- if .Values.global.kafka.topics }}
- name: DATAHUB_TRACKING_TOPIC
value: {{ .Values.global.kafka.topics.datahub_usage_event_name}}
{{- else }}
- name: DATAHUB_TRACKING_TOPIC
value: "DataHubUsageEvent_v1"
- name: DATAHUB_ANALYTICS_ENABLED
value: "{{ .Values.global.datahub_analytics_enabled }}"
{{- end }}
{{- end }}
{{- with .Values.extraEnvs }}
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts:
{{- with .Values.global.credentialsAndCertsSecrets }}
- name: datahub-certs-dir
mountPath: {{ .path | default "/mnt/certs" }}
{{- end }}
{{- with .Values.extraVolumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
Expand Down
Loading