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

Java attacher runs only in non-cloud environments #6617

Merged
merged 7 commits into from
Nov 16, 2021

Conversation

stuartnelson3
Copy link
Contributor

@stuartnelson3 stuartnelson3 commented Nov 15, 2021

Motivation/summary

start the java attacher jar only when running in a non-cloud environment

Checklist

How to test these changes

  1. start apm-server with the java attacher config enabled and ELASTIC_AGENT_CLOUD set in the environment
  2. verify the java attacher does not start
  3. start apm-server with the java attacher config enabled and ELASTIC_AGENT_CLOUD NOT set in the environment
  4. verify the java attacher does start

Related issues

requested in #5479
depends on #6593

@stuartnelson3 stuartnelson3 requested review from felixbarny and a team November 15, 2021 12:36
@mergify
Copy link
Contributor

mergify bot commented Nov 15, 2021

This pull request does not have a backport label. Could you fix it @stuartnelson3? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-7.x is the label to automatically backport to the 7.x branch.
  • backport-7./d is the label to automatically backport to the 7./d branch. /d is the digit

NOTE: backport-skip has been added to this pull request.

@mergify mergify bot added the backport-skip Skip notification from the automated backport with mergify label Nov 15, 2021
@apmmachine
Copy link
Contributor

apmmachine commented Nov 15, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2021-11-16T14:06:50.684+0000

  • Duration: 40 min 31 sec

  • Commit: a4be324

Test stats 🧪

Test Results
Failed 0
Passed 5610
Skipped 19
Total 5629

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /hey-apm : Run the hey-apm benchmark.

  • /package : Generate and publish the docker images.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@stuartnelson3
Copy link
Contributor Author

/test

beater/beater.go Show resolved Hide resolved
beater/beater.go Show resolved Hide resolved
@stuartnelson3 stuartnelson3 changed the title Java attacher no cloud Java attacher runs only in non-cloud environments Nov 15, 2021
@stuartnelson3
Copy link
Contributor Author

@felixbarny would you be able to test this? the docker container doesn't contain the java runtime so the attacher errors out, but either building a tarball or running make && make build/apm-agent-attach-cli-1.27.0-slim.jar && cp build/java-attacher.jar . should put the .jar in the correct place relative to the apm-server binary.

@stuartnelson3 stuartnelson3 marked this pull request as ready for review November 16, 2021 13:24
@stuartnelson3 stuartnelson3 added backport-8.0 Automated backport with mergify and removed backport-skip Skip notification from the automated backport with mergify labels Nov 16, 2021
@felixbarny
Copy link
Member

We have a dedicated task to test the attachment end-to-end: elastic/apm-agent-java#2196. I think it makes sense to start that after #4830 is closed.

Sub-tasks like these can tested and reviewed in isolation as good as possible. I think the testing phase can start in parallel with the UI implementation. After the UI is done, there'll be a second QA phase that tests fully end-to-end.

WDYT?

@stuartnelson3
Copy link
Contributor Author

Sounds good to me, will merge once tests pass

@stuartnelson3 stuartnelson3 enabled auto-merge (squash) November 16, 2021 14:05
@stuartnelson3
Copy link
Contributor Author

/test

@stuartnelson3 stuartnelson3 merged commit fb55a38 into elastic:master Nov 16, 2021
mergify bot pushed a commit that referenced this pull request Nov 16, 2021
@stuartnelson3 stuartnelson3 deleted the java-attacher-no-cloud branch November 16, 2021 14:57
stuartnelson3 added a commit that referenced this pull request Nov 16, 2021
(cherry picked from commit fb55a38)

Co-authored-by: stuart nelson <stuartnelson3@gmail.com>
@marclop
Copy link
Contributor

marclop commented Jan 4, 2022

Verified with cdeec66:

{"log.level":"error","@timestamp":"2022-01-04T15:41:28.521+0800","log.logger":"beater","log.origin":{"file.name":"beater/beater.go","file.line":443},"message":"java attacher not supported in cloud environments","service.name":"apm-server","ecs.version":"1.6.0"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[fleet] Only support java agent attachment when not running in cloud env
5 participants