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

Revise wait_for_integration ES implementation #12150

Merged
merged 3 commits into from
Dec 5, 2023

Conversation

axw
Copy link
Member

@axw axw commented Dec 4, 2023

Motivation/summary

Instead of polling Elasticsearch for the presence of index templates, attempt to create a data stream; this will fail if there is no index template with a matching index pattern. This decouples apm-server from the integration package, and will enable apm-server to alternatively work with the apm-data ES plugin.

Instead of eagerly checking the preconditions (which includes making these attempts to create a data stream), we now delay the checks to the first attempt to index/publish events. This means that the "publish_ready" attribute of the server info API response will always be false until the first time events are sent to apm-server.

Checklist

How to test these changes

  1. Create an ES+Kibana stack, but don't install the integration
  2. Run apm-server
  3. Send some events to apm-server, confirm they are not indexed
  4. Install the integration
  5. Send some more events to apm-server, confirm they are (eventually) indexed

Related issues

#11528

Instead of polling Elasticsearch for the presence of index templates,
attempt to create a data stream; this will fail if there is no index
template with a matching index pattern. This decouples apm-server
from the integration package, and will enable apm-server to
alternatively work with the apm-data ES plugin.

Instead of eagerly checking the preconditions (which includes making
these attempts to create a data stream), we now delay the checks to
the first attempt to index/publish events. This means that the
"publish_ready" attribute of the server info API response will always
be false until the first time events are sent to apm-server.
@axw axw force-pushed the check-integration-create-datastream branch from c7a56e5 to d9cfe5b Compare December 4, 2023 13:31
Copy link
Contributor

mergify bot commented Dec 4, 2023

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

  • backport-7.17 is the label to automatically backport to the 7.17 branch.
  • backport-8./d is the label to automatically backport to the 8./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 Dec 4, 2023
@axw axw added v8.12.0 and removed backport-skip Skip notification from the automated backport with mergify labels Dec 4, 2023
@mergify mergify bot added the backport-skip Skip notification from the automated backport with mergify label Dec 4, 2023
@axw axw marked this pull request as ready for review December 4, 2023 13:40
@axw axw requested a review from a team as a code owner December 4, 2023 13:40
@@ -889,7 +899,13 @@ func (s *Runner) newLibbeatFinalBatchProcessor(
}
return acker.Wait(ctx)
}
return publisher, stop, nil
processor := modelprocessor.Chained{
modelpb.ProcessBatchFunc(func(ctx context.Context, batch *modelpb.Batch) error {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: what's the reason for this ? Isn't this handled by the es client ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is for libbeat outputs, which is anything other than Elasticsearch.

@axw axw enabled auto-merge (squash) December 5, 2023 00:03
@axw axw merged commit 3e54384 into elastic:main Dec 5, 2023
11 checks passed
@axw axw deleted the check-integration-create-datastream branch December 5, 2023 00:43
axw added a commit to axw/apm-server that referenced this pull request Dec 19, 2023
@simitt
Copy link
Contributor

simitt commented Dec 19, 2023

Removing the test label, as this has been reverted in #12240

simitt pushed a commit that referenced this pull request Dec 19, 2023
mergify bot pushed a commit that referenced this pull request Dec 19, 2023
This reverts commit 3e54384.

(cherry picked from commit 54e367c)

# Conflicts:
#	internal/beater/checkintegration.go
mergify bot added a commit that referenced this pull request Dec 19, 2023
…" (backport #12240) (#12249)

* Revert "Revise wait_for_integration ES implementation (#12150)" (#12240)

This reverts commit 3e54384.

(cherry picked from commit 54e367c)

# Conflicts:
#	internal/beater/checkintegration.go

* Fix merge conflict

---------

Co-authored-by: Andrew Wilkins <[email protected]>
v1v added a commit to v1v/apm-server that referenced this pull request Dec 21, 2023
…lease-process

* upstream/main:
  Remove Nassim Kammah from list of maintainers (elastic#12269)
  docs: Add tagged regions to changelog (elastic#12251)
  Update apm data (elastic#12242)
  Revert "Revise wait_for_integration ES implementation (elastic#12150)" (elastic#12240)
v1v added a commit to v1v/apm-server that referenced this pull request Dec 21, 2023
…r-elastic

* upstream/main:
  [updatecli] Bump elastic stack version to 8.13.0-yufkxnwm (elastic#12246)
  Remove Nassim Kammah from list of maintainers (elastic#12269)
  docs: Add tagged regions to changelog (elastic#12251)
  Update apm data (elastic#12242)
  Revert "Revise wait_for_integration ES implementation (elastic#12150)" (elastic#12240)
  ci(release): automate release steps (elastic#12234)
  build(deps): bump the github-actions group with 1 update (elastic#12232)
  [updatecli] Update to elastic/beats@a633696068ed (elastic#12164)
  [updatecli] Bump elastic stack version to 8.13.0-h30gube9 (elastic#12235)
  smoke-test: semver sort latest versions (elastic#12229)
  [updatecli] Bump Golang version to 1.21.5 (elastic#12191)
  fix: always try to remap both span and error stacktraces (elastic#12221)
  [updatecli] Bump elastic stack version to 8.13.0-6av99u5d (elastic#12169)
  docs: Update changelogs for 8.12 release (elastic#12172)
amannocci pushed a commit that referenced this pull request Dec 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-skip Skip notification from the automated backport with mergify test-plan-skip v8.12.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants