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

libbeat/beat: add ClientConfig.WaitCloseChan #19514

Closed
wants to merge 2 commits into from

Conversation

axw
Copy link
Member

@axw axw commented Jun 30, 2020

What does this PR do?

This PR adds a ClientConfig.WaitCloseChan channel which, if signalled/closed, will interrupt Client.Close. Setting either ClientConfig.WaitClose (duration) or Client.WaitCloseChan (channel) will cause the client to wait for enqueued events to be acknowledged, or for one of the wait conditions to be satisfied.

Why is it important?

Users of pipeline.Client may wish to block for a limited amount of time while closing the client. Currently there is a single means of achieving this: setting WaitClose when creating the client. This means the wait time cannot be dynamically adjusted.

In APM Server we have a "shutdown timeout" configuration, which is intended to cover all operations during shutdown: graceful HTTP server shutdown, flushing internal event queues, and finally closing the pipeline.Client. The operations leading up to closing the client may take a non-negligible amount of time, so conceptually we need to adjust the WaitClose time while closing, by subtracting the amount of time taken so far from the configured shutdown timeout.

We can achieve this by creating a cancellable context and passing its Done channel in as WaitCloseChan; then cancelling it with a timer started at the beginning of the APM Server's shutdown sequence.

Checklist

  • 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.

Related issues

elastic/apm-server#3789

@axw axw requested a review from urso June 30, 2020 13:27
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jun 30, 2020
@axw axw added the Team:Services (Deprecated) Label for the former Integrations-Services team label Jun 30, 2020
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jun 30, 2020
@axw
Copy link
Member Author

axw commented Jun 30, 2020

@urso I'd appreciate a preliminary review of this before I go and add tests. I've marked it draft because I haven't done that yet.

@axw axw changed the title Pipeline acker wait timeout libbeat/publisher/pipeline: add interruptible Client.WaitWithContext method Jun 30, 2020
@elasticmachine
Copy link
Collaborator

elasticmachine commented Jun 30, 2020

❕ Build Aborted

Either there was a build timeout or someone aborted the build.'}

Pipeline View Test View Changes Artifacts

Expand to view the summary

Build stats

  • Build Cause: [Pull request #19514 updated]

  • Start Time: 2020-07-13T11:42:39.014+0000

  • Duration: 124 min 32 sec

Test stats 🧪

Test Results
Failed 1
Passed 6715
Skipped 1413
Total 8129

Test errors

Expand to view the tests failures

  • Name: Build and Test / Metricbeat OSS Unit tests / test_process – test_system.Test

    • Age: 1
    • Duration: 1.157
    • Error Details: False is not true : fd not found in any process events

Steps errors

Expand to view the steps failures

  • Name: Notifies GitHub of the status of a Pull Request

  • Name: Make -C filebeat testsuite

    • Description: make -C filebeat testsuite

    • Duration: 22 min 52 sec

    • Start Time: 2020-07-13T12:12:35.662+0000

    • log

  • Name: Mage update build test

    • Description: mage update build test

    • Duration: 5 min 48 sec

    • Start Time: 2020-07-13T12:12:36.421+0000

    • log

  • Name: Make -C auditbeat testsuite

    • Description: make -C auditbeat testsuite

    • Duration: 7 min 30 sec

    • Start Time: 2020-07-13T12:12:35.791+0000

    • log

  • Name: Mage update build test

    • Description: mage update build test

    • Duration: 4 min 52 sec

    • Start Time: 2020-07-13T12:12:37.532+0000

    • log

  • Name: Make -C libbeat testsuite

    • Description: make -C libbeat testsuite

    • Duration: 31 min 37 sec

    • Start Time: 2020-07-13T12:11:58.607+0000

    • log

  • Name: Make -C x-pack/libbeat testsuite

    • Description: make -C x-pack/libbeat testsuite

    • Duration: 6 min 8 sec

    • Start Time: 2020-07-13T12:11:58.753+0000

    • log

  • Name: Mage build unitTest

    • Description: mage build unitTest

    • Duration: 6 min 49 sec

    • Start Time: 2020-07-13T12:12:12.752+0000

    • log

  • Name: Mage goIntegTest

    • Description: mage goIntegTest

    • Duration: 5 min 37 sec

    • Start Time: 2020-07-13T12:12:53.983+0000

    • log

  • Name: Mage pythonIntegTest

    • Description: mage pythonIntegTest

    • Duration: 3 min 19 sec

    • Start Time: 2020-07-13T12:12:51.260+0000

    • log

  • Name: Report to Codecov

    • Description: curl -sSLo codecov https://codecov.io/bash for i in auditbeat filebeat heartbeat libbeat metricbeat packetbeat winlogbeat journalbeat do FILE="${i}/build/coverage/full.cov" if [ -f "${FILE}" ]; then bash codecov -f "${FILE}" fi done

    • Duration: 2 min 23 sec

    • Start Time: 2020-07-13T12:13:04.366+0000

    • log

  • Name: Report to Codecov

    • Description: curl -sSLo codecov https://codecov.io/bash for i in auditbeat filebeat heartbeat libbeat metricbeat packetbeat winlogbeat journalbeat do FILE="${i}/build/coverage/full.cov" if [ -f "${FILE}" ]; then bash codecov -f "${FILE}" fi done

    • Duration: 2 min 23 sec

    • Start Time: 2020-07-13T12:15:28.958+0000

    • log

  • Name: Mage build test

    • Description: mage build test

    • Duration: 8 min 38 sec

    • Start Time: 2020-07-13T12:42:57.331+0000

    • log

  • Name: Notifies GitHub of the status of a Pull Request

  • Name: Make -C packetbeat testsuite

    • Description: make -C packetbeat testsuite

    • Duration: 7 min 50 sec

    • Start Time: 2020-07-13T12:13:03.060+0000

    • log

  • Name: Report to Codecov

    • Description: curl -sSLo codecov https://codecov.io/bash for i in auditbeat filebeat heartbeat libbeat metricbeat packetbeat winlogbeat journalbeat do FILE="${i}/build/coverage/full.cov" if [ -f "${FILE}" ]; then bash codecov -f "${FILE}" fi done

    • Duration: 2 min 23 sec

    • Start Time: 2020-07-13T12:15:29.266+0000

    • log

  • Name: Make -C generator/_templates/metricbeat test-package

    • Description: make -C generator/_templates/metricbeat test-package

    • Duration: 7 min 14 sec

    • Start Time: 2020-07-13T12:17:53.164+0000

    • log

Log output

Expand to view the last 100 lines of log output

[2020-07-13T13:18:11.197Z] [success] 2.20% test_processors.Test.test_rename_field: 0.6734s
[2020-07-13T13:18:11.198Z] [success] 2.09% test_system.Test.test_filesystem: 0.6391s
[2020-07-13T13:18:11.198Z] [success] 1.89% test_system.Test.test_socket_summary: 0.5789s
[2020-07-13T13:18:11.198Z] [success] 1.89% test_system.Test.test_process: 0.5779s
[2020-07-13T13:18:11.198Z] [success] 1.88% test_cmd.TestCommands.test_modules_list: 0.5767s
[2020-07-13T13:18:11.198Z] [success] 1.88% test_cmd.TestCommands.test_modules_disable: 0.5751s
[2020-07-13T13:18:11.198Z] [success] 1.86% test_cmd.TestCommands.test_modules_enable: 0.5707s
[2020-07-13T13:18:11.198Z] [success] 1.83% test_system.Test.test_network: 0.5617s
[2020-07-13T13:18:11.198Z] [success] 1.82% test_system.Test.test_process_metricbeat: 0.5569s
[2020-07-13T13:18:11.198Z] [success] 1.70% test_template.Test.test_export_template: 0.5208s
[2020-07-13T13:18:11.198Z] [success] 1.65% test_processors.Test.test_include_fields: 0.5043s
[2020-07-13T13:18:11.198Z] [success] 1.64% test_processors.Test.test_contradictory_multiple_actions: 0.5021s
[2020-07-13T13:18:11.198Z] [success] 1.63% test_processors.Test.test_multiple_actions: 0.4991s
[2020-07-13T13:18:11.198Z] [success] 1.61% test_system.Test.test_cpu_ticks_option: 0.4939s
[2020-07-13T13:18:11.198Z] [success] 1.51% test_system.Test.test_memory: 0.4634s
[2020-07-13T13:18:11.198Z] [success] 1.51% test_processors.Test.test_dropevent_with_complex_condition: 0.4624s
[2020-07-13T13:18:11.198Z] [success] 1.44% test_processors.Test.test_dropfields_with_condition: 0.4418s
[2020-07-13T13:18:11.198Z] [success] 1.09% test_cmd.TestCommands.test_modules_test: 0.3323s
[2020-07-13T13:18:11.198Z] [success] 1.06% test_cmd.TestCommands.test_modules_test_filter: 0.3259s
[2020-07-13T13:18:11.198Z] [success] 1.05% test_cmd.TestCommands.test_modules_test_error: 0.3225s
[2020-07-13T13:18:11.198Z] [success] 1.04% test_cmd.TestCommands.test_modules_test_with_module_in_main_config: 0.3174s
[2020-07-13T13:18:11.198Z] [success] 1.03% test_cmd.TestCommands.test_modules_test_filter_no_result: 0.3152s
[2020-07-13T13:18:11.198Z] [success] 0.39% test_reload.Test.test_wrong_module_no_reload: 0.1187s
[2020-07-13T13:18:11.198Z] ----------------------------------------------------------------------
[2020-07-13T13:18:11.198Z] Ran 215 tests in 30.673s
[2020-07-13T13:18:11.198Z] 
[2020-07-13T13:18:11.198Z] OK (SKIP=177)
[2020-07-13T13:18:11.198Z] >> python test: Unit Testing Complete
[2020-07-13T13:18:11.543Z] Recording test results
[2020-07-13T13:18:13.119Z] Stashed 2 file(s)
[2020-07-13T13:18:13.184Z] Archiving artifacts
[2020-07-13T13:18:14.510Z] + curl -sSLo codecov https://codecov.io/bash
[2020-07-13T13:18:14.953Z] + for i in auditbeat filebeat heartbeat libbeat metricbeat packetbeat winlogbeat journalbeat
[2020-07-13T13:18:14.953Z] + FILE=auditbeat/build/coverage/full.cov
[2020-07-13T13:18:14.953Z] + '[' -f auditbeat/build/coverage/full.cov ']'
[2020-07-13T13:18:14.953Z] + for i in auditbeat filebeat heartbeat libbeat metricbeat packetbeat winlogbeat journalbeat
[2020-07-13T13:18:14.953Z] + FILE=filebeat/build/coverage/full.cov
[2020-07-13T13:18:14.953Z] + '[' -f filebeat/build/coverage/full.cov ']'
[2020-07-13T13:18:14.953Z] + for i in auditbeat filebeat heartbeat libbeat metricbeat packetbeat winlogbeat journalbeat
[2020-07-13T13:18:14.953Z] + FILE=heartbeat/build/coverage/full.cov
[2020-07-13T13:18:14.953Z] + '[' -f heartbeat/build/coverage/full.cov ']'
[2020-07-13T13:18:14.953Z] + for i in auditbeat filebeat heartbeat libbeat metricbeat packetbeat winlogbeat journalbeat
[2020-07-13T13:18:14.953Z] + FILE=libbeat/build/coverage/full.cov
[2020-07-13T13:18:14.953Z] + '[' -f libbeat/build/coverage/full.cov ']'
[2020-07-13T13:18:14.954Z] + for i in auditbeat filebeat heartbeat libbeat metricbeat packetbeat winlogbeat journalbeat
[2020-07-13T13:18:14.954Z] + FILE=metricbeat/build/coverage/full.cov
[2020-07-13T13:18:14.954Z] + '[' -f metricbeat/build/coverage/full.cov ']'
[2020-07-13T13:18:14.954Z] + for i in auditbeat filebeat heartbeat libbeat metricbeat packetbeat winlogbeat journalbeat
[2020-07-13T13:18:14.954Z] + FILE=packetbeat/build/coverage/full.cov
[2020-07-13T13:18:14.954Z] + '[' -f packetbeat/build/coverage/full.cov ']'
[2020-07-13T13:18:14.954Z] + for i in auditbeat filebeat heartbeat libbeat metricbeat packetbeat winlogbeat journalbeat
[2020-07-13T13:18:14.954Z] + FILE=winlogbeat/build/coverage/full.cov
[2020-07-13T13:18:14.954Z] + '[' -f winlogbeat/build/coverage/full.cov ']'
[2020-07-13T13:18:14.954Z] + for i in auditbeat filebeat heartbeat libbeat metricbeat packetbeat winlogbeat journalbeat
[2020-07-13T13:18:14.954Z] + FILE=journalbeat/build/coverage/full.cov
[2020-07-13T13:18:14.954Z] + '[' -f journalbeat/build/coverage/full.cov ']'
[2020-07-13T13:44:39.231Z] Cancelling nested steps due to timeout
[2020-07-13T13:44:44.258Z] Stage "Heartbeat Windows" skipped due to earlier failure(s)
[2020-07-13T13:44:44.306Z] Stage "Functionbeat Windows" skipped due to earlier failure(s)
[2020-07-13T13:44:47.186Z] Failed in branch Heartbeat
[2020-07-13T13:44:47.216Z] Failed in branch Functionbeat
[2020-07-13T13:45:03.183Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19514/src/github.com/elastic/beats
[2020-07-13T13:45:03.924Z] + find . -type f -name TEST*.xml -path */build/* -delete
[2020-07-13T13:45:04.063Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19514/src/github.com/elastic/beats/Lint
[2020-07-13T13:45:05.290Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19514/src/github.com/elastic/beats/Elastic-Agent-x-pack
[2020-07-13T13:45:06.422Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19514/src/github.com/elastic/beats/Auditbeat-crosscompile
[2020-07-13T13:45:08.436Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19514/src/github.com/elastic/beats/Winlogbeat-oss
[2020-07-13T13:45:10.292Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19514/src/github.com/elastic/beats/Dockerlogbeat
[2020-07-13T13:45:12.010Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19514/src/github.com/elastic/beats/Generators-Metricbeat-Linux
[2020-07-13T13:45:13.439Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19514/src/github.com/elastic/beats/Metricbeat-Python-integration-tests
[2020-07-13T13:45:14.562Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19514/src/github.com/elastic/beats/Functionbeat-x-pack
[2020-07-13T13:45:15.756Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19514/src/github.com/elastic/beats/Journalbeat-oss
[2020-07-13T13:45:16.909Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19514/src/github.com/elastic/beats/Elastic-Agent-x-pack-Windows
[2020-07-13T13:45:17.727Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19514/src/github.com/elastic/beats/Auditbeat-x-pack
[2020-07-13T13:45:18.699Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19514/src/github.com/elastic/beats/Filebeat-x-pack
[2020-07-13T13:45:19.739Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19514/src/github.com/elastic/beats/Metricbeat-OSS-Integration-tests
[2020-07-13T13:45:20.745Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19514/src/github.com/elastic/beats/Metricbeat-OSS-Unit-tests
[2020-07-13T13:45:21.698Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19514/src/github.com/elastic/beats/Libbeat-x-pack
[2020-07-13T13:45:22.607Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19514/src/github.com/elastic/beats/Packetbeat-oss
[2020-07-13T13:45:23.481Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19514/src/github.com/elastic/beats/Auditbeat-oss-Linux
[2020-07-13T13:45:24.721Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19514/src/github.com/elastic/beats/Winlogbeat-Windows-x-pack
[2020-07-13T13:45:25.995Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19514/src/github.com/elastic/beats/Auditbeat-oss-Windows
[2020-07-13T13:45:28.304Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19514/src/github.com/elastic/beats/Auditbeat-x-pack-Windows
[2020-07-13T13:45:30.361Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19514/src/github.com/elastic/beats/Heartbeat-oss
[2020-07-13T13:45:32.318Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19514/src/github.com/elastic/beats/Filebeat-x-pack-Windows
[2020-07-13T13:45:34.141Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19514/src/github.com/elastic/beats/Metricbeat-crosscompile
[2020-07-13T13:45:35.703Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19514/src/github.com/elastic/beats/Filebeat-Windows
[2020-07-13T13:45:37.458Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19514/src/github.com/elastic/beats/Metricbeat-x-pack-Windows
[2020-07-13T13:45:39.111Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19514/src/github.com/elastic/beats/Metricbeat-Windows
[2020-07-13T13:45:39.427Z] Body did not finish within grace period; terminating with extreme prejudice
[2020-07-13T13:45:42.086Z] ERROR: runbld post build action failed.
[2020-07-13T13:45:42.087Z] Timeout has been exceeded
[2020-07-13T13:46:01.788Z] Running on Jenkins in /var/lib/jenkins/workspace/Beats_beats_PR-19514
[2020-07-13T13:46:03.444Z] [INFO] getVaultSecret: Getting secrets
[2020-07-13T13:46:04.347Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID
[2020-07-13T13:46:11.404Z] + chmod 755 generate-build-data.sh
[2020-07-13T13:46:11.405Z] + ./generate-build-data.sh https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-19514/ https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-19514/runs/2 ABORTED 7412001
[2020-07-13T13:46:11.655Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-19514/runs/2/steps/?limit=10000 -o steps-info.json
[2020-07-13T13:46:33.578Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-19514/runs/2/tests/?status=FAILED -o tests-errors.json
[2020-07-13T13:46:36.066Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-19514/runs/2/log/ -o pipeline-log.txt

@axw
Copy link
Member Author

axw commented Jul 1, 2020

I'm going to rework this. Although I think passing context to Close would be the more idiomatic approach, for now we can do this less invasively by specifying a channel sibling to libbeat/beat.Pipeline.WaitClose.

EDIT: done.

@axw axw changed the title libbeat/publisher/pipeline: add interruptible Client.WaitWithContext method libbeat/beat: add ClientConfig.WaitCloseChan Jul 1, 2020
axw added 2 commits July 13, 2020 19:19
Set the "closing" variable to true, not false,
upon signalling the waiter to close.
Introduce WaitCloseChan as an alternative to the
WaitClose timeout for more flexible control over
blocking during Client.Close.
@axw axw force-pushed the pipeline-acker-wait-timeout branch from 0ae06e7 to a22ae69 Compare July 13, 2020 11:20
@axw axw added the bug label Jul 13, 2020
@axw
Copy link
Member Author

axw commented Jul 13, 2020

@urso this is now ready, please take a look.

If you're hesitant about adding the whole PR into 7.9, then I think we should cherry-pick 8aa304e.

@axw axw marked this pull request as ready for review July 13, 2020 11:26
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations (Team:Integrations)

@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations-services (Team:Services)

@urso
Copy link

urso commented Jul 13, 2020

Have you considered to not rely on the waiting functionality from the pipeline? If possible I'd like to 'shrink' the pipeline API instead of adding more features. For example filebeat also has a shutdown timeout, but it is implemented using an ACKer that is attached to each beat.Client. The ACKer gets informed when an event is published, dropped by the processors, ACKed, or the Client is shut down. Using ACKers one can add behavior globally or locally, e.g. by incrementing and decrementing a counter.

Filebeat is somewhat special, because it creates events to be dropped on purpose, but still requires them to be ACKed in order, so special state updates can be forward to it's registry. The implementation could be simpler (as we're planning to fix this behavior in filebeat). For reference see the current filebeat event counter: https://github.com/elastic/beats/blob/master/filebeat/beater/filebeat.go#L235

Libbeat provides some common ACKer (and helpers) in libbeat/common/acker.

An ACKer that blocks on shutdown until all non-filtered events are published could be implemented like this (very naive implementation):

type waitPublishedACKer struct {
  wg sync.WaitGroup
}

func (a *waitPublishedACKer) AddEvent(event beat.Event, published bool) {
  if published {  // event not dropped by processors
    a.wg.Add(1)
  }
}

func (a *waitPublishedACKer) ACKEvents(n int) {
  a.wg.Add(-n)
}

// Close is used by the publisher pipeline to indicate that the beat.Client is closed. We ignore the signal, as we want to be informed for all pending operations
func (*waitPublishedACKer) Close() {}

func (a *waitPublishedACKer) Wait() {
  a.wg.Wait()
}

Being in control of the counting and 'Wait' we can be quite flexible in the implementation without touching the pipeline API (which is already quite big).

The acker can be hooked up like this (Filebeat postpones the pipeline.Close by blocking shutdown, but not the Client.Close):

shutdownWait := &waitPublishedACKer{}
pipeline = pipetool.WithACKer(pipeline, shutdownWait) // the new pipeline attaches the sutdownWait acker to each client on `Connect` or `ConnectWith`. ACKers are 'merged' if the input/client registers it's own ACKer
client := pipeline.Connect() // one can also pass the custom acker via ACKHandler
defer func() {
  shutdownWait.Wait()
  client.Close()
}()

If you look into Filebeat you will notice that it also installs the counter into the beat.Client. This is not really necessary, but a workaround by Filebeat itself to also account for "invalid" events. The acker approach should be enough.

The ACKer approach allows you to develop the functionality independent in apm-server. Still it would be nice to share it via libbeat/common/acker, so we can reuse the functionality at will (either local per input, or global per beat).

@axw
Copy link
Member Author

axw commented Jul 13, 2020

@urso sounds reasonable. I'll take a look at that approach soonish. In the mean time, I'll create a separate PR for the bug fix.

@axw axw marked this pull request as draft July 13, 2020 13:30
@axw
Copy link
Member Author

axw commented Jul 14, 2020

I've implemented this in elastic/apm-server#3971; that won't be going in until 7.10.0. Once I'm satisfied the implementation works well for apm-server I'll create a PR to propose adding it to libbeat. Closing this one - thanks for your feedback @urso!

@axw axw closed this Jul 14, 2020
@urso
Copy link

urso commented Jul 14, 2020

Once I'm satisfied the implementation works well for apm-server I'll create a PR to propose adding it to libbeat.

Cool, looking forward to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug enhancement Team:Integrations Label for the Integrations team Team:Services (Deprecated) Label for the former Integrations-Services team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants