Draft
Conversation
Contributor
|
This pull request does not have a backport label. Could you fix it @ycombinator? 🙏
|
8 tasks
The otelcol-opamp.tpl template accesses {{ .OpAMP.APIKey }} and
{{ .OpAMP.InstanceUID }}, so the template data must nest these under
an "OpAMP" key rather than passing them as flat top-level keys.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The otelcol config was being written to config.yml, overwriting the fleet-server config in the same temp dir. Rename it to otelcol.yml. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use runtime.GOOS and runtime.GOARCH to build the download URL dynamically instead of hardcoding darwin_arm64. Also chmod the extracted binary since extractTarGz doesn't preserve permissions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use explicit Close() instead of defer since resp is reassigned later in the function, which would cause the deferred close to act on the wrong response. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Increase context timeout from 1 to 3 minutes to account for the otelcol-contrib download. Use defer for cancel() and cmd.Wait() so cleanup happens even on test failure. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extract instanceUID and apiKey into variables, remove the placeholder time.Sleep, and start the otelcol-contrib binary with the OpAMP extension config pointing at fleet-server. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Poll Kibana via AgentIsOnline to confirm the OTel Collector was enrolled as an agent in Fleet Server after connecting via OpAMP. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move the hardcoded otelcol-contrib version into otelColContribVersion in const.go so it can be easily updated in one place. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the problem this PR solves?
// Please do not just reference an issue. Explain WHAT the problem this PR solves here.
This PR ensures that an OTel Collector (from an upstream contrib release) is able to successfully connect to Fleet Server over OpAMP. Preliminary OpAMP support was added in Fleet Server in #6270 so this PR here is a follow up to that work.
How does this PR solve the problem?
// Explain HOW you solved the problem in your code. It is possible that during PR reviews this changes and then this section should be updated.
By adding a new E2E test,
TestStandAloneRunningSuite/TestOpAMPthat downloads and extracts the OTel Collector binary from an upstream contrib release, configures it with theopampextension, configures Fleet Server to turn on thefeature_flags.enable_opampfeature flag, runs the Collector, and verifies that the Collector is connecting to Fleet Server over OpAMP.How to test this PR locally
Design Checklist
Checklist
./changelog/fragmentsusing the changelog toolRelated issues