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

Add more ECS fields to logs #25998

Merged
merged 4 commits into from
Jun 11, 2021
Merged

Add more ECS fields to logs #25998

merged 4 commits into from
Jun 11, 2021

Conversation

jalvz
Copy link
Contributor

@jalvz jalvz commented May 29, 2021

What does this PR do?

Adds service.name and event.dataset fields to ECS logs

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.

How to test this PR locally

Start a beat with default settings, both with and without -e, and see the implemented fields in the logs.

Related issues

Closes #25997

@jalvz jalvz requested review from axw and a team May 29, 2021 19:03
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label May 29, 2021
@jalvz jalvz added the Team:apm APM Server team issues/PRs label May 29, 2021
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label May 29, 2021
@elasticmachine
Copy link
Collaborator

elasticmachine commented May 29, 2021

💔 Tests Failed

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: Started by user kaiyan-sheng

  • Start Time: 2021-06-03T23:00:47.222+0000

  • Duration: 93 min 52 sec

  • Commit: dc00e08

Test stats 🧪

Test Results
Failed 1
Passed 47332
Skipped 5244
Total 52577

Trends 🧪

Image of Build Times

Image of Tests

Test errors 1

Expand to view the tests failures

Extended / heartbeat-windows-7-32-windows-7-32-bit / TestQueueRunsInOrder – github.com/elastic/beats/v7/heartbeat/scheduler/timerqueue
    Expand to view the error details

     Failed 
    

    Expand to view the stacktrace

     === RUN   TestQueueRunsInOrder
    coverage: 81.4% of statements
    panic: test timed out after 10m0s
    
    goroutine 105 [running]:
    testing.(*M).startAlarm.func1()
    	C:/Users/jenkins/workspace/PR-25998-8-5339f7b2-56eb-40bb-b4f1-eb72d047ef3a/.gvm/versions/go1.16.4.windows.386/src/testing/testing.go:1700 +0xcb
    created by time.goFunc
    	C:/Users/jenkins/workspace/PR-25998-8-5339f7b2-56eb-40bb-b4f1-eb72d047ef3a/.gvm/versions/go1.16.4.windows.386/src/time/sleep.go:180 +0x37
    
    goroutine 1 [chan receive]:
    testing.(*T).Run(0x11030fc0, 0x5a4e6a, 0x14, 0x5b3e34, 0xf)
    	C:/Users/jenkins/workspace/PR-25998-8-5339f7b2-56eb-40bb-b4f1-eb72d047ef3a/.gvm/versions/go1.16.4.windows.386/src/testing/testing.go:1239 +0x239
    testing.runTests.func1(0x11030ee0)
    	C:/Users/jenkins/workspace/PR-25998-8-5339f7b2-56eb-40bb-b4f1-eb72d047ef3a/.gvm/versions/go1.16.4.windows.386/src/testing/testing.go:1511 +0x5a
    testing.tRunner(0x11030ee0, 0x1105bed0)
    	C:/Users/jenkins/workspace/PR-25998-8-5339f7b2-56eb-40bb-b4f1-eb72d047ef3a/.gvm/versions/go1.16.4.windows.386/src/testing/testing.go:1193 +0xc5
    testing.runTests(0x110042c0, 0x6d7980, 0x2, 0x2, 0xd315ac6c, 0xc0267b02, 0xb2f62425, 0x8b, 0x6dc8a0, 0x5)
    	C:/Users/jenkins/workspace/PR-25998-8-5339f7b2-56eb-40bb-b4f1-eb72d047ef3a/.gvm/versions/go1.16.4.windows.386/src/testing/testing.go:1509 +0x25a
    testing.(*M).Run(0x11100190, 0x0)
    	C:/Users/jenkins/workspace/PR-25998-8-5339f7b2-56eb-40bb-b4f1-eb72d047ef3a/.gvm/versions/go1.16.4.windows.386/src/testing/testing.go:1417 +0x178
    main.main()
    	_testmain.go:97 +0x162
    
    goroutine 6 [chan receive]:
    github.com/elastic/beats/v7/heartbeat/scheduler/timerqueue.testQueueRunsInOrderOnce(0x11030fc0)
    	C:/Users/jenkins/workspace/PR-25998-8-5339f7b2-56eb-40bb-b4f1-eb72d047ef3a/src/github.com/elastic/beats/heartbeat/scheduler/timerqueue/queue_test.go:79 +0x199
    github.com/elastic/beats/v7/heartbeat/scheduler/timerqueue.TestQueueRunsInOrder(0x11030fc0)
    	C:/Users/jenkins/workspace/PR-25998-8-5339f7b2-56eb-40bb-b4f1-eb72d047ef3a/src/github.com/elastic/beats/heartbeat/scheduler/timerqueue/queue_test.go:33 +0x29
    testing.tRunner(0x11030fc0, 0x5b3e34)
    	C:/Users/jenkins/workspace/PR-25998-8-5339f7b2-56eb-40bb-b4f1-eb72d047ef3a/.gvm/versions/go1.16.4.windows.386/src/testing/testing.go:1193 +0xc5
    created by testing.(*T).Run
    	C:/Users/jenkins/workspace/PR-25998-8-5339f7b2-56eb-40bb-b4f1-eb72d047ef3a/.gvm/versions/go1.16.4.windows.386/src/testing/testing.go:1238 +0x21a
    
    goroutine 139 [runnable]:
    github.com/elastic/beats/v7/heartbeat/scheduler/timerqueue.(*TimerQueue).Start.func1(0x11184820)
    	C:/Users/jenkins/workspace/PR-25998-8-5339f7b2-56eb-40bb-b4f1-eb72d047ef3a/src/github.com/elastic/beats/heartbeat/scheduler/timerqueue/queue.go:74 +0x10a
    created by github.com/elastic/beats/v7/heartbeat/scheduler/timerqueue.(*TimerQueue).Start
    	C:/Users/jenkins/workspace/PR-25998-8-5339f7b2-56eb-40bb-b4f1-eb72d047ef3a/src/github.com/elastic/beats/heartbeat/scheduler/timerqueue/queue.go:72 +0x49
    
    goroutine 143 [runnable]:
    github.com/elastic/beats/v7/heartbeat/scheduler/timerqueue.(*TimerQueue).Start.func1(0x11184960)
    	C:/Users/jenkins/workspace/PR-25998-8-5339f7b2-56eb-40bb-b4f1-eb72d047ef3a/src/github.com/elastic/beats/heartbeat/scheduler/timerqueue/queue.go:74 +0x10a
    created by github.com/elastic/beats/v7/heartbeat/scheduler/timerqueue.(*TimerQueue).Start
    	C:/Users/jenkins/workspace/PR-25998-8-5339f7b2-56eb-40bb-b4f1-eb72d047ef3a/src/github.com/elastic/beats/heartbeat/scheduler/timerqueue/queue.go:72 +0x49
    
    goroutine 145 [runnable]:
    github.com/elastic/beats/v7/heartbeat/scheduler/timerqueue.(*TimerQueue).Start.func1(0x11184a00)
    	C:/Users/jenkins/workspace/PR-25998-8-5339f7b2-56eb-40bb-b4f1-eb72d047ef3a/src/github.com/elastic/beats/heartbeat/scheduler/timerqueue/queue.go:74 +0x10a
    created by github.com/elastic/beats/v7/heartbeat/scheduler/timerqueue.(*TimerQueue).Start
    	C:/Users/jenkins/workspace/PR-25998-8-5339f7b2-56eb-40bb-b4f1-eb72d047ef3a/src/github.com/elastic/beats/heartbeat/scheduler/timerqueue/queue.go:72 +0x49
    
    goroutine 179 [select]:
    github.com/elastic/beats/v7/heartbeat/scheduler/timerqueue.(*TimerQueue).Start.func1(0x11184aa0)
    	C:/Users/jenkins/workspace/PR-25998-8-5339f7b2-56eb-40bb-b4f1-eb72d047ef3a/src/github.com/elastic/beats/heartbeat/scheduler/timerqueue/queue.go:74 +0x10a
    created by github.com/elastic/beats/v7/heartbeat/scheduler/timerqueue.(*TimerQueue).Start
    	C:/Users/jenkins/workspace/PR-25998-8-5339f7b2-56eb-40bb-b4f1-eb72d047ef3a/src/github.com/elastic/beats/heartbeat/scheduler/timerqueue/queue.go:72 +0x49
    
    goroutine 180 [runnable]:
    github.com/elastic/beats/v7/heartbeat/scheduler/timerqueue.(*TimerQueue).Start.func1.1(0x11187fc0, 0xa, 0x10, 0xd3ac1b5c, 0xc0267b02, 0xb3050a99, 0x8b, 0x6dc8a0)
    	C:/Users/jenkins/workspace/PR-25998-8-5339f7b2-56eb-40bb-b4f1-eb72d047ef3a/src/github.com/elastic/beats/heartbeat/scheduler/timerqueue/queue.go:82
    created by github.com/elastic/beats/v7/heartbeat/scheduler/timerqueue.(*TimerQueue).Start.func1
    	C:/Users/jenkins/workspace/PR-25998-8-5339f7b2-56eb-40bb-b4f1-eb72d047ef3a/src/github.com/elastic/beats/heartbeat/scheduler/timerqueue/queue.go:82 +0x19c
     
    

Steps errors 3

Expand to view the steps failures

heartbeat-windows-7-32-windows-7-32-bit - mage build unitTest
  • Took 11 min 27 sec . View more details on here
  • Description: mage build unitTest
gsutil -m -q cp -a public-read test-build-artifacts-heartbeat-windows-7-32-windows-7-32-bit-tgz gs:/
  • Took 0 min 2 sec . View more details on here
  • Description: @echo off gsutil -m -q cp -a public-read test-build-artifacts-heartbeat-windows-7-32-windows-7-32-bit-tgz gs://beats-ci-temp/Beats/beats/PR-25998-8
Error signal
  • Took 0 min 0 sec . View more details on here
  • Description: Error 'hudson.AbortException: script returned exit code 1'

Log output

Expand to view the last 100 lines of log output

[2021-06-04T00:32:20.775Z] 	C:/Users/jenkins/workspace/PR-25998-8-5339f7b2-56eb-40bb-b4f1-eb72d047ef3a/.gvm/versions/go1.16.4.windows.386/src/testing/testing.go:1417 +0x178
[2021-06-04T00:32:20.775Z] main.main()
[2021-06-04T00:32:20.775Z] 	_testmain.go:97 +0x162
[2021-06-04T00:32:20.775Z] 
[2021-06-04T00:32:20.775Z] goroutine 6 [chan receive]:
[2021-06-04T00:32:20.775Z] github.com/elastic/beats/v7/heartbeat/scheduler/timerqueue.testQueueRunsInOrderOnce(0x11030fc0)
[2021-06-04T00:32:20.775Z] 	C:/Users/jenkins/workspace/PR-25998-8-5339f7b2-56eb-40bb-b4f1-eb72d047ef3a/src/github.com/elastic/beats/heartbeat/scheduler/timerqueue/queue_test.go:79 +0x199
[2021-06-04T00:32:20.775Z] github.com/elastic/beats/v7/heartbeat/scheduler/timerqueue.TestQueueRunsInOrder(0x11030fc0)
[2021-06-04T00:32:20.775Z] 	C:/Users/jenkins/workspace/PR-25998-8-5339f7b2-56eb-40bb-b4f1-eb72d047ef3a/src/github.com/elastic/beats/heartbeat/scheduler/timerqueue/queue_test.go:33 +0x29
[2021-06-04T00:32:20.775Z] testing.tRunner(0x11030fc0, 0x5b3e34)
[2021-06-04T00:32:20.775Z] 	C:/Users/jenkins/workspace/PR-25998-8-5339f7b2-56eb-40bb-b4f1-eb72d047ef3a/.gvm/versions/go1.16.4.windows.386/src/testing/testing.go:1193 +0xc5
[2021-06-04T00:32:20.775Z] created by testing.(*T).Run
[2021-06-04T00:32:20.775Z] 	C:/Users/jenkins/workspace/PR-25998-8-5339f7b2-56eb-40bb-b4f1-eb72d047ef3a/.gvm/versions/go1.16.4.windows.386/src/testing/testing.go:1238 +0x21a
[2021-06-04T00:32:20.775Z] 
[2021-06-04T00:32:20.775Z] goroutine 139 [runnable]:
[2021-06-04T00:32:20.775Z] github.com/elastic/beats/v7/heartbeat/scheduler/timerqueue.(*TimerQueue).Start.func1(0x11184820)
[2021-06-04T00:32:20.775Z] 	C:/Users/jenkins/workspace/PR-25998-8-5339f7b2-56eb-40bb-b4f1-eb72d047ef3a/src/github.com/elastic/beats/heartbeat/scheduler/timerqueue/queue.go:74 +0x10a
[2021-06-04T00:32:20.775Z] created by github.com/elastic/beats/v7/heartbeat/scheduler/timerqueue.(*TimerQueue).Start
[2021-06-04T00:32:20.775Z] 	C:/Users/jenkins/workspace/PR-25998-8-5339f7b2-56eb-40bb-b4f1-eb72d047ef3a/src/github.com/elastic/beats/heartbeat/scheduler/timerqueue/queue.go:72 +0x49
[2021-06-04T00:32:20.775Z] 
[2021-06-04T00:32:20.775Z] goroutine 143 [runnable]:
[2021-06-04T00:32:20.775Z] github.com/elastic/beats/v7/heartbeat/scheduler/timerqueue.(*TimerQueue).Start.func1(0x11184960)
[2021-06-04T00:32:20.775Z] 	C:/Users/jenkins/workspace/PR-25998-8-5339f7b2-56eb-40bb-b4f1-eb72d047ef3a/src/github.com/elastic/beats/heartbeat/scheduler/timerqueue/queue.go:74 +0x10a
[2021-06-04T00:32:20.775Z] created by github.com/elastic/beats/v7/heartbeat/scheduler/timerqueue.(*TimerQueue).Start
[2021-06-04T00:32:20.775Z] 	C:/Users/jenkins/workspace/PR-25998-8-5339f7b2-56eb-40bb-b4f1-eb72d047ef3a/src/github.com/elastic/beats/heartbeat/scheduler/timerqueue/queue.go:72 +0x49
[2021-06-04T00:32:20.775Z] 
[2021-06-04T00:32:20.775Z] goroutine 145 [runnable]:
[2021-06-04T00:32:20.775Z] github.com/elastic/beats/v7/heartbeat/scheduler/timerqueue.(*TimerQueue).Start.func1(0x11184a00)
[2021-06-04T00:32:20.775Z] 	C:/Users/jenkins/workspace/PR-25998-8-5339f7b2-56eb-40bb-b4f1-eb72d047ef3a/src/github.com/elastic/beats/heartbeat/scheduler/timerqueue/queue.go:74 +0x10a
[2021-06-04T00:32:20.775Z] created by github.com/elastic/beats/v7/heartbeat/scheduler/timerqueue.(*TimerQueue).Start
[2021-06-04T00:32:20.775Z] 	C:/Users/jenkins/workspace/PR-25998-8-5339f7b2-56eb-40bb-b4f1-eb72d047ef3a/src/github.com/elastic/beats/heartbeat/scheduler/timerqueue/queue.go:72 +0x49
[2021-06-04T00:32:20.775Z] 
[2021-06-04T00:32:20.775Z] goroutine 179 [select]:
[2021-06-04T00:32:20.775Z] github.com/elastic/beats/v7/heartbeat/scheduler/timerqueue.(*TimerQueue).Start.func1(0x11184aa0)
[2021-06-04T00:32:20.775Z] 	C:/Users/jenkins/workspace/PR-25998-8-5339f7b2-56eb-40bb-b4f1-eb72d047ef3a/src/github.com/elastic/beats/heartbeat/scheduler/timerqueue/queue.go:74 +0x10a
[2021-06-04T00:32:20.775Z] created by github.com/elastic/beats/v7/heartbeat/scheduler/timerqueue.(*TimerQueue).Start
[2021-06-04T00:32:20.775Z] 	C:/Users/jenkins/workspace/PR-25998-8-5339f7b2-56eb-40bb-b4f1-eb72d047ef3a/src/github.com/elastic/beats/heartbeat/scheduler/timerqueue/queue.go:72 +0x49
[2021-06-04T00:32:20.775Z] 
[2021-06-04T00:32:20.775Z] goroutine 180 [runnable]:
[2021-06-04T00:32:20.775Z] github.com/elastic/beats/v7/heartbeat/scheduler/timerqueue.(*TimerQueue).Start.func1.1(0x11187fc0, 0xa, 0x10, 0xd3ac1b5c, 0xc0267b02, 0xb3050a99, 0x8b, 0x6dc8a0)
[2021-06-04T00:32:20.775Z] 	C:/Users/jenkins/workspace/PR-25998-8-5339f7b2-56eb-40bb-b4f1-eb72d047ef3a/src/github.com/elastic/beats/heartbeat/scheduler/timerqueue/queue.go:82
[2021-06-04T00:32:20.775Z] created by github.com/elastic/beats/v7/heartbeat/scheduler/timerqueue.(*TimerQueue).Start.func1
[2021-06-04T00:32:20.775Z] 	C:/Users/jenkins/workspace/PR-25998-8-5339f7b2-56eb-40bb-b4f1-eb72d047ef3a/src/github.com/elastic/beats/heartbeat/scheduler/timerqueue/queue.go:82 +0x19c
[2021-06-04T00:32:20.775Z] 
[2021-06-04T00:32:20.775Z] DONE 304 tests, 6 skipped, 1 failure in 629.748s
[2021-06-04T00:32:20.775Z] Error: go test returned a non-zero value: exit status 1
[2021-06-04T00:32:21.140Z] 
[2021-06-04T00:32:21.140Z] C:\Users\jenkins\workspace\PR-25998-8-5339f7b2-56eb-40bb-b4f1-eb72d047ef3a\src\github.com\elastic\beats>FOR / %d IN ("ve") DO @IF EXIST "%d" rmdir /s /q "%d" 
[2021-06-04T00:32:23.355Z] 
[2021-06-04T00:32:23.355Z] C:\Users\jenkins\workspace\PR-25998-8-5339f7b2-56eb-40bb-b4f1-eb72d047ef3a\src\github.com\elastic\beats>python .ci/scripts/pre_archive_test.py 
[2021-06-04T00:32:24.295Z] Copy .\heartbeat\build into build\heartbeat\build
[2021-06-04T00:32:24.309Z] Running in C:\Users\jenkins\workspace\PR-25998-8-5339f7b2-56eb-40bb-b4f1-eb72d047ef3a\src\github.com\elastic\beats\build
[2021-06-04T00:32:24.327Z] Recording test results
[2021-06-04T00:32:29.166Z] [Checks API] No suitable checks publisher found.
[2021-06-04T00:32:29.495Z] 
[2021-06-04T00:32:29.495Z] C:\Users\jenkins\workspace\PR-25998-8-5339f7b2-56eb-40bb-b4f1-eb72d047ef3a\src\github.com\elastic\beats\build>tar --version  1>NUL 
[2021-06-04T00:32:29.495Z] 'tar' is not recognized as an internal or external command,
[2021-06-04T00:32:29.495Z] operable program or batch file.
[2021-06-04T00:32:29.830Z] 
[2021-06-04T00:32:29.830Z] C:\Users\jenkins\workspace\PR-25998-8-5339f7b2-56eb-40bb-b4f1-eb72d047ef3a\src\github.com\elastic\beats\build>7z   1>NUL 
[2021-06-04T00:32:30.153Z] 
[2021-06-04T00:32:30.153Z] C:\Users\jenkins\workspace\PR-25998-8-5339f7b2-56eb-40bb-b4f1-eb72d047ef3a\src\github.com\elastic\beats\build>7z a -ttar -so -an .   | 7z a -si test-build-artifacts-heartbeat-windows-7-32-windows-7-32-bit-tgz 
[2021-06-04T00:32:30.153Z] 
[2021-06-04T00:32:30.153Z] 7-Zip 19.00 (x86) : Copyright (c) 1999-2018 Igor Pavlov : 2019-02-21
[2021-06-04T00:32:30.153Z] 
[2021-06-04T00:32:30.153Z] Creating archive: test-build-artifacts-heartbeat-windows-7-32-windows-7-32-bit-tgz.7z
[2021-06-04T00:32:30.153Z] 
[2021-06-04T00:32:30.153Z] Add new data to archive: 1 file
[2021-06-04T00:32:30.153Z] 
[2021-06-04T00:32:30.153Z] 
[2021-06-04T00:32:30.153Z] Files read from disk: 1
[2021-06-04T00:32:30.153Z] Archive size: 25098 bytes (25 KiB)
[2021-06-04T00:32:30.153Z] Everything is Ok
[2021-06-04T00:32:30.544Z] 
[2021-06-04T00:32:30.544Z] C:\Users\jenkins\workspace\PR-25998-8-5339f7b2-56eb-40bb-b4f1-eb72d047ef3a\src\github.com\elastic\beats\build>gsutil --version  1>NUL 
[2021-06-04T00:32:32.256Z] + gsutil --version
[2021-06-04T00:32:33.671Z] Masking supported pattern matches of $FILE_CREDENTIAL
[2021-06-04T00:32:33.979Z] + gcloud auth activate-service-account --key-file ****
[2021-06-04T00:32:34.547Z] Activated service account credentials for: [beats-ci-gcs-plugin@elastic-ci-prod.iam.gserviceaccount.com]
[2021-06-04T00:32:35.118Z] + gsutil -m -q cp -a public-read bWV0cmljYmVhdC13aW5kb3dzLTEwLXdpbmRvd3MtMTBkYzAwZTA4OGVkNDQxZmNhYWNhYWNkNzQxNzQ0N2RiZWJmN2NlMzIx gs://beats-ci-temp/ci/cache/
[2021-06-04T00:32:35.857Z] Masking supported pattern matches of %FILE_CREDENTIAL%
[2021-06-04T00:32:36.618Z] 
[2021-06-04T00:32:36.618Z] C:\Users\jenkins\workspace\PR-25998-8-5339f7b2-56eb-40bb-b4f1-eb72d047ef3a\src\github.com\elastic\beats\build>gcloud auth activate-service-account --key-file **** 
[2021-06-04T00:32:38.001Z] Activated service account credentials for: [beats-ci-gcs-plugin@elastic-ci-prod.iam.gserviceaccount.com]
[2021-06-04T00:32:39.977Z] CommandException: No URLs matched: test-build-artifacts-heartbeat-windows-7-32-windows-7-32-bit-tgz
[2021-06-04T00:32:39.977Z] CommandException: 1 file/object could not be transferred.
[2021-06-04T00:32:40.055Z] ERROR: script returned exit code 1
[2021-06-04T00:32:40.394Z] 
[2021-06-04T00:32:40.395Z] C:\Users\jenkins\workspace\PR-25998-8-5339f7b2-56eb-40bb-b4f1-eb72d047ef3a\src\github.com\elastic\beats>go clean -modcache 
[2021-06-04T00:33:37.957Z] Failed in branch heartbeat-windows-7-32-windows-7-32-bit
[2021-06-04T00:33:38.048Z] Stage "Packaging" skipped due to earlier failure(s)
[2021-06-04T00:33:38.093Z] Stage "Packaging-Pipeline" skipped due to earlier failure(s)
[2021-06-04T00:33:38.162Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-25998/src/github.com/elastic/beats
[2021-06-04T00:33:38.464Z] Running on Jenkins in /var/lib/jenkins/workspace/Beats_beats_PR-25998
[2021-06-04T00:33:38.512Z] [INFO] getVaultSecret: Getting secrets
[2021-06-04T00:33:38.552Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID
[2021-06-04T00:33:39.269Z] + chmod 755 generate-build-data.sh
[2021-06-04T00:33:39.269Z] + ./generate-build-data.sh https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-25998/ https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-25998/runs/8 FAILURE 5571785
[2021-06-04T00:33:39.269Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-25998/runs/8/steps/?limit=10000 -o steps-info.json
[2021-06-04T00:33:49.144Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-25998/runs/8/tests/?status=FAILED -o tests-errors.json

🐛 Flaky test report

❕ There are test failures but not known flaky tests.

Expand to view the summary

Test stats 🧪

Test Results
Failed 1
Passed 47332
Skipped 5244
Total 52577

Genuine test errors 1

💔 There are test failures but not known flaky tests, most likely a genuine test failure.

  • Name: Extended / heartbeat-windows-7-32-windows-7-32-bit / TestQueueRunsInOrder – github.com/elastic/beats/v7/heartbeat/scheduler/timerqueue

Copy link
Member

@axw axw left a comment

Choose a reason for hiding this comment

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

Short and sweet! Only thing I'm not keen on is the change to libbeat/logp/configure. That change means logp requires logp/configure to have been called, which I think is the wrong way around.

libbeat/logp/core.go Show resolved Hide resolved
@@ -196,6 +196,13 @@ func makeOptions(cfg Config) []zap.Option {
if cfg.development {
options = append(options, zap.Development())
}
if cfg.ECSEnabled {
fields := []zap.Field{zap.String("service.name", cfg.Beat)}
if cfg.Files.Name != "" {
Copy link
Member

Choose a reason for hiding this comment

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

I see why this works, but it looks wrong to me since we should add event.dataset for non-file logging output. How about we introduce a new function in this package like

// logFilename returns the base filename to which logs will be written for
// the "files" log output. If another log output is used, or `logging.files.name`
// is unspecified, then the beat name will be returned.
func logFilename(cfg Config) string {
    name := cfg.Beat
    if cfg.Files.Name != "" {
        name = cfg.Files.Name
    }
    return name
}

Then you can use that here and in makeFileOutput, and revert the configure.Logging.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we should add event.dataset for non-file logging output

I don't get that. If the output is eg. stderr what should be the value of event.dataset?

Copy link
Member

Choose a reason for hiding this comment

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

See #25997 and https://github.com/elastic/ecs-logging/blob/9507c12f7523741cc06f84a2686d580e50f3465f/spec/spec.json#L79-L95

If the user manually configures the service name, the logging library should set event.dataset=${service.name}.log if not explicitly configured otherwise.

@jalvz jalvz requested a review from axw June 1, 2021 07:50
Copy link
Member

@axw axw 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! Would be good to add a test.

@urso
Copy link

urso commented Jun 1, 2021

Would be good to add a test.

+1

There are unfortunately not many tests on logp, but as we start to add fields dynamically on user config it would be nice to introduce tests that check expected fields to be set.

@jalvz jalvz added backport-v7.14.0 Automated backport with mergify v7.14.0 labels Jun 1, 2021
@jalvz
Copy link
Contributor Author

jalvz commented Jun 1, 2021

jenkins retest this please

@jalvz
Copy link
Contributor Author

jalvz commented Jun 2, 2021

@urso any idea how can i merge this? the metricbeat-windows-10 tests have been stuck for +10 hours 2 times... or do you think is related to these changes?

@jalvz
Copy link
Contributor Author

jalvz commented Jun 2, 2021

jenkins retest this please

@jalvz
Copy link
Contributor Author

jalvz commented Jun 3, 2021

jenkins retest this please

@jalvz
Copy link
Contributor Author

jalvz commented Jun 3, 2021

@urso this failed 6 times with 5 different flaky tests :/
Can I merge this via command line?

@urso
Copy link

urso commented Jun 4, 2021

Can I merge this via command line?

Sorry, no. We never manually push to master or other release branches. Teams regularly working on Beats can still overwrite the checks in the UI and merge if there is need.

The heartbeat one that failed is new. I'm not aware of it failing and the flaky test checker doesn't seem to know about the failed test either. Maybe some really bad timing or infra problems with windows 7, or a genuine back introduced lately... Regarding Heartbeat there is no real change besides Beats moving to 1.16. But during the migration to 1.16 we already have had to skip some other tests in metricbeat and heartbeat. See #25859

I'm okay to merge this PR for you, but can you please create an issue with the stack trace and skip the test that fails. Maybe @andrewvc might need to have a look.

@jalvz
Copy link
Contributor Author

jalvz commented Jun 8, 2021

I'm okay to merge this PR for you

That would be great, thanks.

I filed #26203, #26203, #26205.

Those are the panics, all on different test runs. There were some other timeouts, I can open issues for those if you want as well.

@urso urso merged commit bfbadaa into elastic:master Jun 11, 2021
@urso
Copy link

urso commented Jun 11, 2021

Merged. The backport PR will be assigned to you. Feel free to ping me if you have any problems with the backport.

mergify bot pushed a commit that referenced this pull request Jun 11, 2021
(cherry picked from commit bfbadaa)
urso pushed a commit that referenced this pull request Jun 16, 2021
(cherry picked from commit bfbadaa)

Co-authored-by: Juan Álvarez <juan.alvarez@elastic.co>
mdelapenya added a commit to mdelapenya/beats that referenced this pull request Jun 21, 2021
* master: (26 commits)
  Report total and free CPU for vSphere virtual machines (elastic#26167)
  [filebeat] Add preserve_original_event option to o365audit input (elastic#26273)
  Change xml processor names in script processor to match convention (elastic#26263)
  [Oracle] Fixing default values for paths in config template (elastic#26276)
  Add more ECS fields to logs (elastic#25998)
  [Heartbeat] Fix broken invocation of synth package (elastic#26228)
  rename sqs file name (elastic#26227)
  Populate the agent action result if there is no matching action handlers (elastic#26152)
  Add ISO8601 as supported timestamp type (elastic#25564)
  Move Filebeat azure module to GA (elastic#26168)
  Filebeat azure module pipeline fixes and changes (elastic#26148)
  libbeat: monitor version (elastic#26214)
  Add new parser to filestream input: container (elastic#26115)
  [Metricbeat] Add state_statefulset replicas.ready (elastic#26088)
  Disable test processors system test for windows 10 (elastic#26216)
  Fix startup with failing configuration (elastic#26126)
  Remove 32 bits version of Elastic Agent. (elastic#25708)
  Chane fleetmode detection to ony use management.enabled (elastic#26180)
  Make `filestream` input GA (elastic#26127)
  libbeat/idxmgmt/ilm: fix alias creation (elastic#26146)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v7.14.0 Automated backport with mergify enhancement Team:apm APM Server team issues/PRs v7.14.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set service.name and event.dataset in logs
4 participants