-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Observability Onboarding] Auto-detect flow #186106
[Observability Onboarding] Auto-detect flow #186106
Conversation
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
/ci |
/ci |
…ann/kibana into 183362-auto-detect-flow
…auto-detect-flow
/ci |
/ci |
/ci |
/ci |
…ann/kibana into 183362-auto-detect-flow
Other than that this looks pretty good to me - there are some components that can also be useful for the otel flow, but we can consolidate that after everything is merged |
…ann/kibana into 183362-auto-detect-flow
…auto-detect-flow
Ah, good catch. I think the curl command was missing some required internal request headers. I've added them in now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a note - also added that as part of #183732
title={i18n.translate( | ||
'xpack.observability_onboarding.autoDetectPanel.h3.getStartedWithNginxLabel', | ||
{ | ||
defaultMessage: 'Get started with {pkgName} logs', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we use the title of the integration instead of the technical name?
<ul> | ||
{integration.kibanaAssets | ||
.filter((asset) => asset.type === 'dashboard') | ||
.map((dashboard) => ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeh, we need a way of establishing which dashboard is the main one we want to present. Usually there's an "overview" dashboard that can be considered the best entry point so we might be able to do a naive pattern matching.
Ideally there would also be a way of determining whether a dashboard is relevant in the first place (e.g. whether it contains any data) but I'm not sure this can be easily done currently.
I think this panel needs another design iteration where we look at what information is returned from fleet for each of the supported integrations and then how we want to present that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, could you prepare that discussion for our next sync?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree we should have some logic on which dashboard should be the one we want to show and group the rest on the link to see all of them. As mentioned, usually there is an Overview. In this case we'll need to evaluate host vs system metrics overview dashboards.
<LocatorButtonEmpty<DashboardLocatorParams> | ||
locator={DASHBOARD_APP_LOCATOR} | ||
params={{ dashboardId: dashboard.id }} | ||
target="_blank" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's great opening in a new tab! However, when using it I didn't trust it because there's no indication this will happen, should we append a suitable icon to the end?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adds some visual noise as well though, so not 100% sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, buttons can only have one icon. It think it would be too confusing otherwise.
We could change the icon to an external link icon on the right hand side but then we would have to remove the current icons
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's discuss with @sileschristian once he's back - no strong opinion on it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could change the icon to an external link icon on the right hand side but then we would have to remove the current icons
This makes sense. Let's do this. Dashboard icon is not bringing that much of value. Also, we are missing a copy that we usually we had before the link that gives better context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just a few minor comments
...lity_onboarding/public/application/quickstart_flows/auto_detect/copy_to_clipboard_button.tsx
Outdated
Show resolved
Hide resolved
...on/observability_onboarding/public/application/quickstart_flows/auto_detect/empty_prompt.tsx
Outdated
Show resolved
Hide resolved
<EuiIcon type={iconType} size="l" /> | ||
</EuiFlexItem> | ||
<EuiFlexItem> | ||
<EuiTitle size="xs" css={rest.isDisabled ? { color: 'inherit' } : undefined}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: better to have isDisabled
as a de-structured prop as you use it directly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But then I would also have to manually pass it into accordion. Leaving it inside rest
means it will get spread with the rest of the props that are just pass through props from the EuiAccordion
.
...ervability_onboarding/public/application/quickstart_flows/auto_detect/progress_indicator.tsx
Outdated
Show resolved
Hide resolved
const assetsState = useAsync(async () => { | ||
if (installedIntegrations.length === 0) { | ||
return []; | ||
} | ||
const assetsMetadata = await fleet.hooks.epm.getBulkAssets({ | ||
assetIds: installedIntegrations | ||
.map((integration) => integration.kibanaAssets) | ||
.flat() as AssetSOObject[], | ||
}); | ||
return installedIntegrations.map((integration) => { | ||
return { | ||
...integration, | ||
// Enrich installed Kibana assets with metadata from Fleet API (e.g. title, description, etc.) | ||
kibanaAssets: integration.kibanaAssets.reduce<GetBulkAssetsResponse['items']>( | ||
(acc, asset) => { | ||
const assetWithMetadata = assetsMetadata.data?.items.find(({ id }) => id === asset.id); | ||
if (assetWithMetadata) { | ||
acc.push(assetWithMetadata); | ||
} | ||
return acc; | ||
}, | ||
[] | ||
), | ||
}; | ||
}); | ||
}, [installedIntegrations.length]); // eslint-disable-line react-hooks/exhaustive-deps |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a personal preference, no need for changes, but I'd keep metadata as a separate structure and let each installed integration look up stuff there while rendering.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The drawback of that approach would be that you'd be making multiple unecessary HTTP requests for each integration separately to load that metadata in. Happy to refactor at a later stage if this causes issues but gonna keep as is for now
I guess you planned to do this anyway, but happy to merge it in in a hidden way so testing becomes easier and then do the polishing in a follow-up PR. |
I have already removed the auto detection card so the flow is only accessible via the hidden URL |
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Module Count
Async chunks
Unknown metric groupsESLint disabled line counts
References to deprecated APIs
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
Depends on: elastic/elastic-agent#4754 Depends on: #186106 Closes: #182407 ## Summary Adds a Kubernetes onboarding quick start flow using `kubectl kustomize` command. ![CleanShot 2024-06-18 at 15 10 27@2x](https://github.com/elastic/kibana/assets/793851/522d2481-6a0e-43d3-b9ef-d09ee9953b3c) ## How to test 1. Run Kibana and ES locally (make sure to expose ES on 0.0.0.0 so elastic agent can reach it from within a container, I use this command `yarn es snapshot --license trial -E xpack.security.authc.api_key.enabled=true -E http.host=0.0.0.0`) 2. Setup a test cluster with [minikube](https://minikube.sigs.k8s.io/docs/start/?arch=%2Fmacos%2Fx86-64%2Fstable%2Fbinary+download) 3. Open Kibana and navigate to the Onboarding screen 4. Make sure Kubernetes quick start card is visible under the infrastructure category and click on it 5. Copy the command snippet 6. Paste the command into a terminal, but don't run it yet 7. Replace `localhost` in the command with you local IP `ipconfig getifaddr en0` 8. In case elastic/elastic-agent#4754 was not merged yet, you'd need to also clone the elastic-agent repo and replace the template URL with a local path to the `elastic-agent-kustomize/default/elastic-agent-standalone` folder. 9. Run the command and make sure all resources were created 10. Go back to Kibana, after ~1 minute UI should identify that the data was ingested 11. Click on the cluster overview link and make sure it works --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Depends on: elastic/elastic-agent#4754 Depends on: elastic#186106 Closes: elastic#182407 ## Summary Adds a Kubernetes onboarding quick start flow using `kubectl kustomize` command. ![CleanShot 2024-06-18 at 15 10 27@2x](https://github.com/elastic/kibana/assets/793851/522d2481-6a0e-43d3-b9ef-d09ee9953b3c) ## How to test 1. Run Kibana and ES locally (make sure to expose ES on 0.0.0.0 so elastic agent can reach it from within a container, I use this command `yarn es snapshot --license trial -E xpack.security.authc.api_key.enabled=true -E http.host=0.0.0.0`) 2. Setup a test cluster with [minikube](https://minikube.sigs.k8s.io/docs/start/?arch=%2Fmacos%2Fx86-64%2Fstable%2Fbinary+download) 3. Open Kibana and navigate to the Onboarding screen 4. Make sure Kubernetes quick start card is visible under the infrastructure category and click on it 5. Copy the command snippet 6. Paste the command into a terminal, but don't run it yet 7. Replace `localhost` in the command with you local IP `ipconfig getifaddr en0` 8. In case elastic/elastic-agent#4754 was not merged yet, you'd need to also clone the elastic-agent repo and replace the template URL with a local path to the `elastic-agent-kustomize/default/elastic-agent-standalone` folder. 9. Run the command and make sure all resources were created 10. Go back to Kibana, after ~1 minute UI should identify that the data was ingested 11. Click on the cluster overview link and make sure it works --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> (cherry picked from commit 141e619)
Depends on: elastic/elastic-agent#4754 Depends on: elastic#186106 Closes: elastic#182407 ## Summary Adds a Kubernetes onboarding quick start flow using `kubectl kustomize` command. ![CleanShot 2024-06-18 at 15 10 27@2x](https://github.com/elastic/kibana/assets/793851/522d2481-6a0e-43d3-b9ef-d09ee9953b3c) ## How to test 1. Run Kibana and ES locally (make sure to expose ES on 0.0.0.0 so elastic agent can reach it from within a container, I use this command `yarn es snapshot --license trial -E xpack.security.authc.api_key.enabled=true -E http.host=0.0.0.0`) 2. Setup a test cluster with [minikube](https://minikube.sigs.k8s.io/docs/start/?arch=%2Fmacos%2Fx86-64%2Fstable%2Fbinary+download) 3. Open Kibana and navigate to the Onboarding screen 4. Make sure Kubernetes quick start card is visible under the infrastructure category and click on it 5. Copy the command snippet 6. Paste the command into a terminal, but don't run it yet 7. Replace `localhost` in the command with you local IP `ipconfig getifaddr en0` 8. In case elastic/elastic-agent#4754 was not merged yet, you'd need to also clone the elastic-agent repo and replace the template URL with a local path to the `elastic-agent-kustomize/default/elastic-agent-standalone` folder. 9. Run the command and make sure all resources were created 10. Go back to Kibana, after ~1 minute UI should identify that the data was ingested 11. Click on the cluster overview link and make sure it works --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Hi @gbamparop We have revalidated this script on 8.15.0 BC2 kibana cloud environment available by adding Build details:
Platforms:
Observations:
Elastic - Google Chrome 2024-07-17 11-56-30.zip Please let us know if we are missing anything here. Thanks!! |
Thanks for testing @amolnater-qasource ! The windows case is expected for now - could you test with apache, nginx and docker being installed on mac and linux as well to make sure the detection and data collection works as expected for these as well? |
Hi @flash1293 Thank you for the update. We have installed apache, nginx and docker on the linux and mac. Please find below detailed observations. Observations: Linux:
Screen Recording: Elastic.-.Google.Chrome.2024-07-17.15-54-27.mp4MAC:
Please let us know if we are missing anything here. Thanks!! |
Thanks for checking @amolnater-qasource - I think the detection we built for nginx, apache and docker doesn't work for the way these are installed on mac, I will check back with the team. |
@flash1293 The paths we use in the script are based on the ones provided by EPM. For docker that is: - id: filestream-docker
type: filestream
streams:
- id: 'docker-container-logs-${docker.container.name}-${docker.container.id}'
data_stream:
dataset: docker.container_logs
type: logs
elasticsearch:
dynamic_dataset: true
dynamic_namespace: true
paths:
- '/var/lib/docker/containers/${docker.container.id}/*-json.log'
parsers:
- container:
stream: all
format: docker It looks like Docker desktop on macOS does not use the same paths. |
Right, the claim right above is the main concern - it's just something the integration can't do today.
In general, in docker desktop the log files aren't even in the file system of the host by default, so it's not easily possible to collect them in the first place. In theory it's possible to get the logs via the |
Resolves #183362
Summary
Implements auto-detect based onboarding flow.
The new flow can only be accessed behind a hidden URL:
/app/observabilityOnboarding/auto-detect?category=logs
Screenshots
Kibana
Terminal