diff --git a/x-pack/plugins/observability_solution/observability_onboarding/public/application/quickstart_flows/otel_logs/index.tsx b/x-pack/plugins/observability_solution/observability_onboarding/public/application/quickstart_flows/otel_logs/index.tsx index bb3b76556a617..4d0de71d6faaf 100644 --- a/x-pack/plugins/observability_solution/observability_onboarding/public/application/quickstart_flows/otel_logs/index.tsx +++ b/x-pack/plugins/observability_solution/observability_onboarding/public/application/quickstart_flows/otel_logs/index.tsx @@ -30,9 +30,9 @@ import { useKibana } from '@kbn/kibana-react-plugin/public'; import useAsyncFn from 'react-use/lib/useAsyncFn'; import { FormattedMessage } from '@kbn/i18n-react'; import { ObservabilityOnboardingAppServices } from '../../..'; -import { ApiKeyBanner } from '../custom_logs/api_key_banner'; import { useFetcher } from '../../../hooks/use_fetcher'; import { MultiIntegrationInstallBanner } from './multi_integration_install_banner'; +import { EmptyPrompt } from '../shared/empty_prompt'; import { FeedbackButtons } from '../shared/feedback_buttons'; const HOST_COMMAND = i18n.translate( @@ -46,11 +46,15 @@ const HOST_COMMAND = i18n.translate( export const OtelLogsPanel: React.FC = () => { const { data: apiKeyData, - status: apiKeyStatus, error, - } = useFetcher((callApi) => { - return callApi('POST /internal/observability_onboarding/otel/api_key', {}); - }, []); + refetch, + } = useFetcher( + (callApi) => { + return callApi('POST /internal/observability_onboarding/otel/api_key', {}); + }, + [], + { showToastOnError: false } + ); const { data: setup } = useFetcher((callApi) => { return callApi('GET /internal/observability_onboarding/logs/setup/environment'); @@ -116,15 +120,14 @@ rm ./otel.yml && cp ./otel_samples/platformlogs_hostmetrics.yml ./otel.yml && mk const selectedContent = installTabContents.find((tab) => tab.id === selectedTab)!; + if (error) { + return ; + } + return ( - {error && ( - - - - )}