Skip to content

Commit

Permalink
[Manual Backport 2.x] Add support for register data sources during th…
Browse files Browse the repository at this point in the history
…e absence of local cluster (#2144)
  • Loading branch information
RyanL1997 authored Sep 9, 2024
1 parent c48c488 commit 12baaea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ export class ObservabilityPlugin
constructor(initializerContext: PluginInitializerContext) {
this.config = initializerContext.config.get<PublicConfig>();
}
private mdsFlagStatus: boolean = false;

public setup(
core: CoreSetup<AppPluginStartDependencies>,
Expand All @@ -184,6 +185,7 @@ export class ObservabilityPlugin
});

setupOverviewPage(setupDeps.contentManagement!);
this.mdsFlagStatus = !!setupDeps.dataSource;

// redirect legacy notebooks URL to current URL under observability
if (window.location.pathname.includes('notebooks-dashboards')) {
Expand Down Expand Up @@ -459,7 +461,8 @@ export class ObservabilityPlugin
return `${type.charAt(0).toUpperCase()}${type.slice(1)}`;
};

// register all s3 datasources
// register all s3 datasources only if mds feature flag is disabled
if (!this.mdsFlagStatus) {
const registerDataSources = () => {
try {
core.http.get(`${DATACONNECTIONS_BASE}`).then((s3DataSources) => {
Expand Down Expand Up @@ -509,6 +512,7 @@ export class ObservabilityPlugin
} else {
registerDataSources();
}
}

core.http.intercept({
request: catalogRequestIntercept(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Compatible with OpenSearch and OpenSearch Dashboards version 2.17.0
* [query assist] update api handler to accommodate new ml-commons config response ([#2111](https://github.com/opensearch-project/dashboards-observability/pull/2111))
* Update trace analytics landing page ([#2125](https://github.com/opensearch-project/dashboards-observability/pull/2125))
* [query assist] update ml-commons response schema ([#2124](https://github.com/opensearch-project/dashboards-observability/pull/2124))
* [MDS] Add support for register data sources during the absence of local cluster ([#2140](https://github.com/opensearch-project/dashboards-observability/pull/2140))

### Bug Fixes
* [Bug] Trace Analytics bug fix for local cluster being rendered ([#2006](https://github.com/opensearch-project/dashboards-observability/pull/2006))
Expand Down

0 comments on commit 12baaea

Please sign in to comment.