mirror of
https://github.com/SigNoz/signoz.git
synced 2026-02-03 08:33:26 +00:00
feat: pass region to docs (#10068)
* chore: init pass region and ingestion key to docs * chore: test add staging url * fix: pass ingestion region from url * chore: remove ingestion key from param * fix: set search param only if url matches * revert: docs url * fix: region parsing * fix: resolve comments
This commit is contained in:
@@ -15,6 +15,7 @@ import logEvent from 'api/common/logEvent';
|
||||
import LaunchChatSupport from 'components/LaunchChatSupport/LaunchChatSupport';
|
||||
import { DOCS_BASE_URL } from 'constants/app';
|
||||
import ROUTES from 'constants/routes';
|
||||
import { useGetGlobalConfig } from 'hooks/globalConfig/useGetGlobalConfig';
|
||||
import useDebouncedFn from 'hooks/useDebouncedFunction';
|
||||
import history from 'lib/history';
|
||||
import { isEmpty } from 'lodash-es';
|
||||
@@ -148,6 +149,8 @@ function OnboardingAddDataSource(): JSX.Element {
|
||||
|
||||
const { org } = useAppContext();
|
||||
|
||||
const { data: globalConfig } = useGetGlobalConfig();
|
||||
|
||||
const [setupStepItems, setSetupStepItems] = useState(setupStepItemsBase);
|
||||
|
||||
const [searchQuery, setSearchQuery] = useState<string>('');
|
||||
@@ -233,6 +236,16 @@ function OnboardingAddDataSource(): JSX.Element {
|
||||
urlObj.searchParams.set('environment', selectedEnvironment);
|
||||
}
|
||||
|
||||
const ingestionUrl = globalConfig?.data?.ingestion_url;
|
||||
|
||||
if (ingestionUrl) {
|
||||
const parts = ingestionUrl.split('.');
|
||||
if (parts?.length > 1 && parts[0]?.includes('ingest')) {
|
||||
const region = parts[1];
|
||||
urlObj.searchParams.set('region', region);
|
||||
}
|
||||
}
|
||||
|
||||
// Step 3: Return the updated URL as a string
|
||||
const updatedUrl = urlObj.toString();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user