Skip to content
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

[Onboarding] Additional auto-detect flow telemetry #207726

Merged

Conversation

mykolaharmash
Copy link
Contributor

@mykolaharmash mykolaharmash commented Jan 22, 2025

Closes https://github.com/elastic/observability-dev/issues/4236 🔒

This change:

  • Moves flow progress update telemetry events to the backend (this will prevent situations when multiple progress updates happened in a short time interval, but frontend could only see the latest update because it checks for progress once in a few seconds which might not be enough in some situations)
  • Leaves the data_ingested final event on the FE because it's not explicitly triggered on the BE
  • Deletes a separate event type for auto detect flow in favor of the generic even used by other flows
  • Adds progress updates to the auto-detect script when when it's being run on unsupported OS or lsof binary is not present
  • Adds logging of the OS and architecture used by the host

Events coming from your local Kibana can viewed on the 🔒 Staging Telemetry cluster. Though keep in mind, there is a ~1 hour delay for events indexing 😔

Example event:
CleanShot 2025-01-22 at 12 26 14@2x

@mykolaharmash mykolaharmash requested a review from a team as a code owner January 22, 2025 10:53
@mykolaharmash mykolaharmash added release_note:skip Skip the PR/issue when compiling release notes backport:prev-minor Backport to (9.0) the previous minor version (i.e. one version back from main) labels Jan 22, 2025
@mykolaharmash mykolaharmash force-pushed the improve-auto-detect-telemetry branch 5 times, most recently from 6be0e21 to 8023da9 Compare January 22, 2025 14:51
@@ -53,10 +52,6 @@ export function ObservabilityOnboardingAppRoot({
context,
};

core.analytics.reportEvent(OBSERVABILITY_ONBOARDING_TELEMETRY_EVENT.eventType, {
uses_legacy_onboarding_page: false,
});
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Deleting this one as legacy onboarding page is not a thing anymore. Also deleted uses_legacy_onboarding_page property from the even schema.

@mykolaharmash mykolaharmash added the ci:project-deploy-observability Create an Observability project label Jan 22, 2025
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

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.

I tested this for the full flow and it seems to work fine for the happy path (except for the "initialized" message, see below).

However it logs

auto_detect.sh: line 16: update_step_progress: command not found

And when provoking a failure e.g. in the os/arch check, it just raises the same error again.

I got it to work by moving the update_step_progress definition further up, but then it fails with another error because the error message contains doublequotes which mess up the JSON of the payload.

So I think we need to do two things:

  • Make sure the update_progress function is defined early enough
  • Make sure the JSON payload is constructed correctly even for the error case (no doublequotes)

@mykolaharmash mykolaharmash force-pushed the improve-auto-detect-telemetry branch 2 times, most recently from 3b27e41 to b560550 Compare January 27, 2025 09:31
@mykolaharmash
Copy link
Contributor Author

Thank you @flash1293! The initialize event was a last minute addition and I did not re-test after adding it, sorry about this. As you've suggested, I moved the function definition up and removed the quotes from the error message.

@mykolaharmash mykolaharmash force-pushed the improve-auto-detect-telemetry branch from b560550 to 902446b Compare January 27, 2025 09:43
@elasticmachine
Copy link
Contributor

elasticmachine commented Jan 27, 2025

💛 Build succeeded, but was flaky

  • Buildkite Build
  • Commit: 902446b
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-207726-902446b1075c

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #20 / Case View Page similar cases tab should render the similar cases table

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
observabilityOnboarding 232 230 -2

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
observabilityOnboarding 269.7KB 269.2KB -521.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
observabilityOnboarding 10.2KB 10.3KB +127.0B

History

@mykolaharmash mykolaharmash enabled auto-merge (squash) January 27, 2025 15:58
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 works fine.

However I'm still getting this misplaced warning in the script output:
Screenshot 2025-01-27 at 17 18 40

@mykolaharmash mykolaharmash merged commit ef96cd5 into elastic:main Jan 27, 2025
8 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

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

@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.x Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 207726

Questions ?

Please refer to the Backport tool documentation

@mykolaharmash
Copy link
Contributor Author

Tested and works fine.

However I'm still getting this misplaced warning in the script output: Screenshot 2025-01-27 at 17 18 40

Seems like it was still the previous commit, it says line 16 but there is no function call on that line anymore

@mykolaharmash
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.x

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 Jan 28, 2025
Closes elastic/observability-dev#4236 🔒

This change:
* Moves flow progress update telemetry events to the backend (this will
prevent situations when multiple progress updates happened in a short
time interval, but frontend could only see the latest update because it
checks for progress once in a few seconds which might not be enough in
some situations)
* Leaves the data_ingested final event on the FE because it's not
explicitly triggered on the BE
* Deletes a separate event type for auto detect flow in favor of the
generic even used by other flows
* Adds progress updates to the auto-detect script when when it's being
run on unsupported OS or lsof binary is not present
* Adds logging of the OS and architecture used by the host

Events coming from your local Kibana can viewed on the [🔒 Staging
Telemetry cluster](https://telemetry-v2-staging.elastic.dev). Though
keep in mind, there is a ~1 hour delay for events indexing 😔

Example event:
![CleanShot 2025-01-22 at 12 26
14@2x](https://github.com/user-attachments/assets/077e4f15-5283-4198-a543-30f2507fa0f5)

(cherry picked from commit ef96cd5)

# Conflicts:
#	x-pack/solutions/observability/plugins/observability_onboarding/public/application/quickstart_flows/custom_logs/install_elastic_agent.tsx
mykolaharmash added a commit that referenced this pull request Jan 28, 2025
…208489)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Onboarding] Additional auto-detect flow telemetry
(#207726)](#207726)

<!--- Backport version: 9.6.4 -->

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

<!--BACKPORT [{"author":{"name":"Mykola
Harmash","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-01-27T16:19:01Z","message":"[Onboarding]
Additional auto-detect flow telemetry (#207726)\n\nCloses
elastic/observability-dev#4236 🔒\r\n\r\nThis
change:\r\n* Moves flow progress update telemetry events to the backend
(this will\r\nprevent situations when multiple progress updates happened
in a short\r\ntime interval, but frontend could only see the latest
update because it\r\nchecks for progress once in a few seconds which
might not be enough in\r\nsome situations)\r\n* Leaves the data_ingested
final event on the FE because it's not\r\nexplicitly triggered on the
BE\r\n* Deletes a separate event type for auto detect flow in favor of
the\r\ngeneric even used by other flows\r\n* Adds progress updates to
the auto-detect script when when it's being\r\nrun on unsupported OS or
lsof binary is not present\r\n* Adds logging of the OS and architecture
used by the host\r\n\r\nEvents coming from your local Kibana can viewed
on the [🔒 Staging\r\nTelemetry
cluster](https://telemetry-v2-staging.elastic.dev). Though\r\nkeep in
mind, there is a ~1 hour delay for events indexing 😔\r\n\r\nExample
event:\r\n![CleanShot 2025-01-22 at 12
26\r\n14@2x](https://github.com/user-attachments/assets/077e4f15-5283-4198-a543-30f2507fa0f5)","sha":"ef96cd5d0b9cba3f03a00ff8b6e1e93840119570","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor","ci:project-deploy-observability"],"title":"[Onboarding]
Additional auto-detect flow
telemetry","number":207726,"url":"https://github.com/elastic/kibana/pull/207726","mergeCommit":{"message":"[Onboarding]
Additional auto-detect flow telemetry (#207726)\n\nCloses
elastic/observability-dev#4236 🔒\r\n\r\nThis
change:\r\n* Moves flow progress update telemetry events to the backend
(this will\r\nprevent situations when multiple progress updates happened
in a short\r\ntime interval, but frontend could only see the latest
update because it\r\nchecks for progress once in a few seconds which
might not be enough in\r\nsome situations)\r\n* Leaves the data_ingested
final event on the FE because it's not\r\nexplicitly triggered on the
BE\r\n* Deletes a separate event type for auto detect flow in favor of
the\r\ngeneric even used by other flows\r\n* Adds progress updates to
the auto-detect script when when it's being\r\nrun on unsupported OS or
lsof binary is not present\r\n* Adds logging of the OS and architecture
used by the host\r\n\r\nEvents coming from your local Kibana can viewed
on the [🔒 Staging\r\nTelemetry
cluster](https://telemetry-v2-staging.elastic.dev). Though\r\nkeep in
mind, there is a ~1 hour delay for events indexing 😔\r\n\r\nExample
event:\r\n![CleanShot 2025-01-22 at 12
26\r\n14@2x](https://github.com/user-attachments/assets/077e4f15-5283-4198-a543-30f2507fa0f5)","sha":"ef96cd5d0b9cba3f03a00ff8b6e1e93840119570"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/207726","number":207726,"mergeCommit":{"message":"[Onboarding]
Additional auto-detect flow telemetry (#207726)\n\nCloses
elastic/observability-dev#4236 🔒\r\n\r\nThis
change:\r\n* Moves flow progress update telemetry events to the backend
(this will\r\nprevent situations when multiple progress updates happened
in a short\r\ntime interval, but frontend could only see the latest
update because it\r\nchecks for progress once in a few seconds which
might not be enough in\r\nsome situations)\r\n* Leaves the data_ingested
final event on the FE because it's not\r\nexplicitly triggered on the
BE\r\n* Deletes a separate event type for auto detect flow in favor of
the\r\ngeneric even used by other flows\r\n* Adds progress updates to
the auto-detect script when when it's being\r\nrun on unsupported OS or
lsof binary is not present\r\n* Adds logging of the OS and architecture
used by the host\r\n\r\nEvents coming from your local Kibana can viewed
on the [🔒 Staging\r\nTelemetry
cluster](https://telemetry-v2-staging.elastic.dev). Though\r\nkeep in
mind, there is a ~1 hour delay for events indexing 😔\r\n\r\nExample
event:\r\n![CleanShot 2025-01-22 at 12
26\r\n14@2x](https://github.com/user-attachments/assets/077e4f15-5283-4198-a543-30f2507fa0f5)","sha":"ef96cd5d0b9cba3f03a00ff8b6e1e93840119570"}}]}]
BACKPORT-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (9.0) the previous minor version (i.e. one version back from main) ci:project-deploy-observability Create an Observability project release_note:skip Skip the PR/issue when compiling release notes v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants