Skip to content

Comments

[Oblt Onboarding] Add more errors logging for Auto Detect flow#222948

Merged
mykolaharmash merged 12 commits intoelastic:mainfrom
mykolaharmash:218433-oblt-onboarding-add-more-logging-for-errors-during-auto-detect-flow
Jun 26, 2025
Merged

[Oblt Onboarding] Add more errors logging for Auto Detect flow#222948
mykolaharmash merged 12 commits intoelastic:mainfrom
mykolaharmash:218433-oblt-onboarding-add-more-logging-for-errors-during-auto-detect-flow

Conversation

@mykolaharmash
Copy link
Contributor

@mykolaharmash mykolaharmash commented Jun 6, 2025

Closes #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

Example terminal output:
CleanShot 2025-06-05 at 15 10 38@2x

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, but keep in mind that events delivered there with a delay of a couple of hours 😢

@mykolaharmash mykolaharmash requested a review from a team as a code owner June 6, 2025 09:32
@mykolaharmash mykolaharmash added backport:version Backport to applied version labels v8.19.0 v9.0.3 release_note:skip Skip the PR/issue when compiling release notes labels Jun 6, 2025
@mykolaharmash
Copy link
Contributor Author

/oblt-deploy

printf "\e[32;1m✓\e[0m %s\n" "Elastic Agent downloaded to $(pwd)/$elastic_agent_artifact_name.tar.gz"
update_step_progress "ea-download" "complete"
else
update_step_progress "ea-download" "danger" "Failed to download Elastic Agent, see script output for error."
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've removed see script output for error from everywhere as we don't show these messages to the user anymore, this was a leftover from the legacy onboarding.

@mykolaharmash
Copy link
Contributor Author

/oblt-deploy

@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.

Sorry it took a while to get to this.

Tested this locally and it mostly works, only issue I noticed is if the captured error is multi-line it breaks the JSON of the request body for tracking, so it never arrives. Would be great if we could fix that.

else
update_step_progress "ea-extract" "danger" "Failed to extract Elastic Agent, see script output for error."
fail "Failed to extract Elastic Agent"
update_step_progress "ea-extract" "danger" "Failed to extract Elastic Agent.\nTar Error: $agent_extract_result"
Copy link
Contributor

Choose a reason for hiding this comment

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

I tried that and it didn't report successfully, I think because a multiline output broke the JSON payload:

0000: {"status":"danger", "message":"Failed to extract Elastic Agent.\
0040: nTar Error: tar: Option --myabc is not supported.Usage:.  List:
0080:    tar -tf <archive-filename>.  Extract: tar -xf <archive-filena
00c0: me>.  Create:  tar -cf <archive-filename> [filenames...].  Help:
0100:     tar --help"}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, thank you for catching this! I've added escaping for newline and backslashes to the MESSAGE.

@mykolaharmash mykolaharmash requested a review from flash1293 June 19, 2025 13:14
@flash1293
Copy link
Contributor

Tested this on macos and it doesn't seem to fully work:

sed: 2: "s/\n/\\n/g
": unused label 'a;N;$!ba'
sed: 2: "s/\n/\\n/g
": unused label 'a;N;$!ba'
curl: (22) The requested URL returned error: 400

There are a bunch of errors related to sed and I still get the 400 error.

This is how I test:

  • Download the auto_detect.sh script
  • Change the extract command to
  agent_extract_result=$(tar --non-existing-flag -xzf "${elastic_agent_artifact_name}.tar.gz" 2>&1)
  • Run the auto_detect script

@mykolaharmash
Copy link
Contributor Author

Tested this on macos and it doesn't seem to fully work:

sed: 2: "s/\n/\\n/g
": unused label 'a;N;$!ba'
sed: 2: "s/\n/\\n/g
": unused label 'a;N;$!ba'
curl: (22) The requested URL returned error: 400

There are a bunch of errors related to sed and I still get the 400 error.

This is how I test:

  • Download the auto_detect.sh script
  • Change the extract command to
  agent_extract_result=$(tar --non-existing-flag -xzf "${elastic_agent_artifact_name}.tar.gz" 2>&1)
  • Run the auto_detect script

😢 I only tested on linux, makes sense... will be back with the fix

@mykolaharmash
Copy link
Contributor Author

@flash1293 I abandoned the idea of trying to escape the error messages and replaced it with base64 encoding. This should be more robust approach. Please give it another try, I've tested on mac and linux and everything seems to work fine.

@flash1293
Copy link
Contributor

/oblt-deploy

@flash1293
Copy link
Contributor

Couldn't break it anymore locally, but I would like to do a proper e2e test from a serverless instance first and also it seems like we need t fix some unit tests anyway.

Even if FF has already passed I think we should backport this because this kind of telemetry is very important.

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.

Tested and seems to work fine, LGTM.

Just to make sure, is POST /internal/observability_onboarding/flow/{id}/step/{name} called from somewhere else? I didn't find anything but maybe I missed it.

@mykolaharmash
Copy link
Contributor Author

Tested and seems to work fine, LGTM.

Just to make sure, is POST /internal/observability_onboarding/flow/{id}/step/{name} called from somewhere else? I didn't find anything but maybe I missed it.

it was used on the FE before but now it's only called from the bash script

@mykolaharmash mykolaharmash enabled auto-merge (squash) June 26, 2025 13:12
@mykolaharmash mykolaharmash merged commit 6b452c7 into elastic:main Jun 26, 2025
13 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19, 9.0

https://github.com/elastic/kibana/actions/runs/15903200246

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

✅ unchanged

History

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jun 26, 2025
…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)
@kibanamachine
Copy link
Contributor

