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

API Key support for APM Integration when using non-Elasticsearch output #7028

Open
simitt opened this issue Jan 10, 2022 · 10 comments
Open

API Key support for APM Integration when using non-Elasticsearch output #7028

simitt opened this issue Jan 10, 2022 · 10 comments

Comments

@simitt
Copy link
Contributor

simitt commented Jan 10, 2022

Define if/how APM Integration should support API Keys for auth handling between APM Agents and APM Server (apm-server.auth.api_key.enabled: true) when a different output than Elasticsearch is configured.

As pointed out by @joshdover in #7025 (comment) the output might be changed after the apm integration was added and configured.
For now, the API Key setup could either not be supported or a yaml box for ES host configuration could be added.

See #7025 for more discussion for a similar issue.

@graphaelli graphaelli changed the title API Key support for APM Integration when using non-Elatsichsearch output API Key support for APM Integration when using non-Elasticsearch output Jan 12, 2022
@axw
Copy link
Member

axw commented Jan 13, 2022

@ruflin and I are discussing API Key auth as part of an evolution of the Elastic Agent architecture. It's still early days, but the idea would be for APM Server to make API Key queries via Elastic Agent. In that kind of architecture, I believe the APM Server's output is irrelevant.

@simitt
Copy link
Contributor Author

simitt commented Jan 13, 2022

Interesting, thanks for the pointer @axw .

Since logstash output is currently planned to be supported in the near future, we could scope this issue to disable changing the output type to something else than Elasticsearch, if API Key auth is enabled on a package policy and not allow enabling API Keys on an APM Integration if the logstash output is already set.
The goal is to avoid breaking data ingestion from APM Agents to Server, when output type is changed or set to logstash. This is a non-obvious dependency, and it would be hard for users to find the root cause of why ingestion is broken, so we should avoid even reaching this state.

Support for API Key handling when output != ES can then be added once API Key handling via Elastic Agent is supported.

@axw
Copy link
Member

axw commented Jan 14, 2022

Sounds good to me.

@ruflin
Copy link
Contributor

ruflin commented Jan 14, 2022

I like the idea that a package can define what sorts of outputs it supports.

@simitt
Copy link
Contributor Author

simitt commented Jan 14, 2022

I like the idea that a package can define what sorts of outputs it supports.

It would not be on a per package base though. The apm package has some features that don't support other outputs yet, so it would be conditional.

@ruflin
Copy link
Contributor

ruflin commented Jan 14, 2022

This makes it unfortunately more complex. Now on each change it has to be checked if a feature is around and if an integration still is working for a policy. And if the output on a policy is changed, also checks need to happen. From a Fleet perspective I guess it means an integration policy will contain some meta information on output compatibility. If we go down that path we need to define the exact error behaviours in the different scenarios.

@simitt
Copy link
Contributor Author

simitt commented Jan 17, 2022

If restrictions are not applied on a feature base, it would mean that APM Server could not support any other output than ES until Elastic Agent/Fleet Server support the features. Is it realistic that the API Key handling and the ES syncronisation required for TBS (#7025) is planned and implemented any time soon?

@alex-fedotyev
Copy link

Could you help understanding couple more details on this subject please?

  1. I suspect that the answer is YES, but want to confirm: Kafka output would introduce same challenges as Logstash output, right? Main reason to bring that up is that Kafka is more common output for APM than Logstash in my experience.
  2. Will other functionality like agent config management suffer from this same way as API keys?

Below is the configuration which comes to mind:
image

@axw
Copy link
Member

axw commented Jan 19, 2022

I suspect that the answer is YES, but want to confirm: Kafka output would introduce same challenges as Logstash output, right? Main reason to bring that up is that Kafka is more common output for APM than Logstash in my experience.

Yes, any non-Elasticsearch output will have the same challenge.

Will other functionality like agent config management suffer from this same way as API keys?

The only other feature that currently needs a direct connection to Elasticsearch is TBS. Agent configuration is pushed down to APM Server via Fleet.

In the past, APM Server would search Elasticsearch directly for RUM source maps; it's now using a hybrid push/pull method that only requires connection to fleet-server, and does not require access to Elasticsearch.

@simitt simitt added this to the 8.2 milestone Feb 3, 2022
@simitt
Copy link
Contributor Author

simitt commented Feb 7, 2022

Conclusion reached with @joshdover and @mostlyjason and @chrisdistasio:
for the initial release of logstash support in Fleet and Agent (planned for 8.2), the APM Integration will not be supported. If an agent policy contains the APM Integration, the logstash output will not be a valid choice. For existing agent policies with configured logstash output, adding the APM Integration will be prohibited.
For this initial phase, no changes are required from the APM side (neither apm-server nor apm-ui).

The issue remains open until we found a longer term solution how APM can support logstash output, while maintaining apm agent auth via API Keys.

@simitt simitt removed this from the 8.2 milestone Feb 7, 2022
@axw axw removed the 8.3-candidate label Mar 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants