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

[Stack Monitoring] Add support for beats datastream patterns #146184

Merged
merged 10 commits into from
Dec 19, 2022

Conversation

klacabane
Copy link
Contributor

@klacabane klacabane commented Nov 23, 2022

Summary

Closes #146686

Update apm and beats queries to read from the Beat package data streams created in elastic/integrations#4708. Also updates health API to fetch from the data streams.

API tests follow up in #147755

Testing

That's a fairly heavy workflow. I'm investigating ways to make that easier

  • build beat package with elastic-package build. The package is not published yet so you'll need to pull [beat] Create beat package integrations#4708 locally
  • start a stack elastic-package stack up -v -d --version 8.7.0-SNAPSHOT. Make sure you do this within integrations repo so it picks up the previously built package
  • start a beat service with elastic-package service up -v --variant metricbeat_8.7.0
  • install both elasticsearch and beat packages from the kibana started by the stack command (https://localhost:5601). Nothing shows up in SM if we don't have elasticsearch data.
    • both packages are prerelease versions and we need to explicitly tell Integrations plugin to show them up[1]
    • elasticsearch hosts is https://elasticsearch:9200 and beat should be http://elastic-package-service_beat_1:5066 but it may differ depending on your docker version
  • start a Kibana with this branch connected to the elasticsearch instance from the stack up command. see howto
  • navigate to Stack Monitoring and verify the metricbeat is properly monitored
  • start an apm server with elastic-package service up -v --variant apm_8.7.0
  • navigate to Stack Monitoring and verify apm-server is properly monitored

[1]
Screenshot 2022-12-01 at 00 20 20

@klacabane klacabane added Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services Feature:Stack Monitoring labels Nov 23, 2022
@klacabane klacabane self-assigned this Nov 23, 2022
@klacabane klacabane marked this pull request as ready for review December 1, 2022 15:36
@klacabane klacabane requested a review from a team as a code owner December 1, 2022 15:36
@elasticmachine
Copy link
Contributor

Pinging @elastic/infra-monitoring-ui (Team:Infra Monitoring UI)

@miltonhultgren
Copy link
Contributor

Screenshot 2022-12-12 at 15 48 25

If you select a very large time range the graphs go blank and the metrics are N/A, this applied to ES views as well.

Screenshot 2022-12-12 at 15 55 46

The API responds with no data.

Copy link
Contributor

@miltonhultgren miltonhultgren left a comment

Choose a reason for hiding this comment

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

LGTM 👍🏼 Tested both types locally

@miltonhultgren
Copy link
Contributor

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Unknown metric groups

ESLint disabled in files

id before after diff
osquery 1 2 +1

ESLint disabled line counts

id before after diff
enterpriseSearch 19 21 +2
fleet 61 67 +6
osquery 109 115 +6
securitySolution 439 445 +6
total +20

Total ESLint disabled count

id before after diff
enterpriseSearch 20 22 +2
fleet 70 76 +6
osquery 110 117 +7
securitySolution 516 522 +6
total +21

History

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

cc @klacabane

@klacabane
Copy link
Contributor Author

Will add api tests in #147755

@klacabane
Copy link
Contributor Author

Screenshot 2022-12-19 at 14 56 46

Ack value stays flat at 0 which is caused by missing assets used to store apm data:

{"file.name":"beater/waitready.go","file.line":62},"message":"precondition 'apm integration installed' failed: error querying Elasticsearch for integration index templates: unexpected HTTP status: 404 Not Found ({\"error\":{\"root_cause\":[{\"type\":\"resource_not_found_exception\",\"reason\":\"index template matching [logs-apm.error] not found\"}],\"type\":\"resource_not_found_exception\",\"reason\":\"index template matching [logs-apm.error] not found\"},\"status\":404}): to remediate, please install the apm integration: https://ela.st/apm-integration-quickstart","service.name":"apm-server","ecs.version":"1.6.0"}

I'll create a follow up to install apm integration as part of the apm setup script

@klacabane klacabane merged commit 10c4989 into elastic:main Dec 19, 2022
@kibanamachine kibanamachine added v8.7.0 backport:skip This commit does not require backporting labels Dec 19, 2022
crespocarlos pushed a commit to crespocarlos/kibana that referenced this pull request Dec 23, 2022
…#146184)

## Summary
Closes elastic#146686

Update apm and beats queries to read from the Beat package data streams
created in elastic/integrations#4708. Also
updates health API to fetch from the data streams.

API tests follow up in elastic#147755

### Testing
That's a fairly heavy workflow. I'm investigating ways to make that
easier

- build `beat` package with `elastic-package build`. The package is not
published yet so you'll need to pull
elastic/integrations#4708 locally
- start a stack `elastic-package stack up -v -d --version
8.7.0-SNAPSHOT`. Make sure you do this within `integrations` repo so it
picks up the previously built package
- start a beat service with `elastic-package service up -v --variant
metricbeat_8.7.0`
- install both elasticsearch and beat packages from the kibana started
by the stack command (`https://localhost:5601`). Nothing shows up in SM
if we don't have elasticsearch data.
- both packages are prerelease versions and we need to explicitly tell
Integrations plugin to show them up[1]
- elasticsearch hosts is `https://elasticsearch:9200` and beat _should
be_ `http://elastic-package-service_beat_1:5066` but it may differ
depending on your docker version
- start a Kibana with this branch connected to the elasticsearch
instance from the `stack up` command. [see
howto](https://github.com/elastic/observability-dev/blob/main/docs/infra-obs-ui/stack-monitoring_integration-packages.md#connecting-a-local-kibana)
- navigate to Stack Monitoring and verify the metricbeat is properly
monitored
- start an apm server with `elastic-package service up -v --variant
apm_8.7.0`
- navigate to Stack Monitoring and verify apm-server is properly
monitored


[1]
<img width="853" alt="Screenshot 2022-12-01 at 00 20 20"
src="https://user-images.githubusercontent.com/5239883/204929352-c7656679-f88c-4013-b1f8-cf7c67d4c830.png">

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
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 Feature:Stack Monitoring release_note:enhancement Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services v8.7.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Stack Monitoring] Support beat package data streams
5 participants