Skip to content

Comments

[8.19] [Oblt Onboarding] Add more errors logging for Auto Detect flow (#222948)#225596

Merged
mykolaharmash merged 4 commits intoelastic:8.19from
mykolaharmash:backport/8.19/pr-222948
Jul 1, 2025
Merged

[8.19] [Oblt Onboarding] Add more errors logging for Auto Detect flow (#222948)#225596
mykolaharmash merged 4 commits intoelastic:8.19from
mykolaharmash:backport/8.19/pr-222948

Conversation

@mykolaharmash
Copy link
Contributor

Backport

This will backport the following commits from main to 8.19:

Questions ?

Please refer to the Backport tool documentation

…ic#222948)

Closes elastic#218433

This change adds more descriptive error messages inside telemetry events
in the auto detect onboarding flow. The extended error message be shown
to the user as well.

* New telemetry event for the case when user is not running the script
as `root`
* If Agent fails to download, bot the original error from `curl` and the
download URL will be logged
* If Agent fails to extract, error message from `tar` command will be
logged
* If Agent fails to install, error message from `elastic-agent install`
command will be logged
* Error response from the integrations install endpoint will be logged

Example telemetry event:
![CleanShot 2025-06-06 at 11 29
20@2x](https://github.com/user-attachments/assets/700a3d21-8d1d-43e0-b084-198da7871dec)

Example terminal output:
![CleanShot 2025-06-05 at 15 10
38@2x](https://github.com/user-attachments/assets/702e641e-ab4d-4820-8f4d-e551dde435e8)

## How to test

In order to simulate errors for all scenarios, you going to need to
modify the `auto_detect.sh` script to make it intentionally fail, like
adding extra character to the EA download URL. You can modify it
directly in the source if you're running Kibana locally, or you can
modify it after it was downloaded and before running it.

To test just one use-case without the script manipulations, you can
modify the EA download URL inside the code snippet provided by Kibana.

**Whatever way you choose, still go though the flow and make sure the
successful path works as expected.**

You can check the telemetry events emitted from the flow on [the staging
telemetry
cluster](https://telemetry-v2-staging.elastic.dev/s/observability-ux/app/discover#/?_g=(filters:!(),refreshInterval:(pause:!t,value:60000),time:(from:now-24h%2Fh,to:now))&_a=(columns:!(),dataSource:(dataViewId:b4befdd3-9a15-40c2-be4d-3ac1084d6182,type:dataView),filters:!(),interval:auto,query:(language:kuery,query:'event_type%20:%20%22observability_onboarding%22'),sort:!(!('@timestamp',desc)))),
but keep in mind that events delivered there with a delay of a couple of
hours 😢

---------

Co-authored-by: Joe Reuter <johannes.reuter@elastic.co>
(cherry picked from commit 6b452c7)

# Conflicts:
#	x-pack/test/api_integration/deployment_agnostic/apis/observability/onboarding/update_progress.ts
@mykolaharmash mykolaharmash added the backport This PR is a backport of another PR label Jun 27, 2025
@mykolaharmash mykolaharmash enabled auto-merge (squash) June 27, 2025 09:21
@mykolaharmash
Copy link
Contributor Author

/oblt-deploy

Copy link
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review only

@mykolaharmash
Copy link
Contributor Author

Tested locally just in case, works as expected.

@elasticmachine
Copy link
Contributor

elasticmachine commented Jun 30, 2025

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #16 / getNextRunAt should use the rrule with a fixed time when it is given to calculate the next runAt (same day)
  • [job] [logs] Jest Tests #16 / getNextRunAt should use the rrule with a fixed time when it is given to calculate the next runAt (same day)

Metrics [docs]

✅ unchanged

History

@mykolaharmash mykolaharmash merged commit 4b313b2 into elastic:8.19 Jul 1, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants