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

[meta] [fleet] Java agent auto attaching #4830

Closed
10 tasks done
jalvz opened this issue Feb 19, 2021 · 12 comments
Closed
10 tasks done

[meta] [fleet] Java agent auto attaching #4830

jalvz opened this issue Feb 19, 2021 · 12 comments
Assignees
Milestone

Comments

@jalvz
Copy link
Contributor

jalvz commented Feb 19, 2021

The goal is to enable users to instrument their Java applications with zero configuration.

This requires a few steps:

@felixbarny
Copy link
Member

Some additional steps:

  • Handling of version updates
    • Download new version
    • Stop attacher
    • Start attacher with path to updated --agent-jar
    • Delete old agent jar?
  • Handling of config changes (ex include/exclude rules)
    • Stop attacher
    • Restart with new config

@simitt
Copy link
Contributor

simitt commented Jun 1, 2021

@felixbarny could you help us define more details for this so we can start working on it?

@jalvz
Copy link
Contributor Author

jalvz commented Jun 3, 2021

@simitt we should add this to #5388, right?

@simitt
Copy link
Contributor

simitt commented Jun 7, 2021

good catch @jalvz , added it.

@jalvz
Copy link
Contributor Author

jalvz commented Jun 16, 2021

@felixbarny how should we handle java logs in the end?
will apm-server just log them as if it were their own? should we handle them separately and have extra settings for it (including rotation / etc)?

@simitt
Copy link
Contributor

simitt commented Jun 17, 2021

@felixbarny related to #4830 (comment) - does that mean that the java agent attacher should not be packaged with the apm-server but that the apm-server needs to check for the latest attacher version and then download that?

@felixbarny
Copy link
Member

how should we handle java logs in the end?

My first idea was that APM Server would just forward the standard out from the attacher to it's own log file. But I'm not sure if that's feasible with the logging framework that APM Server uses. It might be tricky to use the same file lock as the underlying log framework to avoid server and attacher logs to be interleaved.

In that case, it's probably best to have a separate log file for the attacher. See the --log-file and --log-level options of the attacher on how to do that.

Probably not the best alternative but another option would be to write the std. out of the attacher into it's own log file and APM Server would handle the log file rotation itself.

does that mean that the java agent attacher should not be packaged with the apm-server

No. The attacher version should always be a fixed one for an APM Server version.

There are two components that are involved. The attacher (apm-agent-attach-cli-slim.jar), and the Java agent binaries (elastic-apm-agent.jar).

The APM Server should bundle the attacher. The Java agent binaries are resolved using a different mechanism. It's not 100% clear what that mechanism is. Maybe we'll build those capabilities into the attacher for now and switch to Fleet packages later.

@zube zube bot removed the v7.15.0 label Aug 20, 2021
@zube zube bot modified the milestones: 7.15, 7.16 Aug 20, 2021
@stuartnelson3
Copy link
Contributor

Looking at these two issues:

Do we want both of these? It seems like we would be fine doing one of the other -- either apm-server requests the binary download from agent, or the attacher handles it on its own.

Since this behavior is already available in the attacher, it seems like that might be the simpler way to go?

@axw
Copy link
Member

axw commented Aug 24, 2021

I see Felix closed the Elastic Agent method issue. Going with #5853 SGTM too. We may want to revise this later to support airgapped environments, but we don't need to worry about that just now.

@felixbarny
Copy link
Member

felixbarny commented Aug 24, 2021 via email

@simitt
Copy link
Contributor

simitt commented Dec 20, 2021

@stuartnelson3 it looks like all the checkboxes can be ticked, can this be closed?

@stuartnelson3
Copy link
Contributor

yep!

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

5 participants