💔 Some backports could not be created

Status Branch Result
8.19 Backport failed because of merge conflicts

You might need to backport the following PRs to 8.19:
- [Embeddable Rebuild] Fix panel title sync with saved object when using defaultTitle (#225237)
- Remaining work attributes table (#224723)
- [Security Solution] Adds ability to revert prebuilt rules to their base version (#223301)
- Remapping iInCircle and questionInCircle and deprecating help icon (#223142)
- [Lens] Add internal CRUD api routes (#223296)
- [Query Rules] Query rules telemetry (#225146)
- [ska] relocate x-pack/test/cases_api_integration (#225056)
- [Discover][Oblt] Enable Attributes tab by default (#224894)
- [follow up] small ui refactoring (#225234)
9.0

Note: Successful backport PRs will be merged automatically after passing CI.

Manual backport

To create the backport manually run:

node scripts/backport --pr 222948

Questions ?

Please refer to the Backport tool documentation

meghanmurphy1 pushed a commit to meghanmurphy1/kibana that referenced this pull request Jun 26, 2025
…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>
kibanamachine added a commit that referenced this pull request Jun 26, 2025
…222948) (#225454)

# Backport

This will backport the following commits from `main` to `9.0`:
- [[Oblt Onboarding] Add more errors logging for Auto Detect flow
(#222948)](#222948)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Mykola
Harmash","email":"mykola.harmash@gmail.com"},"sourceCommit":{"committedDate":"2025-06-26T13:28:54Z","message":"[Oblt
Onboarding] Add more errors logging for Auto Detect flow
(#222948)\n\nCloses
https://github.com/elastic/kibana/issues/218433\n\nThis change adds more
descriptive error messages inside telemetry events\nin the auto detect
onboarding flow. The extended error message be shown\nto the user as
well.\n\n* New telemetry event for the case when user is not running the
script\nas `root`\n* If Agent fails to download, bot the original error
from `curl` and the\ndownload URL will be logged\n* If Agent fails to
extract, error message from `tar` command will be\nlogged\n* If Agent
fails to install, error message from `elastic-agent install`\ncommand
will be logged\n* Error response from the integrations install endpoint
will be logged\n\nExample telemetry event:\n![CleanShot 2025-06-06 at 11
29\n20@2x](https://github.com/user-attachments/assets/700a3d21-8d1d-43e0-b084-198da7871dec)\n\nExample
terminal output:\n![CleanShot 2025-06-05 at 15
10\n38@2x](https://github.com/user-attachments/assets/702e641e-ab4d-4820-8f4d-e551dde435e8)\n\n\n##
How to test\n\nIn order to simulate errors for all scenarios, you going
to need to\nmodify the `auto_detect.sh` script to make it intentionally
fail, like\nadding extra character to the EA download URL. You can
modify it\ndirectly in the source if you're running Kibana locally, or
you can\nmodify it after it was downloaded and before running it.\n\nTo
test just one use-case without the script manipulations, you can\nmodify
the EA download URL inside the code snippet provided by
Kibana.\n\n**Whatever way you choose, still go though the flow and make
sure the\nsuccessful path works as expected.**\n\nYou can check the
telemetry events emitted from the flow on [the
staging\ntelemetry\ncluster](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)))),\nbut
keep in mind that events delivered there with a delay of a couple
of\nhours 😢\n\n---------\n\nCo-authored-by: Joe Reuter
<johannes.reuter@elastic.co>","sha":"6b452c79ae2947e91c613dbc1417cc60f1aba157","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:prev-minor","backport:version","v9.1.0","v8.19.0"],"title":"[Oblt
Onboarding] Add more errors logging for Auto Detect
flow","number":222948,"url":"https://github.com/elastic/kibana/pull/222948","mergeCommit":{"message":"[Oblt
Onboarding] Add more errors logging for Auto Detect flow
(#222948)\n\nCloses
https://github.com/elastic/kibana/issues/218433\n\nThis change adds more
descriptive error messages inside telemetry events\nin the auto detect
onboarding flow. The extended error message be shown\nto the user as
well.\n\n* New telemetry event for the case when user is not running the
script\nas `root`\n* If Agent fails to download, bot the original error
from `curl` and the\ndownload URL will be logged\n* If Agent fails to
extract, error message from `tar` command will be\nlogged\n* If Agent
fails to install, error message from `elastic-agent install`\ncommand
will be logged\n* Error response from the integrations install endpoint
will be logged\n\nExample telemetry event:\n![CleanShot 2025-06-06 at 11
29\n20@2x](https://github.com/user-attachments/assets/700a3d21-8d1d-43e0-b084-198da7871dec)\n\nExample
terminal output:\n![CleanShot 2025-06-05 at 15
10\n38@2x](https://github.com/user-attachments/assets/702e641e-ab4d-4820-8f4d-e551dde435e8)\n\n\n##
How to test\n\nIn order to simulate errors for all scenarios, you going
to need to\nmodify the `auto_detect.sh` script to make it intentionally
fail, like\nadding extra character to the EA download URL. You can
modify it\ndirectly in the source if you're running Kibana locally, or
you can\nmodify it after it was downloaded and before running it.\n\nTo
test just one use-case without the script manipulations, you can\nmodify
the EA download URL inside the code snippet provided by
Kibana.\n\n**Whatever way you choose, still go though the flow and make
sure the\nsuccessful path works as expected.**\n\nYou can check the
telemetry events emitted from the flow on [the
staging\ntelemetry\ncluster](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)))),\nbut
keep in mind that events delivered there with a delay of a couple
of\nhours 😢\n\n---------\n\nCo-authored-by: Joe Reuter
<johannes.reuter@elastic.co>","sha":"6b452c79ae2947e91c613dbc1417cc60f1aba157"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/222948","number":222948,"mergeCommit":{"message":"[Oblt
Onboarding] Add more errors logging for Auto Detect flow
(#222948)\n\nCloses
https://github.com/elastic/kibana/issues/218433\n\nThis change adds more
descriptive error messages inside telemetry events\nin the auto detect
onboarding flow. The extended error message be shown\nto the user as
well.\n\n* New telemetry event for the case when user is not running the
script\nas `root`\n* If Agent fails to download, bot the original error
from `curl` and the\ndownload URL will be logged\n* If Agent fails to
extract, error message from `tar` command will be\nlogged\n* If Agent
fails to install, error message from `elastic-agent install`\ncommand
will be logged\n* Error response from the integrations install endpoint
will be logged\n\nExample telemetry event:\n![CleanShot 2025-06-06 at 11
29\n20@2x](https://github.com/user-attachments/assets/700a3d21-8d1d-43e0-b084-198da7871dec)\n\nExample
terminal output:\n![CleanShot 2025-06-05 at 15
10\n38@2x](https://github.com/user-attachments/assets/702e641e-ab4d-4820-8f4d-e551dde435e8)\n\n\n##
How to test\n\nIn order to simulate errors for all scenarios, you going
to need to\nmodify the `auto_detect.sh` script to make it intentionally
fail, like\nadding extra character to the EA download URL. You can
modify it\ndirectly in the source if you're running Kibana locally, or
you can\nmodify it after it was downloaded and before running it.\n\nTo
test just one use-case without the script manipulations, you can\nmodify
the EA download URL inside the code snippet provided by
Kibana.\n\n**Whatever way you choose, still go though the flow and make
sure the\nsuccessful path works as expected.**\n\nYou can check the
telemetry events emitted from the flow on [the
staging\ntelemetry\ncluster](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)))),\nbut
keep in mind that events delivered there with a delay of a couple
of\nhours 😢\n\n---------\n\nCo-authored-by: Joe Reuter
<johannes.reuter@elastic.co>","sha":"6b452c79ae2947e91c613dbc1417cc60f1aba157"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Mykola Harmash <mykola.harmash@gmail.com>
Co-authored-by: Joe Reuter <johannes.reuter@elastic.co>
@mykolaharmash
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.19

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

mykolaharmash added a commit to mykolaharmash/kibana that referenced this pull request Jun 27, 2025
…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
@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Jun 30, 2025
@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.
cc: @mykolaharmash

mykolaharmash added a commit that referenced this pull request Jul 1, 2025
…#222948) (#225596)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[Oblt Onboarding] Add more errors logging for Auto Detect flow
(#222948)](#222948)

<!--- Backport version: 10.0.1 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Mykola
Harmash","email":"mykola.harmash@gmail.com"},"sourceCommit":{"committedDate":"2025-06-26T13:28:54Z","message":"[Oblt
Onboarding] Add more errors logging for Auto Detect flow
(#222948)\n\nCloses
https://github.com/elastic/kibana/issues/218433\n\nThis change adds more
descriptive error messages inside telemetry events\nin the auto detect
onboarding flow. The extended error message be shown\nto the user as
well.\n\n* New telemetry event for the case when user is not running the
script\nas `root`\n* If Agent fails to download, bot the original error
from `curl` and the\ndownload URL will be logged\n* If Agent fails to
extract, error message from `tar` command will be\nlogged\n* If Agent
fails to install, error message from `elastic-agent install`\ncommand
will be logged\n* Error response from the integrations install endpoint
will be logged\n\nExample telemetry event:\n![CleanShot 2025-06-06 at 11
29\n20@2x](https://github.com/user-attachments/assets/700a3d21-8d1d-43e0-b084-198da7871dec)\n\nExample
terminal output:\n![CleanShot 2025-06-05 at 15
10\n38@2x](https://github.com/user-attachments/assets/702e641e-ab4d-4820-8f4d-e551dde435e8)\n\n\n##
How to test\n\nIn order to simulate errors for all scenarios, you going
to need to\nmodify the `auto_detect.sh` script to make it intentionally
fail, like\nadding extra character to the EA download URL. You can
modify it\ndirectly in the source if you're running Kibana locally, or
you can\nmodify it after it was downloaded and before running it.\n\nTo
test just one use-case without the script manipulations, you can\nmodify
the EA download URL inside the code snippet provided by
Kibana.\n\n**Whatever way you choose, still go though the flow and make
sure the\nsuccessful path works as expected.**\n\nYou can check the
telemetry events emitted from the flow on [the
staging\ntelemetry\ncluster](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)))),\nbut
keep in mind that events delivered there with a delay of a couple
of\nhours 😢\n\n---------\n\nCo-authored-by: Joe Reuter
<johannes.reuter@elastic.co>","sha":"6b452c79ae2947e91c613dbc1417cc60f1aba157","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:prev-minor","backport:version","v9.1.0","v8.19.0","v9.0.4"],"title":"[Oblt
Onboarding] Add more errors logging for Auto Detect
flow","number":222948,"url":"https://github.com/elastic/kibana/pull/222948","mergeCommit":{"message":"[Oblt
Onboarding] Add more errors logging for Auto Detect flow
(#222948)\n\nCloses
https://github.com/elastic/kibana/issues/218433\n\nThis change adds more
descriptive error messages inside telemetry events\nin the auto detect
onboarding flow. The extended error message be shown\nto the user as
well.\n\n* New telemetry event for the case when user is not running the
script\nas `root`\n* If Agent fails to download, bot the original error
from `curl` and the\ndownload URL will be logged\n* If Agent fails to
extract, error message from `tar` command will be\nlogged\n* If Agent
fails to install, error message from `elastic-agent install`\ncommand
will be logged\n* Error response from the integrations install endpoint
will be logged\n\nExample telemetry event:\n![CleanShot 2025-06-06 at 11
29\n20@2x](https://github.com/user-attachments/assets/700a3d21-8d1d-43e0-b084-198da7871dec)\n\nExample
terminal output:\n![CleanShot 2025-06-05 at 15
10\n38@2x](https://github.com/user-attachments/assets/702e641e-ab4d-4820-8f4d-e551dde435e8)\n\n\n##
How to test\n\nIn order to simulate errors for all scenarios, you going
to need to\nmodify the `auto_detect.sh` script to make it intentionally
fail, like\nadding extra character to the EA download URL. You can
modify it\ndirectly in the source if you're running Kibana locally, or
you can\nmodify it after it was downloaded and before running it.\n\nTo
test just one use-case without the script manipulations, you can\nmodify
the EA download URL inside the code snippet provided by
Kibana.\n\n**Whatever way you choose, still go though the flow and make
sure the\nsuccessful path works as expected.**\n\nYou can check the
telemetry events emitted from the flow on [the
staging\ntelemetry\ncluster](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)))),\nbut
keep in mind that events delivered there with a delay of a couple
of\nhours 😢\n\n---------\n\nCo-authored-by: Joe Reuter
<johannes.reuter@elastic.co>","sha":"6b452c79ae2947e91c613dbc1417cc60f1aba157"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/222948","number":222948,"mergeCommit":{"message":"[Oblt
Onboarding] Add more errors logging for Auto Detect flow
(#222948)\n\nCloses
https://github.com/elastic/kibana/issues/218433\n\nThis change adds more
descriptive error messages inside telemetry events\nin the auto detect
onboarding flow. The extended error message be shown\nto the user as
well.\n\n* New telemetry event for the case when user is not running the
script\nas `root`\n* If Agent fails to download, bot the original error
from `curl` and the\ndownload URL will be logged\n* If Agent fails to
extract, error message from `tar` command will be\nlogged\n* If Agent
fails to install, error message from `elastic-agent install`\ncommand
will be logged\n* Error response from the integrations install endpoint
will be logged\n\nExample telemetry event:\n![CleanShot 2025-06-06 at 11
29\n20@2x](https://github.com/user-attachments/assets/700a3d21-8d1d-43e0-b084-198da7871dec)\n\nExample
terminal output:\n![CleanShot 2025-06-05 at 15
10\n38@2x](https://github.com/user-attachments/assets/702e641e-ab4d-4820-8f4d-e551dde435e8)\n\n\n##
How to test\n\nIn order to simulate errors for all scenarios, you going
to need to\nmodify the `auto_detect.sh` script to make it intentionally
fail, like\nadding extra character to the EA download URL. You can
modify it\ndirectly in the source if you're running Kibana locally, or
you can\nmodify it after it was downloaded and before running it.\n\nTo
test just one use-case without the script manipulations, you can\nmodify
the EA download URL inside the code snippet provided by
Kibana.\n\n**Whatever way you choose, still go though the flow and make
sure the\nsuccessful path works as expected.**\n\nYou can check the
telemetry events emitted from the flow on [the
staging\ntelemetry\ncluster](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)))),\nbut
keep in mind that events delivered there with a delay of a couple
of\nhours 😢\n\n---------\n\nCo-authored-by: Joe Reuter
<johannes.reuter@elastic.co>","sha":"6b452c79ae2947e91c613dbc1417cc60f1aba157"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/225454","number":225454,"state":"MERGED","mergeCommit":{"sha":"f8b8abee68cf1d30bc5e3210b3fe5047b614ebb2","message":"[9.0]
[Oblt Onboarding] Add more errors logging for Auto Detect flow (#222948)
(#225454)\n\n# Backport\n\nThis will backport the following commits from
`main` to `9.0`:\n- [[Oblt Onboarding] Add more errors logging for Auto
Detect
flow\n(#222948)](https://github.com/elastic/kibana/pull/222948)\n\n\n\n###
Questions ?\nPlease refer to the [Backport
tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n\n\nCo-authored-by:
Mykola Harmash <mykola.harmash@gmail.com>\nCo-authored-by: Joe Reuter
<johannes.reuter@elastic.co>"}}]}] BACKPORT-->
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Jul 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels release_note:skip Skip the PR/issue when compiling release notes v8.19.0 v9.0.4 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Oblt Onboarding] Add more logging for errors during auto-detect flow

4 participants