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] Initial diagnostics tool #157500

Merged
merged 44 commits into from
Jun 5, 2023
Merged

Conversation

sorenlouv
Copy link
Member

@sorenlouv sorenlouv commented May 12, 2023

Pitch: https://github.com/elastic/apm-dev/issues/872 (internal)

Introduces the Diagnostics tool under a hidden page: /app/apm/diagnostics. The Diagnostics tool can help find problems with missing index templates, data streams with incorrect index templates and indices with incorrect mappings.

It will be released in 8.9 but customers can take advantage of it as soon as this PR is merged. They can export a diagnostics bundle from their system by running this script:

node x-pack/plugins/apm/scripts/diagnostics_bundle \ 
--kbHost https://foo.kb.europe-west2.gcp.elastic-cloud.com:9243 \
--esHost https://foo.es.europe-west2.gcp.elastic-cloud.com:9243 \
--username elastic
--password changeme

image

image

image

@sorenlouv sorenlouv requested a review from a team as a code owner May 12, 2023 14:47
@botelastic botelastic bot added the Team:APM - DEPRECATED Use Team:obs-ux-infra_services. label May 12, 2023
@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.
  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@yngrdyn
Copy link
Contributor

yngrdyn commented May 15, 2023

/oblt-deploy

@sorenlouv sorenlouv added release_note:skip Skip the PR/issue when compiling release notes v8.9.0 labels May 17, 2023
@sorenlouv sorenlouv force-pushed the diagnostics-tool branch 5 times, most recently from 8f61c23 to a5b9f16 Compare May 22, 2023 09:14
@sorenlouv sorenlouv force-pushed the diagnostics-tool branch 2 times, most recently from 00e900f to de6a4cf Compare May 26, 2023 09:51
import { FETCH_STATUS } from '../../../hooks/use_fetcher';
import { useDiagnosticsContext } from './context/use_diagnostics';

type DiagnosticsBundle = APIReturnType<'GET /internal/apm/diagnostics'>;
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be useful just to export this type under app/diagnostics folder? I've seen this line in multiple files

Copy link
Contributor

Choose a reason for hiding this comment

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

How can I execute this diagnostics bundle?
Could we add an example in our dev_docs?

Copy link
Contributor

@yngrdyn yngrdyn left a comment

Choose a reason for hiding this comment

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

LGTM, just some minor stuff 🎩

@kpatticha
Copy link
Contributor

/oblt-deploy

1 similar comment
@sorenlouv
Copy link
Member Author

/oblt-deploy

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.

LOVE THIS. I edited the pipeline as we have seen that it can be missing and causing issues and the tool reported it 🥳
image

One "minor" issue that I experienced. Locally without any data, I override the apm-indices with an index that doesn't exist. The diagnostic endpoint failed with 500.

@sorenlouv sorenlouv enabled auto-merge (squash) June 5, 2023 22:02
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
apm 1355 1369 +14

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.5MB 3.5MB +13.8KB

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
apm 112 113 +1
Unknown metric groups

ESLint disabled in files

id before after diff
apm 11 13 +2

ESLint disabled line counts

id before after diff
enterpriseSearch 19 21 +2
securitySolution 414 418 +4
total +6

Total ESLint disabled count

id before after diff
apm 84 86 +2
enterpriseSearch 20 22 +2
securitySolution 498 502 +4
total +8

History

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

@sorenlouv sorenlouv merged commit 8f6469a into elastic:main Jun 5, 2023
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Jun 5, 2023
@sorenlouv sorenlouv deleted the diagnostics-tool branch June 5, 2023 22:42
@sorenlouv
Copy link
Member Author

💚 All backports created successfully

Status Branch Result
8.8
8.7

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

Questions ?

Please refer to the Backport tool documentation

sorenlouv added a commit to sorenlouv/kibana that referenced this pull request Jun 5, 2023
Pitch: elastic/apm-dev#872 (_internal_)

Introduces the Diagnostics tool under a hidden page:
`/app/apm/diagnostics`. The Diagnostics tool can help find problems with
missing index templates, data streams with incorrect index templates and
indices with incorrect mappings.

It will be released in 8.9 but customers can take advantage of it as
soon as this PR is merged. They can export a diagnostics bundle from
their system by running this script:

```
node x-pack/plugins/apm/scripts/diagnostics_bundle \
--kbHost https://foo.kb.europe-west2.gcp.elastic-cloud.com:9243 \
--esHost https://foo.es.europe-west2.gcp.elastic-cloud.com:9243 \
--username elastic
--password changeme
```

![image](https://github.com/elastic/kibana/assets/209966/a783d25e-652a-441f-abcf-acc3444876ee)

![image](https://github.com/elastic/kibana/assets/209966/fe60e83e-d559-459a-9fda-e2adb7d583dc)

![image](https://github.com/elastic/kibana/assets/209966/557aebdf-005d-4cfb-bd16-895c9b1b90cb)

---------

Co-authored-by: Yngrid Coello <yngrdyn@gmail.com>
(cherry picked from commit 8f6469a)
sorenlouv added a commit to sorenlouv/kibana that referenced this pull request Jun 5, 2023
Pitch: elastic/apm-dev#872 (_internal_)

Introduces the Diagnostics tool under a hidden page:
`/app/apm/diagnostics`. The Diagnostics tool can help find problems with
missing index templates, data streams with incorrect index templates and
indices with incorrect mappings.

It will be released in 8.9 but customers can take advantage of it as
soon as this PR is merged. They can export a diagnostics bundle from
their system by running this script:

```
node x-pack/plugins/apm/scripts/diagnostics_bundle \
--kbHost https://foo.kb.europe-west2.gcp.elastic-cloud.com:9243 \
--esHost https://foo.es.europe-west2.gcp.elastic-cloud.com:9243 \
--username elastic
--password changeme
```

![image](https://github.com/elastic/kibana/assets/209966/a783d25e-652a-441f-abcf-acc3444876ee)

![image](https://github.com/elastic/kibana/assets/209966/fe60e83e-d559-459a-9fda-e2adb7d583dc)

![image](https://github.com/elastic/kibana/assets/209966/557aebdf-005d-4cfb-bd16-895c9b1b90cb)

---------

Co-authored-by: Yngrid Coello <yngrdyn@gmail.com>
(cherry picked from commit 8f6469a)
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:skip Skip the PR/issue when compiling release notes Team:APM - DEPRECATED Use Team:obs-ux-infra_services. v8.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants