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

Cherry-pick #20149 to 7.x: Call host parser only once when building light metricsets #20189

Merged
merged 1 commit into from
Jul 24, 2020

Conversation

jsoriano
Copy link
Member

@jsoriano jsoriano commented Jul 23, 2020

Cherry-pick of PR #20149 to 7.x branch. Original message:

What does this PR do?

Call host parser only once on Metricbeat light modules.

Why is it important?

When using light modules, host parser is called twice. First by the actual implementation
of the metricset, and second after adding the configuration defined in the light module
manifest. Second call might be missing data as the original host is modified after the first
call, causing problems as the ones described in #16205 and #19849.

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 (Covered by tests from Fix: don't miss address scheme #16205).
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

How to test this PR locally

  • There should be no changes in addresses included in metricbeat events, check specially on modules using custom host parsers as the sql ones.
  • Check that steps described in Lightweight modules parses hosts twice #19849 don't cause any issue.

Related issues

Use cases

  • Implement light modules based on native modules with custom host parsers.

)

When using light modules, host parser is called twice. First by the actual implementation
of the metricset, and second after adding the configuration defined in the light module
manifest. Second call might be missing data as the original host is modified after the first
call, causing problems.

This change disables host parser in the registration created for light modules, and makes
only the "second call" inside the factory.

It also removes previous fix for URLs as it shouldn't be needed anymore.

(cherry picked from commit 6c82292)
@jsoriano jsoriano added [zube]: In Review backport Team:Services (Deprecated) Label for the former Integrations-Services team labels Jul 23, 2020
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jul 23, 2020
@elasticmachine
Copy link
Collaborator

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

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jul 23, 2020
@elasticmachine
Copy link
Collaborator

elasticmachine commented Jul 23, 2020

💔 Tests Failed

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [jsoriano commented: jenkins run the tests please again :crossed_fingers: ]

  • Start Time: 2020-07-23T18:30:23.126+0000

  • Duration: 105 min 6 sec

Test stats 🧪

Test Results
Failed 13
Passed 3968
Skipped 877
Total 4858

Test errors

Expand to view the tests failures

  • Name: Build and Test / Auditbeat x-pack / test_connected_udp_ipv4 – test_system_socket.Test

    • Age: 1
    • Duration: 60.067
    • 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.061
    • 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.067
    • 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.058
    • 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.058
    • 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.059
    • 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.052
    • 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.055
    • 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.054
    • 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.055
    • 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.061
    • 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.056
    • 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.056
    • 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: 23 min 54 sec

    • Start Time: 2020-07-23T18:56:39.504+0000

    • log

Log output

Expand to view the last 100 lines of log output

[2020-07-23T20:14:39.628Z] + FILE=libbeat/build/coverage/full.cov
[2020-07-23T20:14:39.628Z] + '[' -f libbeat/build/coverage/full.cov ']'
[2020-07-23T20:14:39.628Z] + for i in '"$@"'
[2020-07-23T20:14:39.628Z] + FILE=metricbeat/build/coverage/full.cov
[2020-07-23T20:14:39.628Z] + '[' -f metricbeat/build/coverage/full.cov ']'
[2020-07-23T20:14:39.628Z] + for i in '"$@"'
[2020-07-23T20:14:39.628Z] + FILE=packetbeat/build/coverage/full.cov
[2020-07-23T20:14:39.628Z] + '[' -f packetbeat/build/coverage/full.cov ']'
[2020-07-23T20:14:39.628Z] + for i in '"$@"'
[2020-07-23T20:14:39.628Z] + FILE=winlogbeat/build/coverage/full.cov
[2020-07-23T20:14:39.628Z] + '[' -f winlogbeat/build/coverage/full.cov ']'
[2020-07-23T20:14:40.975Z] Post stage
[2020-07-23T20:14:40.987Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20189/src/github.com/elastic/beats
[2020-07-23T20:14:41.812Z] Starting "default"...
[2020-07-23T20:14:41.812Z] Machine "default" is already running.
[2020-07-23T20:14:43.303Z] Error checking TLS connection: Error checking and/or regenerating the certs: There was an error validating certificates for host "192.168.99.101:2376": dial tcp 192.168.99.101:2376: connect: connection refused
[2020-07-23T20:14:43.304Z] You can attempt to regenerate them using 'docker-machine regenerate-certs [name]'.
[2020-07-23T20:14:43.304Z] Be advised that this will trigger a Docker daemon restart which might stop running containers.
[2020-07-23T20:14:43.304Z] 
[2020-07-23T20:14:43.449Z] Client: Docker Engine - Community
[2020-07-23T20:14:43.449Z]  Version:           19.03.1
[2020-07-23T20:14:43.449Z]  API version:       1.40
[2020-07-23T20:14:43.449Z]  Go version:        go1.12.5
[2020-07-23T20:14:43.449Z]  Git commit:        74b1e89
[2020-07-23T20:14:43.449Z]  Built:             Thu Jul 25 21:18:17 2019
[2020-07-23T20:14:43.449Z]  OS/Arch:           darwin/amd64
[2020-07-23T20:14:43.449Z]  Experimental:      false
[2020-07-23T20:14:43.449Z] Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
[2020-07-23T20:14:43.449Z] It requires Docker daemon to be installed and running
[2020-07-23T20:15:01.813Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20189/src/github.com/elastic/beats
[2020-07-23T20:15:02.127Z] + find . -type f -name TEST*.xml -path */build/* -delete
[2020-07-23T20:15:02.140Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20189/src/github.com/elastic/beats/Lint
[2020-07-23T20:15:02.230Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20189/src/github.com/elastic/beats/Auditbeat-crosscompile
[2020-07-23T20:15:02.308Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20189/src/github.com/elastic/beats/Generators-Metricbeat-Linux
[2020-07-23T20:15:02.385Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20189/src/github.com/elastic/beats/Metricbeat-OSS-Unit-tests
[2020-07-23T20:15:02.465Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20189/src/github.com/elastic/beats/Metricbeat-crosscompile
[2020-07-23T20:15:02.546Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20189/src/github.com/elastic/beats/Auditbeat-x-pack-Windows
[2020-07-23T20:15:02.637Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20189/src/github.com/elastic/beats/Auditbeat-oss-Windows
[2020-07-23T20:15:02.743Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20189/src/github.com/elastic/beats/Auditbeat-oss-Linux
[2020-07-23T20:15:02.823Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20189/src/github.com/elastic/beats/Metricbeat-Windows
[2020-07-23T20:15:02.908Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20189/src/github.com/elastic/beats/Metricbeat-x-pack-Windows
[2020-07-23T20:15:03.011Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20189/src/github.com/elastic/beats/Generators-Beat-Linux
[2020-07-23T20:15:03.094Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20189/src/github.com/elastic/beats/Auditbeat-x-pack
[2020-07-23T20:15:03.183Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20189/src/github.com/elastic/beats/Auditbeat-x-pack-Mac-OS-X
[2020-07-23T20:15:03.264Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20189/src/github.com/elastic/beats/Metricbeat-Mac-OS-X
[2020-07-23T20:15:03.347Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20189/src/github.com/elastic/beats/Metricbeat-x-pack-Mac-OS-X
[2020-07-23T20:15:03.436Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20189/src/github.com/elastic/beats/Auditbeat-oss-Mac-OS-X
[2020-07-23T20:15:03.520Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20189/src/github.com/elastic/beats/Metricbeat-Python-integration-tests
[2020-07-23T20:15:03.666Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20189/src/github.com/elastic/beats/Metricbeat-x-pack
[2020-07-23T20:15:03.748Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20189/src/github.com/elastic/beats/Metricbeat-OSS-Integration-tests
[2020-07-23T20:15:03.839Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20189/src/github.com/elastic/beats/Generators-Metricbeat-Mac-OS-X
[2020-07-23T20:15:03.916Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20189/src/github.com/elastic/beats/Generators-Beat-Mac-OS-X
[2020-07-23T20:15:04.279Z] + cat
[2020-07-23T20:15:04.279Z] + /usr/local/bin/runbld ./runbld-script
[2020-07-23T20:15:04.279Z] Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
[2020-07-23T20:15:10.882Z] runbld>>> runbld started
[2020-07-23T20:15:10.882Z] runbld>>> 1.6.12/f45d832f2ba0aa2722ab4ec1fda8ad140f027f8b
[2020-07-23T20:15:13.431Z] runbld>>> The following profiles matched the job 'Beats/beats/PR-20189' in order of occurrence in the config (last value wins).
[2020-07-23T20:15:14.382Z] runbld>>> Debug logging enabled.
[2020-07-23T20:15:14.382Z] runbld>>> Storing result
[2020-07-23T20:15:14.644Z] runbld>>> Store result: created {:total 2, :successful 2, :failed 0} 1
[2020-07-23T20:15:14.644Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1587637540455/t/20200723201514-8647C110
[2020-07-23T20:15:14.644Z] runbld>>> Adding system facts.
[2020-07-23T20:15:16.054Z] runbld>>> Adding vcs info for the latest commit:  3fa49961673586284424c3dfa8a9793138f7e11d
[2020-07-23T20:15:16.054Z] runbld>>> >>>>>>>>>>>> SCRIPT EXECUTION BEGIN >>>>>>>>>>>>
[2020-07-23T20:15:16.054Z] runbld>>> Adding /usr/lib/jvm/java-8-openjdk-amd64/bin to the path.
[2020-07-23T20:15:16.054Z] Processing JUnit reports with runbld...
[2020-07-23T20:15:16.054Z] + echo 'Processing JUnit reports with runbld...'
[2020-07-23T20:15:16.318Z] runbld>>> <<<<<<<<<<<< SCRIPT EXECUTION END <<<<<<<<<<<<
[2020-07-23T20:15:16.318Z] runbld>>> DURATION: 28ms
[2020-07-23T20:15:16.318Z] runbld>>> STDOUT: 40 bytes
[2020-07-23T20:15:16.318Z] runbld>>> STDERR: 49 bytes
[2020-07-23T20:15:16.318Z] runbld>>> WRAPPED PROCESS: SUCCESS (0)
[2020-07-23T20:15:16.318Z] runbld>>> Searching for build metadata in /var/lib/jenkins/workspace/Beats_beats_PR-20189/src/github.com/elastic/beats
[2020-07-23T20:15:17.268Z] runbld>>> Storing build metadata: 
[2020-07-23T20:15:17.268Z] runbld>>> Adding test report.
[2020-07-23T20:15:17.268Z] runbld>>> Searching for junit test output files with the pattern: TEST-.*\.xml$ in: /var/lib/jenkins/workspace/Beats_beats_PR-20189/src/github.com/elastic/beats
[2020-07-23T20:15:18.230Z] runbld>>> Found 86 test output files
[2020-07-23T20:15:18.808Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-20189/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-istio.xml
[2020-07-23T20:15:18.808Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-20189/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-openmetrics.xml
[2020-07-23T20:15:18.808Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-20189/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-tomcat.xml
[2020-07-23T20:15:18.808Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-20189/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-activemq.xml
[2020-07-23T20:15:18.808Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-20189/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-iis.xml
[2020-07-23T20:15:19.069Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-20189/src/github.com/elastic/beats/Metricbeat-OSS-Integration-tests/metricbeat/build/TEST-go-integration-graphite.xml
[2020-07-23T20:15:19.069Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats_PR-20189/src/github.com/elastic/beats/Metricbeat-OSS-Integration-tests/metricbeat/build/TEST-go-integration-windows.xml
[2020-07-23T20:15:19.641Z] runbld>>> Test output logs contained: Errors: 0 Failures: 13 Tests: 4858 Skipped: 669
[2020-07-23T20:15:19.902Z] runbld>>> Storing result
[2020-07-23T20:15:19.902Z] runbld>>> FAILURES: 13
[2020-07-23T20:15:22.450Z] runbld>>> Store result: updated {:total 2, :successful 2, :failed 0} 2
[2020-07-23T20:15:22.450Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1587637540455/t/20200723201514-8647C110
[2020-07-23T20:15:22.450Z] runbld>>> Email notification disabled by environment variable.
[2020-07-23T20:15:22.450Z] runbld>>> Slack notification disabled by environment variable.
[2020-07-23T20:15:28.034Z] Running on Jenkins in /var/lib/jenkins/workspace/Beats_beats_PR-20189
[2020-07-23T20:15:28.188Z] [INFO] getVaultSecret: Getting secrets
[2020-07-23T20:15:28.286Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID
[2020-07-23T20:15:29.328Z] + chmod 755 generate-build-data.sh
[2020-07-23T20:15:29.328Z] + ./generate-build-data.sh https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-20189/ https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-20189/runs/3 FAILURE 6305943
[2020-07-23T20:15:29.328Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-20189/runs/3/steps/?limit=10000 -o steps-info.json
[2020-07-23T20:15:30.671Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-20189/runs/3/tests/?status=FAILED -o tests-errors.json
[2020-07-23T20:15:31.222Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-20189/runs/3/log/ -o pipeline-log.txt

@jsoriano
Copy link
Member Author

jenkins run the tests please

1 similar comment
@jsoriano
Copy link
Member Author

jenkins run the tests please

@jsoriano
Copy link
Member Author

jenkins run the tests please again 🤞

@jsoriano jsoriano merged commit 462e79d into elastic:7.x Jul 24, 2020
@jsoriano jsoriano deleted the backport_20149_7.x branch July 24, 2020 11:11
@zube zube bot removed the [zube]: Done label Oct 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Team:Services (Deprecated) Label for the former Integrations-Services team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants