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

Remove unnecessary restarts of metricsets while using Node autodiscover #19974

Merged
merged 3 commits into from
Jul 29, 2020

Conversation

vjsamuel
Copy link
Contributor

@vjsamuel vjsamuel commented Jul 16, 2020

Bug

What does this PR do?

Everytime the kubelet does a check for node health it posts an update to the node status. Each change even if overall status doesnt change then it causes the metricset to restart. This PR adds a watcher option to register a func that checks in detail if the update is valid or not.

Why is it important?

This makes sure that the kubelet status updates dont prompt a restart unless the overall status changes.

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.

Author's Checklist

How to test this PR locally

metricbeat.autodiscover:
  providers:
    - type: kubernetes
      in_cluster: false
      kube_config: ${HOME}/.kube/config
      scope: node
      node: ${NODENAME}
      resource: node
      templates:
        - config:
            - module: http
              period: 1m
              metricsets: ["json"]
              namespace: beats
              hosts: "${data.host}:5002"
              path: "/stats"

Related issues

@elasticmachine
Copy link
Collaborator

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

1 similar comment
@elasticmachine
Copy link
Collaborator

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jul 16, 2020
@vjsamuel vjsamuel force-pushed the fix_node_metricset_restarts branch 2 times, most recently from 32d6c6c to f205ee0 Compare July 16, 2020 06:49
@andresrc andresrc added the Team:Platforms Label for the Integrations - Platforms team label Jul 16, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations-platforms (Team:Platforms)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jul 16, 2020
@ChrsMark
Copy link
Member

Really interesting addition @vjsamuel, thanks! It looks good to me in general!

@exekias do want to have a look too?

Also @exekias @vjsamuel, do you think we could add this logic to Pod's resources too (not in this PR)? I ve seen a lot of unnecessary updates with Pods too.

@ChrsMark
Copy link
Member

jenkins run the tests please

@exekias
Copy link
Contributor

exekias commented Jul 17, 2020

Thank you for opening, I agree @ChrsMark we could do something similar with Pods (an the others).

A note on using reflect:

I've checked this discussion kubernetes-sigs/kubebuilder#592 and it seems that there are better alternatives:

Option 1 (I think this one is preferred, as we probably have this package already):

import "k8s.io/apimachinery/pkg/api/equality"


if !equality.Semantic.DeepDerivative(expected.Spec, found.Spec) {
  // some field set by the operator has changed
}

Option 2:

Using https://github.com/banzaicloud/k8s-objectmatcher, which doesn't look bad either

WDYT?

@vjsamuel vjsamuel force-pushed the fix_node_metricset_restarts branch from f205ee0 to 57af22b Compare July 17, 2020 23:26
@vjsamuel
Copy link
Contributor Author

@exekias done.

@elasticmachine
Copy link
Collaborator

elasticmachine commented Jul 17, 2020

💔 Tests Failed

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [ChrsMark commented: jenkins run the tests please]

  • Start Time: 2020-07-29T08:35:28.693+0000

  • Duration: 70 min 8 sec

Test stats 🧪

Test Results
Failed 14
Passed 14313
Skipped 1360
Total 15687

Test errors

Expand to view the tests failures

  • Name: Build and Test / Libbeat / Libbeat oss / TestDockerStart – docker

    • Age: 1
    • Duration: 12.44
    • Error Details: Failed
  • Name: Build and Test / Auditbeat x-pack / test_connected_udp_ipv4 – test_system_socket.Test

    • Age: 1
    • Duration: 60.114
    • Error Details: Expected exit code to be 0, but it was 1
  • Name: Build and Test / Auditbeat x-pack / test_connected_udp_ipv6 – test_system_socket.Test

    • Age: 1
    • Duration: 60.111
    • Error Details: Expected exit code to be 0, but it was 1
  • Name: Build and Test / Auditbeat x-pack / test_dns_enrichment – test_system_socket.Test

    • Age: 1
    • Duration: 60.102
    • Error Details: Expected exit code to be 0, but it was 1
  • Name: Build and Test / Auditbeat x-pack / test_dns_long_request – test_system_socket.Test

    • Age: 1
    • Duration: 60.11
    • Error Details: Expected exit code to be 0, but it was 1
  • Name: Build and Test / Auditbeat x-pack / test_dns_udp_ipv6 – test_system_socket.Test

    • Age: 1
    • Duration: 60.105
    • Error Details: Expected exit code to be 0, but it was 1
  • Name: Build and Test / Auditbeat x-pack / test_dns_unidirectional_udp – test_system_socket.Test

    • Age: 1
    • Duration: 60.108
    • Error Details: Expected exit code to be 0, but it was 1
  • Name: Build and Test / Auditbeat x-pack / test_multi_udp_upv4 – test_system_socket.Test

    • Age: 1
    • Duration: 60.118
    • Error Details: Expected exit code to be 0, but it was 1
  • Name: Build and Test / Auditbeat x-pack / test_no_dns_enrichment – test_system_socket.Test

    • Age: 1
    • Duration: 60.115
    • Error Details: Expected exit code to be 0, but it was 1
  • Name: Build and Test / Auditbeat x-pack / test_tcp_ipv4 – test_system_socket.Test

    • Age: 1
    • Duration: 60.113
    • Error Details: Expected exit code to be 0, but it was 1
  • Name: Build and Test / Auditbeat x-pack / test_tcp_ipv6_disabled – test_system_socket.Test

    • Age: 1
    • Duration: 60.118
    • Error Details: Expected exit code to be 0, but it was 1
  • Name: Build and Test / Auditbeat x-pack / test_udp_ipv4 – test_system_socket.Test

    • Age: 1
    • Duration: 60.116
    • Error Details: Expected exit code to be 0, but it was 1
  • Name: Build and Test / Auditbeat x-pack / test_udp_ipv6 – test_system_socket.Test

    • Age: 1
    • Duration: 60.117
    • Error Details: Expected exit code to be 0, but it was 1
  • Name: Build and Test / Auditbeat x-pack / test_udp_ipv6_disabled – test_system_socket.Test

    • Age: 1
    • Duration: 60.115
    • Error Details: Expected exit code to be 0, but it was 1

Steps errors

Expand to view the steps failures

  • Name: Mage update build test

    • Description: mage update build test

    • Duration: 19 min 28 sec

    • Start Time: 2020-07-29T08:57:48.866+0000

    • log

  • Name: Mage build test

    • Description: mage build test

    • Duration: 20 min 9 sec

    • Start Time: 2020-07-29T08:57:50.261+0000

    • log

Log output

Expand to view the last 100 lines of log output

[2020-07-29T09:45:05.057Z]   inflating: /var/lib/jenkins/workspace/Beats_beats_PR-19974/bin/terraform  
[2020-07-29T09:45:05.057Z] + rm /var/lib/jenkins/workspace/Beats_beats_PR-19974/bin/terraform.zip
[2020-07-29T09:45:05.057Z] + chmod +x /var/lib/jenkins/workspace/Beats_beats_PR-19974/bin/terraform
[2020-07-29T09:45:05.413Z] + make mage
[2020-07-29T09:45:05.413Z] Installing mage v1.10.0.
[2020-07-29T09:45:06.357Z] go: downloading github.com/magefile/mage v1.10.0
[2020-07-29T09:45:07.737Z] /var/lib/jenkins/workspace/Beats_beats_PR-19974/.magefile cleaned
[2020-07-29T09:45:08.071Z] + git config --get user.email
[2020-07-29T09:45:08.071Z] + [ -z  ]
[2020-07-29T09:45:08.071Z] + git config user.email beatsmachine@users.noreply.github.com
[2020-07-29T09:45:08.071Z] + git config user.name beatsmachine
[2020-07-29T09:45:08.466Z] + .ci/scripts/terraform-cleanup.sh x-pack/metricbeat
[2020-07-29T09:45:08.466Z] + DIRECTORY=x-pack/metricbeat
[2020-07-29T09:45:08.466Z] + FAILED=0
[2020-07-29T09:45:08.466Z] ++ find x-pack/metricbeat -name terraform.tfstate
[2020-07-29T09:45:08.466Z] + exit 0
[2020-07-29T09:45:08.959Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19974/src/github.com/elastic/beats
[2020-07-29T09:45:09.280Z] + find . -type f -name TEST*.xml -path */build/* -delete
[2020-07-29T09:45:09.297Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19974/src/github.com/elastic/beats/Lint
[2020-07-29T09:45:09.390Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19974/src/github.com/elastic/beats/Elastic-Agent-x-pack
[2020-07-29T09:45:09.467Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19974/src/github.com/elastic/beats/Winlogbeat-oss
[2020-07-29T09:45:09.562Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19974/src/github.com/elastic/beats/Auditbeat-crosscompile
[2020-07-29T09:45:09.640Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19974/src/github.com/elastic/beats/Dockerlogbeat
[2020-07-29T09:45:09.731Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19974/src/github.com/elastic/beats/Journalbeat-oss
[2020-07-29T09:45:09.832Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19974/src/github.com/elastic/beats/Generators-Metricbeat-Linux
[2020-07-29T09:45:09.911Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19974/src/github.com/elastic/beats/Functionbeat-x-pack
[2020-07-29T09:45:09.996Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19974/src/github.com/elastic/beats/Packetbeat-Linux
[2020-07-29T09:45:10.090Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19974/src/github.com/elastic/beats/Elastic-Agent-x-pack-Windows
[2020-07-29T09:45:10.181Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19974/src/github.com/elastic/beats/Metricbeat-OSS-Unit-tests
[2020-07-29T09:45:10.261Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19974/src/github.com/elastic/beats/Heartbeat-oss
[2020-07-29T09:45:10.340Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19974/src/github.com/elastic/beats/Auditbeat-oss-Windows
[2020-07-29T09:45:10.416Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19974/src/github.com/elastic/beats/Auditbeat-x-pack-Windows
[2020-07-29T09:45:10.493Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19974/src/github.com/elastic/beats/Winlogbeat-Windows-x-pack
[2020-07-29T09:45:10.573Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19974/src/github.com/elastic/beats/Filebeat-x-pack-Windows
[2020-07-29T09:45:10.659Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19974/src/github.com/elastic/beats/Auditbeat-oss-Linux
[2020-07-29T09:45:10.734Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19974/src/github.com/elastic/beats/Filebeat-Windows
[2020-07-29T09:45:10.809Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19974/src/github.com/elastic/beats/Libbeat-x-pack
[2020-07-29T09:45:10.886Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19974/src/github.com/elastic/beats/Metricbeat-crosscompile
[2020-07-29T09:45:10.962Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19974/src/github.com/elastic/beats/Winlogbeat-Windows
[2020-07-29T09:45:11.038Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19974/src/github.com/elastic/beats/Metricbeat-Windows
[2020-07-29T09:45:11.114Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19974/src/github.com/elastic/beats/Metricbeat-x-pack-Windows
[2020-07-29T09:45:11.193Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19974/src/github.com/elastic/beats/Packetbeat-Windows
[2020-07-29T09:45:11.268Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19974/src/github.com/elastic/beats/Heartbeat-Windows
[2020-07-29T09:45:11.343Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19974/src/github.com/elastic/beats/Functionbeat-Windows
[2020-07-29T09:45:11.425Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19974/src/github.com/elastic/beats/Generators-Beat-Linux
[2020-07-29T09:45:11.504Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19974/src/github.com/elastic/beats/Auditbeat-x-pack
[2020-07-29T09:45:11.579Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19974/src/github.com/elastic/beats/Libbeat-oss
[2020-07-29T09:45:11.668Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19974/src/github.com/elastic/beats/Filebeat-x-pack
[2020-07-29T09:45:11.744Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19974/src/github.com/elastic/beats/Filebeat-oss
[2020-07-29T09:45:11.821Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19974/src/github.com/elastic/beats/Metricbeat-OSS-Go-Integration-tests
[2020-07-29T09:45:11.913Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19974/src/github.com/elastic/beats/Metricbeat-OSS-Python-Integration-tests
[2020-07-29T09:45:11.991Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-19974/src/github.com/elastic/beats/Metricbeat-x-pack
[2020-07-29T09:45:12.347Z] + cat
[2020-07-29T09:45:12.347Z] + /usr/local/bin/runbld ./runbld-script
[2020-07-29T09:45:12.347Z] Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
[2020-07-29T09:45:17.636Z] runbld>>> runbld started
[2020-07-29T09:45:17.636Z] runbld>>> 1.6.12/f45d832f2ba0aa2722ab4ec1fda8ad140f027f8b
[2020-07-29T09:45:19.546Z] runbld>>> The following profiles matched the job 'Beats/beats/PR-19974' in order of occurrence in the config (last value wins).
[2020-07-29T09:45:20.932Z] runbld>>> Debug logging enabled.
[2020-07-29T09:45:20.932Z] runbld>>> Storing result
[2020-07-29T09:45:20.932Z] runbld>>> Store result: created {:total 2, :successful 2, :failed 0} 1
[2020-07-29T09:45:20.932Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1587637540455/t/20200729094520-687B5674
[2020-07-29T09:45:20.932Z] runbld>>> Adding system facts.
[2020-07-29T09:45:21.879Z] runbld>>> Adding vcs info for the latest commit:  5f7f518724a45d7be2f578d13b10a47bfdca211f
[2020-07-29T09:45:21.879Z] runbld>>> >>>>>>>>>>>> SCRIPT EXECUTION BEGIN >>>>>>>>>>>>
[2020-07-29T09:45:21.879Z] runbld>>> Adding /usr/lib/jvm/java-8-openjdk-amd64/bin to the path.
[2020-07-29T09:45:21.879Z] Processing JUnit reports with runbld...
[2020-07-29T09:45:21.879Z] + echo 'Processing JUnit reports with runbld...'
[2020-07-29T09:45:22.449Z] runbld>>> <<<<<<<<<<<< SCRIPT EXECUTION END <<<<<<<<<<<<
[2020-07-29T09:45:22.449Z] runbld>>> DURATION: 20ms
[2020-07-29T09:45:22.449Z] runbld>>> STDOUT: 40 bytes
[2020-07-29T09:45:22.449Z] runbld>>> STDERR: 49 bytes
[2020-07-29T09:45:22.449Z] runbld>>> WRAPPED PROCESS: SUCCESS (0)
[2020-07-29T09:45:22.449Z] runbld>>> Searching for build metadata in /var/lib/jenkins/workspace/Beats_beats_PR-19974/src/github.com/elastic/beats
[2020-07-29T09:45:23.390Z] runbld>>> Storing build metadata: 
[2020-07-29T09:45:23.390Z] runbld>>> Adding test report.
[2020-07-29T09:45:23.390Z] runbld>>> Searching for junit test output files with the pattern: TEST-.*\.xml$ in: /var/lib/jenkins/workspace/Beats_beats_PR-19974/src/github.com/elastic/beats
[2020-07-29T09:45:24.330Z] runbld>>> Found 118 test output files
[2020-07-29T09:45:24.902Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-19974/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-openmetrics.xml
[2020-07-29T09:45:24.902Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-19974/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-iis.xml
[2020-07-29T09:45:25.163Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-19974/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-istio.xml
[2020-07-29T09:45:25.163Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-19974/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-tomcat.xml
[2020-07-29T09:45:25.163Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-19974/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-activemq.xml
[2020-07-29T09:45:25.163Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-19974/src/github.com/elastic/beats/Metricbeat-OSS-Go-Integration-tests/metricbeat/build/TEST-go-integration-graphite.xml
[2020-07-29T09:45:25.163Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-19974/src/github.com/elastic/beats/Metricbeat-OSS-Go-Integration-tests/metricbeat/build/TEST-go-integration-windows.xml
[2020-07-29T09:45:27.074Z] runbld>>> Test output logs contained: Errors: 0 Failures: 14 Tests: 15537 Skipped: 1124
[2020-07-29T09:45:27.074Z] runbld>>> Storing result
[2020-07-29T09:45:27.074Z] runbld>>> FAILURES: 14
[2020-07-29T09:45:29.614Z] runbld>>> Store result: updated {:total 2, :successful 2, :failed 0} 2
[2020-07-29T09:45:29.614Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1587637540455/t/20200729094520-687B5674
[2020-07-29T09:45:29.874Z] runbld>>> Email notification disabled by environment variable.
[2020-07-29T09:45:29.874Z] runbld>>> Slack notification disabled by environment variable.
[2020-07-29T09:45:35.447Z] Running on worker-395930 in /var/lib/jenkins/workspace/Beats_beats_PR-19974
[2020-07-29T09:45:35.560Z] [INFO] getVaultSecret: Getting secrets
[2020-07-29T09:45:35.650Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID
[2020-07-29T09:45:37.761Z] + chmod 755 generate-build-data.sh
[2020-07-29T09:45:37.762Z] + ./generate-build-data.sh https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-19974/ https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-19974/runs/11 FAILURE 4207643
[2020-07-29T09:45:37.762Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-19974/runs/11/steps/?limit=10000 -o steps-info.json
[2020-07-29T09:45:40.055Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-19974/runs/11/tests/?status=FAILED -o tests-errors.json
[2020-07-29T09:45:41.528Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-19974/runs/11/log/ -o pipeline-log.txt

@ChrsMark
Copy link
Member

Test failure looks related: https://travis-ci.org/github/elastic/beats/jobs/709358439#L703

@vjsamuel vjsamuel force-pushed the fix_node_metricset_restarts branch from 57af22b to bfc2c5c Compare July 20, 2020 08:00
@vjsamuel
Copy link
Contributor Author

@ChrsMark , fixed. DeepEqual is required and not DeepDerivate. It would fail in a scenario where Annotations are empty on one of the objects as DeepDerivate ignores empty fields. Please check if this breaks other places where this is being used.

newCopy.ResourceVersion = ""

// If the old object and new object are different in either meta or spec then there is a valid change
fmt.Println(equality.Semantic.DeepDerivative(oldCopy.Spec, newCopy.Spec), equality.Semantic.DeepDerivative(oldCopy.ObjectMeta, newCopy.ObjectMeta))
Copy link
Contributor

Choose a reason for hiding this comment

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

spurious Println

Copy link
Contributor Author

Choose a reason for hiding this comment

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

apologies. removing

@@ -123,7 +125,8 @@ func NewWatcher(client kubernetes.Interface, resource Resource, opts WatchOption
new, _ := accessor.ResourceVersion(n.(runtime.Object))

// Only enqueue changes that have a different resource versions to avoid processing resyncs.
if old != new {
// Also if there is a registered function to check for updates, use it to check for updates.
if old != new && opts.IsUpdated != nil && opts.IsUpdated(o, n) {
Copy link
Contributor

Choose a reason for hiding this comment

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

isUpdated will be nil for all other resources (Pod, Service...), so this will never be true for them.

Perhaps we should have a default isUpdated function, when the option is not present that does just the old != new check?

@vjsamuel vjsamuel force-pushed the fix_node_metricset_restarts branch from bfc2c5c to ba464e1 Compare July 20, 2020 18:12
@exekias
Copy link
Contributor

exekias commented Jul 21, 2020

jenkins run the tests

Copy link
Member

@ChrsMark ChrsMark left a comment

Choose a reason for hiding this comment

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

lgtm! thanks @vjsamuel!
There is a conflict in changelog we need to fix.

@vjsamuel
Copy link
Contributor Author

@ChrsMark
Copy link
Member

jenkins run the tests please

@ChrsMark
Copy link
Member

Failing tests seem unrelated, merging.

Thanks for contributing this @vjsamuel !

@ChrsMark ChrsMark merged commit 06f05ca into elastic:master Jul 29, 2020
ChrsMark pushed a commit to ChrsMark/beats that referenced this pull request Jul 29, 2020
ChrsMark added a commit that referenced this pull request Jul 29, 2020
…er (#19974) (#20310)

(cherry picked from commit 06f05ca)

Co-authored-by: Vijay Samuel <vjsamuel@ebay.com>
v1v added a commit to v1v/beats that referenced this pull request Jul 30, 2020
…ne-2.0

* upstream/master: (29 commits)
  Add an explicit system test for processes on unix systems (elastic#20320)
  [Autodiscovery] Ignore ErrInputNotFinished errors in autodiscover config checks (elastic#20305)
  [CI] Update README.md with CI references (elastic#20316)
  Add ECK doc links to Heartbeat docs (elastic#20284)
  [Filebeat] Add export tests to x-pack/filebeat (elastic#20156)
  feat(ci): support building docker images for PRs (elastic#20323)
  Update system tests dependency (elastic#20287)
  [Libbeat] Log debug message if the Kibana dashboard can not be imported from the archive (elastic#12211) (elastic#20150)
  [Filebeat][Gsuite] Transform all dates to timestamp with processor (elastic#20308)
  Infer types in Prometheus remote_write (elastic#19944)
  Remove unnecessary restarts of metricsets while using Node autodiscover (elastic#19974)
  docs: update changelog on master branch (elastic#20259)
  feat(ci): support storing artifacts for PRs in separate dirs (elastic#20282)
  [CI] Change upstream reference (elastic#20296)
  [Filebeat] Updates to Suricata module (elastic#20220)
  [docs] Fix Windows download link for agent (elastic#20258)
  [docs] Rename release highlights to what's new (elastic#20255)
  fix: update the display name of the multibranch job (elastic#20265)
  [Elastic Agent] Add basic protocol to control Elastic Agent. (elastic#20146)
  Cisco ASA: Fix message 106100 (elastic#20245)
  ...
melchiormoulin pushed a commit to melchiormoulin/beats that referenced this pull request Oct 14, 2020
@zube zube bot removed the [zube]: Done label Oct 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Platforms Label for the Integrations - Platforms team v7.10.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants