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

[Fleet] removed restriction to use remote es as integration data #173353

Merged
merged 5 commits into from
Dec 18, 2023

Conversation

juliaElastic
Copy link
Contributor

@juliaElastic juliaElastic commented Dec 14, 2023

Summary

Closes #173237

Removed restriction to allow using remote es output as integration data output.

Steps to verify:

Send system integration data to remote es

  • Create a remote es output, verify that the output is allowed to be set as default for agent integrations
  • Create an agent policy with system integration and set the remote es output as integration data output
  • Enroll an agent to the agent policy
  • Check the remote kibana - Discover, verify that system metrics are coming in from the agent
  • Install system package on the remote cluster to see dashboards, mappings, etc.

Send nginx integration data to remote es

  • Add nginx integration to the agent policy
  • Create a dummy nginx log file in /var/tmp/nginx/access.log and add some dummy data to it
  • Verify that the data from the nginx log file appears in the remote kibana Discover in logs-* data view.

Back to default output

  • Change the agent policy integration output back to default
  • Verify that the system integration data is ingested in the main cluster.
  • Verify that the API key is invalidated in the remote cluster
image image image image

System dashboard on remote cluster populated:
image

Checklist

@juliaElastic juliaElastic added release_note:skip Skip the PR/issue when compiling release notes v8.12.0 labels Dec 14, 2023
@juliaElastic juliaElastic self-assigned this Dec 14, 2023
@juliaElastic juliaElastic requested a review from a team as a code owner December 14, 2023 08:37
@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Dec 14, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@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!)

@nchaulet
Copy link
Member

@juliaElastic should we prevent remote ES to be used with fleet-server (and maybe synthetics too) as we do for kafka and logasth output?

@juliaElastic
Copy link
Contributor Author

@juliaElastic should we prevent remote ES to be used with fleet-server (and maybe synthetics too) as we do for kafka and logasth output?

Actually I just ran into this limitation when I added APM to the agent policy: #149873
I suppose there is no reason to restrict APM, right? only fleet-server and synthetics

@nchaulet
Copy link
Member

I suppose there is no reason to restrict APM, right? only fleet-server and synthetics

Yes there is probably no reason, but it may be worth checking with the APM team same for endpoint not sure he really make sense to allow endpoint to send data to an external ES

@juliaElastic
Copy link
Contributor Author

juliaElastic commented Dec 14, 2023

I suppose there is no reason to restrict APM, right? only fleet-server and synthetics

Yes there is probably no reason, but it may be worth checking with the APM team same for endpoint not sure he really make sense to allow endpoint to send data to an external ES

Asked both teams on slack to confirm.
Also raised an es pr to add missing privileges to write to traces-* and .logs-endpoint data streams with fleet-server-remote service account: https://github.com/elastic/elasticsearch/pull/103445/files
We can change/revert this if not needed.

@juliaElastic
Copy link
Contributor Author

It seems that endpoint doesn't send any integration data by agents, so it is not relevant to remote es output. I think it would be a no-op if an Agent policy with remote es has endpoint integration. So it doesn't seem needed to restrict using remote es with an agent policy where endpoint integration is added.
The logs-endpoint indices are not used by agent either, I'll remove those from the es pr.

@juliaElastic
Copy link
Contributor Author

I'm trying to test with APM data being sent to remote es, having trouble to generate apm traces locally to pick up by agent. Any ideas how to do that locally? Tried to follow this guide: https://www.elastic.co/guide/en/observability/master/traces-get-started.html

@nchaulet
Copy link
Member

I'm trying to test with APM data being sent to remote es, having trouble to generate apm traces locally to pick up by agent. Any ideas how to do that locally? Tried to follow this guide: https://www.elastic.co/guide/en/observability/master/traces-get-started.html

I think one easy way could be to configure kibana or fleet server to use your local APM server

@juliaElastic
Copy link
Contributor Author

juliaElastic commented Dec 18, 2023

I managed to test APM data being sent to remote es, though seeing some errors as APM team confirmed:

Steps:

  1. create agent policy with remote es output as integration data output
  2. enroll an agent
  3. Add APM integration to agent policy
  4. Add to fleet-server integration policy advanced config
server.instrumentation.enabled: true
server.instrumentation.hosts: ["http://localhost:8200"]
  1. Create data view in remote es output with *apm* index pattern
  2. Seeing data coming in, with errors around sync sourcemaps metadata
image

As discussed with Nima and APM team, there are some features in APM that would have to be worked on to support remote ES output, until then we are going to disable using remote output on a policy with APM integration.

some of the APM Server features piggyback on the ES output config: for synchronising source maps and agent config to APM Server, and for reporting agent config usage metrics to display in Kibana.

@juliaElastic
Copy link
Contributor Author

Added back the check to disallow remote es as data output if agent policy has APM integration:
image

@nchaulet nchaulet self-requested a review December 18, 2023 12:30
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Async chunks

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

id before after diff
fleet 1.2MB 1.2MB -58.0B

History

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

cc @juliaElastic

Copy link
Member

@nchaulet nchaulet left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@juliaElastic juliaElastic merged commit 4d35abe into elastic:main Dec 18, 2023
36 checks passed
@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.12 Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 173353

Questions ?

Please refer to the Backport tool documentation

juliaElastic added a commit to juliaElastic/kibana that referenced this pull request Dec 18, 2023
…stic#173353)

Closes elastic#173237

Removed restriction to allow using remote es output as integration data
output.

- Create a remote es output, verify that the output is allowed to be set
as default for agent integrations
- Create an agent policy with system integration and set the remote es
output as integration data output
- Enroll an agent to the agent policy
- Check the remote kibana - Discover, verify that system metrics are
coming in from the agent
- Install system package on the remote cluster to see dashboards,
mappings, etc.
- Add nginx integration to the agent policy
- Create a dummy nginx log file in `/var/tmp/nginx/access.log` and add
some dummy data to it
- Verify that the data from the nginx log file appears in the remote
kibana Discover in `logs-*` data view.
- Change the agent policy integration output back to default
- Verify that the system integration data is ingested in the main
cluster.
- Verify that the API key is invalidated in the remote cluster

<img width="1742" alt="image"
src="https://github.com/elastic/kibana/assets/90178898/47ed4e89-e761-4f24-90c3-bf3a49a6b4f1">

<img width="937" alt="image"
src="https://github.com/elastic/kibana/assets/90178898/2e41f37e-a4ef-4f18-aed0-d4160efe306a">

<img width="2162" alt="image"
src="https://github.com/elastic/kibana/assets/90178898/bf5d900b-f3bd-493e-b61a-4554224a97fc">

<img width="2150" alt="image"
src="https://github.com/elastic/kibana/assets/90178898/31e4f32e-8751-4b02-855f-dc7fbd5e64a9">

System dashboard on remote cluster populated:
<img width="2157" alt="image"
src="https://github.com/elastic/kibana/assets/90178898/dfb10791-ab15-4058-9170-7cad51935493">

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v8.12.0 v8.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Fleet] Allow integration data to also be sent to Remote Elasticsearch
6 participants