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

[APM] Mobile most launches #168925

Merged
merged 36 commits into from
Nov 6, 2023
Merged

Conversation

LikeTheSalad
Copy link
Contributor

@LikeTheSalad LikeTheSalad commented Oct 16, 2023

Summary

Enabling the "Most launches" Mobile dashboard panel which shows an aggregation of log events that contain the attribute labels.lifecycle_state set to either created (for Android) or active (for iOS).

Screenshot 2023-10-27 at 09 37 08 copy

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@LikeTheSalad LikeTheSalad requested review from a team as code owners October 16, 2023 08:50
@botelastic botelastic bot added the Team:APM All issues that need APM UI Team support label Oct 16, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/apm-ui (Team:APM)

@apmmachine
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.
  • /oblt-deploy-serverless : Deploy a serverless Kibana instance using the Observability test environments.
  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

Copy link
Contributor

@CoenWarmer CoenWarmer left a comment

Choose a reason for hiding this comment

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

AO changes LGTM

@LikeTheSalad
Copy link
Contributor Author

@elasticmachine merge upstream

@LikeTheSalad
Copy link
Contributor Author

@elasticmachine merge upstream

}

export interface EventRaw extends APMBaseDoc {
processor: Processor;
Copy link
Contributor

Choose a reason for hiding this comment

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

Does the EventRaw have the processor field?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, it doesn't. I'll remove it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's updated now!

const aggs = {
launches: {
filter: {
terms: { ['labels.lifecycle_state']: ['created', 'active'] },
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Can you please convert labels.lifecycle_state as constant. Similar https://github.com/LikeTheSalad/kibana/blob/3a48bc9289b7dc9b8ecdebbf224a55686a5078f1/x-pack/plugins/apm/common/es_fields/apm.ts#L192C1-L192C1

Also, the values created and active can be enum.

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 converted labels.lifecycle_state to constant 👍 However, regarding creating enums for created and active, I'm not sure what could be a proper file to place them? Also, I guess we'd have to create 2 separate enums, one for android events which would contain created and other for iOS's events with active?

@LikeTheSalad
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Contributor

@kpatticha kpatticha left a comment

Choose a reason for hiding this comment

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

Great job, @LikeTheSalad! Thank you for your efforts.

I couldn't test the Android due to the lack of data in edge. I did review the iOS launches, and they seem great, except for the time series. I left a comment with my feedback.

response.aggregations?.timeseries?.buckets.map((bucket) => ({
x: bucket.key,
y:
response.aggregations?.launches?.byLocation?.buckets[0]?.doc_count ??
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
response.aggregations?.launches?.byLocation?.buckets[0]?.doc_count ??
bucket.launches?.byLocation?.buckets[0]?.doc_count ?? 0

Otherwise, you'll always return the total launches for the timeseries.
it seems we have introduced this bug here

response.aggregations?.requests?.requestsByLocation?.buckets[0]

can you please fix there as well 🙏

Copy link
Contributor

Choose a reason for hiding this comment

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

Could you also please add an API test to prevent this issue? It appears that our existing tests were insufficient in identifying this problem

Copy link
Contributor Author

@LikeTheSalad LikeTheSalad Nov 3, 2023

Choose a reason for hiding this comment

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

Hi @kpatticha - I've just made these changes, fixed the same issue for get_mobile_http_requests_by_location.ts and also I had to fix it in here as well:

response.aggregations?.crashes?.crashesByLocation?.buckets[0]

I've also updated the API test to verify the changes. It should be good now, cheers!

…_location.ts

Co-authored-by: Katerina <kate@kpatticha.com>
@kpatticha kpatticha changed the title Mobile most launches [APM] Mobile most launches Nov 3, 2023
@LikeTheSalad
Copy link
Contributor Author

@elasticmachine merge upstream

@LikeTheSalad
Copy link
Contributor Author

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Serverless Osquery Cypress Tests #4 / ALL - Live Query should run multiline query should run multiline query
  • [job] [logs] Investigations - Security Solution Cypress Tests #4 / Save Timeline Prompts "before each" hook for "When user navigates to the page where timeline is present, Time save modal should not exists." "before each" hook for "When user navigates to the page where timeline is present, Time save modal should not exists."

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/apm-synthtrace-client 180 181 +1

Async chunks

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

id before after diff
apm 3.7MB 3.7MB +142.0B

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
@kbn/apm-synthtrace-client 26 27 +1
Unknown metric groups

API count

id before after diff
@kbn/apm-synthtrace-client 180 181 +1

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@LikeTheSalad LikeTheSalad merged commit 820cfc0 into elastic:main Nov 6, 2023
32 checks passed
@LikeTheSalad LikeTheSalad deleted the mobile-launches branch November 6, 2023 13:14
@kibanamachine kibanamachine added v8.12.0 backport:skip This commit does not require backporting labels Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:enhancement Team:APM All issues that need APM UI Team support v8.12.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants