Skip to content

Commit

Permalink
[Observability] Unified Kubernetes Observability with OpenTelemetry (e…
Browse files Browse the repository at this point in the history
  • Loading branch information
thomheymann authored Oct 8, 2024
1 parent 550015b commit bb6e78e
Show file tree
Hide file tree
Showing 9 changed files with 434 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
KubernetesPage,
LandingPage,
OtelLogsPage,
OtelKubernetesPage,
SystemLogsPage,
FirehosePage,
} from './pages';
Expand Down Expand Up @@ -50,6 +51,9 @@ export function ObservabilityOnboardingFlow() {
<Route path="/kubernetes">
<KubernetesPage />
</Route>
<Route path="/otel-kubernetes">
<OtelKubernetesPage />
</Route>
<Route path="/otel-logs">
<OtelLogsPage />
</Route>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
export { AutoDetectPage } from './auto_detect';
export { CustomLogsPage } from './custom_logs';
export { KubernetesPage } from './kubernetes';
export { OtelKubernetesPage } from './otel_kubernetes';
export { LandingPage } from './landing';
export { OtelLogsPage } from './otel_logs';
export { SystemLogsPage } from './system_logs';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { i18n } from '@kbn/i18n';
import React from 'react';
import { OtelKubernetesPanel } from '../quickstart_flows/otel_kubernetes/otel_kubernetes_panel';
import { PageTemplate } from './template';
import { CustomHeader } from '../header';

export const OtelKubernetesPage = () => (
<PageTemplate
customHeader={
<CustomHeader
logo="opentelemetry"
headlineCopy={i18n.translate(
'xpack.observability_onboarding.experimentalOnboardingFlow.customHeader.otelKubernetes.text',
{
defaultMessage: 'Elastic Distribution for OTel Collector',
}
)}
captionCopy={i18n.translate(
'xpack.observability_onboarding.experimentalOnboardingFlow.customHeader.otelKubernetes.caption.description',
{
defaultMessage: 'Unified Kubernetes observability with the OpenTelemetry Operator',
}
)}
/>
}
>
<OtelKubernetesPanel />
</PageTemplate>
);
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ import { OBSERVABILITY_ONBOARDING_FLOW_PROGRESS_TELEMETRY_EVENT } from '../../..
import { ObservabilityOnboardingAppServices } from '../../..';
import { useFetcher } from '../../../hooks/use_fetcher';

export function useKubernetesFlow() {
export function useKubernetesFlow(
onboardingFlowType: 'kubernetes_otel' | 'kubernetes' = 'kubernetes'
) {
const {
services: {
analytics,
Expand All @@ -20,21 +22,27 @@ export function useKubernetesFlow() {
} = useKibana<ObservabilityOnboardingAppServices>();
const { data, status, error, refetch } = useFetcher(
(callApi) => {
return callApi('POST /internal/observability_onboarding/kubernetes/flow');
return callApi('POST /internal/observability_onboarding/kubernetes/flow', {
params: {
body: {
pkgName: onboardingFlowType,
},
},
});
},
[],
[onboardingFlowType],
{ showToastOnError: false }
);

useEffect(() => {
if (data?.onboardingId !== undefined) {
analytics?.reportEvent(OBSERVABILITY_ONBOARDING_FLOW_PROGRESS_TELEMETRY_EVENT.eventType, {
onboardingFlowType: 'kubernetes',
onboardingFlowType,
onboardingId: data?.onboardingId,
step: 'in_progress',
});
}
}, [analytics, cloudServiceProvider, data?.onboardingId]);
}, [onboardingFlowType, analytics, cloudServiceProvider, data?.onboardingId]);

return { data, status, error, refetch } as const;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

export { OtelKubernetesPanel } from './otel_kubernetes_panel';
Loading

0 comments on commit bb6e78e

Please sign in to comment.