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

Remote debug heartbeat #34224

Merged
merged 1 commit into from
Jan 13, 2023
Merged

Conversation

gsantoro
Copy link
Contributor

What does this PR do?

Changes to Tiltfile + dockerfile + manifests to remote debug Heartbeat similarly to how it works already for Metricbeat and Filebeat.

Why is it important?

I found absolutely necessity to be able to remote debug heartbeat and similar beats to investigate bugs

Checklist

None of the below applies since it is a dev tool

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

How to test this PR locally

Instructions at #32326

Related issues

@gsantoro gsantoro requested a review from a team January 10, 2023 14:08
@gsantoro gsantoro self-assigned this Jan 10, 2023
@gsantoro gsantoro requested a review from a team as a code owner January 10, 2023 14:08
@gsantoro gsantoro requested review from faec and leehinman and removed request for a team January 10, 2023 14:08
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jan 10, 2023
@mergify
Copy link
Contributor

mergify bot commented Jan 10, 2023

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @gsantoro? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v8./d.0 is the label to automatically backport to the 8./d branch. /d is the digit

@elasticmachine
Copy link
Collaborator

elasticmachine commented Jan 10, 2023

💚 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: 2023-01-13T13:45:48.353+0000

  • Duration: 70 min 41 sec

Test stats 🧪

Test Results
Failed 0
Passed 25235
Skipped 1954
Total 27189

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

Expand to view the GitHub comments

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

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

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

@gsantoro gsantoro added the Team:Cloudnative-Monitoring Label for the Cloud Native Monitoring team label Jan 11, 2023
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jan 11, 2023
@gsantoro
Copy link
Contributor Author

/test

@cmacknz
Copy link
Member

cmacknz commented Jan 11, 2023

The failure in CI is:


[2023-01-11T09:58:36.531Z] >> Building using: cmd='build/mage-linux-amd64 golangCrossBuild', env=[CC=o64-clang, CXX=o64-clang++, GOARCH=amd64, GOARM=, GOOS=darwin, PLATFORM_ID=darwin-amd64]

[2023-01-11T09:58:36.632Z] fatal: detected dubious ownership in repository at '/go/src/github.com/elastic/beats'

[2023-01-11T09:58:36.632Z] To add an exception for this directory, call:

[2023-01-11T09:58:36.632Z] 

[2023-01-11T09:58:36.632Z] 	git config --global --add safe.directory /go/src/github.com/elastic/beats

[2023-01-11T09:58:36.632Z] Error: template: inline:1:128: executing "inline" at <commit>: error calling commit: running "git rev-parse HEAD" failed with exit code 128

[2023-01-11T09:58:36.632Z] failed to expand template '-s -X github.com/elastic/beats/v7/libbeat/version.buildTime={{ date }} -X github.com/elastic/beats/v7/libbeat/version.commit={{ commit }}'

[2023-01-11T09:58:36.632Z] github.com/elastic/beats/v7/dev-tools/mage.expandTemplate

[2023-01-11T09:58:36.632Z] 	/var/lib/jenkins/workspace/PR-34224-3-18390e45-3611-4430-9588-e80b89f1e8bd/src/github.com/elastic/beats/dev-tools/mage/common.go:102

[2023-01-11T09:58:36.632Z] github.com/elastic/beats/v7/dev-tools/mage.Expand

[2023-01-11T09:58:36.632Z] 	/var/lib/jenkins/workspace/PR-34224-3-18390e45-3611-4430-9588-e80b89f1e8bd/src/github.com/elastic/beats/dev-tools/mage/common.go:58

[2023-01-11T09:58:36.632Z] github.com/elastic/beats/v7/dev-tools/mage.MustExpand

[2023-01-11T09:58:36.632Z] 	/var/lib/jenkins/workspace/PR-34224-3-18390e45-3611-4430-9588-e80b89f1e8bd/src/github.com/elastic/beats/dev-tools/mage/common.go:64

[2023-01-11T09:58:36.632Z] github.com/elastic/beats/v7/dev-tools/mage.Build

[2023-01-11T09:58:36.632Z] 	/var/lib/jenkins/workspace/PR-34224-3-18390e45-3611-4430-9588-e80b89f1e8bd/src/github.com/elastic/beats/dev-tools/mage/build.go:180

[2023-01-11T09:58:36.632Z] github.com/elastic/beats/v7/dev-tools/mage.GolangCrossBuild

[2023-01-11T09:58:36.632Z] 	/var/lib/jenkins/workspace/PR-34224-3-18390e45-3611-4430-9588-e80b89f1e8bd/src/github.com/elastic/beats/dev-tools/mage/build.go:133

[2023-01-11T09:58:36.632Z] github.com/elastic/beats/v7/dev-tools/mage/target/build.GolangCrossBuild

[2023-01-11T09:58:36.632Z] 	/var/lib/jenkins/workspace/PR-34224-3-18390e45-3611-4430-9588-e80b89f1e8bd/src/github.com/elastic/beats/dev-tools/mage/target/build/build.go:38

[2023-01-11T09:58:36.632Z] main.main.func35

[2023-01-11T09:58:36.632Z] 	/var/lib/jenkins/workspace/PR-34224-3-18390e45-3611-4430-9588-e80b89f1e8bd/src/github.com/elastic/beats/metricbeat/mage_output_file.go:1216

[2023-01-11T09:58:36.632Z] main.main.func12.1

[2023-01-11T09:58:36.632Z] 	/var/lib/jenkins/workspace/PR-34224-3-18390e45-3611-4430-9588-e80b89f1e8bd/src/github.com/elastic/beats/metricbeat/mage_output_file.go:316

[2023-01-11T09:58:36.632Z] runtime.goexit

[2023-01-11T09:58:36.632Z] 	/var/lib/jenkins/workspace/PR-34224-3-18390e45-3611-4430-9588-e80b89f1e8bd/.gvm/versions/go1.18.9.linux.amd64/src/runtime/asm_amd64.s:1571

[2023-01-11T09:58:36.632Z] Error: failed building for darwin/amd64: exit status 

Never seen this, but Stackoverflow suggests the ownership of the new directory might be wrong: https://stackoverflow.com/questions/72978485/git-submodule-update-failed-with-fatal-detected-dubious-ownership-in-repositor

@gsantoro
Copy link
Contributor Author

@cmacknz I am not sure how to fix this though.
If I understand the error and the stackoverflow I should run that command git config --global --add safe.directory /go/src/github.com/elastic/beats to fix it. But since that's a global variable the change will be reflected on my laptop and not on the CI. I had run that command on my laptop and there is no change to commit to my PR.

I have checked the ownership of the new folder on my machine but I can't see anything wrong with it.

Any other suggestions?

@cmacknz
Copy link
Member

cmacknz commented Jan 11, 2023

@v1v it looks like elastic/golang-crossbuild#232 is hitting us now

@cmacknz
Copy link
Member

cmacknz commented Jan 13, 2023

The build error should be fixed now if you merge/rebase with main.

@gsantoro
Copy link
Contributor Author

@cmacknz Thanks, I saw the commit to main by chance and this PR seems to be building correctly now. Thanks

@gsantoro gsantoro merged commit eed5bdc into elastic:main Jan 13, 2023
@gsantoro gsantoro deleted the feature/heartbeat_tilt branch January 13, 2023 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Team:Cloudnative-Monitoring Label for the Cloud Native Monitoring team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants