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

Handle agent configs #20913

Closed
wants to merge 12 commits into from
Closed

Conversation

andrewvc
Copy link
Contributor

@andrewvc andrewvc commented Sep 2, 2020

What does this PR do?

Adds support for Fleet/Standalone configs from Elastic agent. This assumes a single stream (per the synthetics package) and uses that for the config, preferring input.id for the ID, since this is a solid UUID from Kibana tied to a consistent saved object.

Example elastic-agent.yml:

outputs:
  default:
    type: elasticsearch
    hosts: [127.0.0.1:9200]
    username: elastic
    password: changeme

inputs:
  - id: cd8256b0-e86a-11ea-9199-e12923f35450
    name: synthetics-1
    type: synthetics/http
    use_output: default
    meta:
      package:
        name: synthetics
        version: 0.1.3
    data_stream:
      namespace: default
    streams:
      - name: fwae
        type: http
        data_stream:
          dataset: synthetics.monitor
          type: logs
        urls: feaw
        schedule: '@every 10s'

Why is it important?

Requirement for elastic/uptime#235

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

  • Check that it works with sample config and Fleet package

How to test this PR locally

Use the example config at top. Check that the following dev console command returns new docs:

GET .ds-logs-elastic.agent.heartbeat-default-000001/_search
{
  "sort": {"@timestamp": "desc"}
}

Related issues

Main Uptime Fleet issue: elastic/uptime#235

@andrewvc andrewvc added the Team:obs-ds-hosted-services Label for the Observability Hosted Services team label Sep 2, 2020
@andrewvc andrewvc requested a review from blakerouse September 2, 2020 02:14
@andrewvc andrewvc self-assigned this Sep 2, 2020
@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Sep 2, 2020
@andrewvc andrewvc added enhancement needs_team Indicates that the issue/PR needs a Team:* label labels Sep 2, 2020
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Sep 2, 2020
@botelastic
Copy link

botelastic bot commented Sep 2, 2020

This pull request doesn't have a Team:<team> label.

@elasticmachine
Copy link
Collaborator

elasticmachine commented Sep 2, 2020

💔 Build Failed

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #20913 updated]

  • Start Time: 2020-09-03T18:15:17.463+0000

  • Duration: 11 min 13 sec

Steps errors

Expand to view the steps failures

  • Name: Make check
    • Description: make check

    • Duration: 4 min 34 sec

    • Start Time: 2020-09-03T18:22:00.428+0000

    • log

Log output

Expand to view the last 100 lines of log output

[2020-09-03T18:25:41.213Z] Stage "Generators" skipped due to earlier failure(s)
[2020-09-03T18:25:42.021Z] Failed in branch Elastic Agent x-pack
[2020-09-03T18:25:42.021Z] Failed in branch Elastic Agent x-pack Windows
[2020-09-03T18:25:42.022Z] Failed in branch Elastic Agent Mac OS X
[2020-09-03T18:25:42.023Z] Failed in branch Filebeat oss
[2020-09-03T18:25:42.023Z] Failed in branch Filebeat x-pack
[2020-09-03T18:25:42.024Z] Failed in branch Filebeat Mac OS X
[2020-09-03T18:25:42.024Z] Failed in branch Filebeat x-pack Mac OS X
[2020-09-03T18:25:42.025Z] Failed in branch Filebeat Windows
[2020-09-03T18:25:42.025Z] Failed in branch Filebeat x-pack Windows
[2020-09-03T18:25:42.026Z] Failed in branch Heartbeat oss
[2020-09-03T18:25:42.026Z] Failed in branch Heartbeat Mac OS X
[2020-09-03T18:25:42.027Z] Failed in branch Heartbeat Windows
[2020-09-03T18:25:42.028Z] Failed in branch Auditbeat oss Linux
[2020-09-03T18:25:42.028Z] Failed in branch Auditbeat crosscompile
[2020-09-03T18:25:42.029Z] Failed in branch Auditbeat oss Mac OS X
[2020-09-03T18:25:42.029Z] Failed in branch Auditbeat oss Windows
[2020-09-03T18:25:42.030Z] Failed in branch Auditbeat x-pack
[2020-09-03T18:25:42.030Z] Failed in branch Auditbeat x-pack Mac OS X
[2020-09-03T18:25:42.031Z] Failed in branch Auditbeat x-pack Windows
[2020-09-03T18:25:42.032Z] Failed in branch Libbeat x-pack
[2020-09-03T18:25:42.032Z] Failed in branch Metricbeat OSS Unit tests
[2020-09-03T18:25:42.033Z] Failed in branch Metricbeat OSS Go Integration tests
[2020-09-03T18:25:42.033Z] Failed in branch Metricbeat OSS Python Integration tests
[2020-09-03T18:25:42.034Z] Failed in branch Metricbeat crosscompile
[2020-09-03T18:25:42.035Z] Failed in branch Metricbeat Mac OS X
[2020-09-03T18:25:42.035Z] Failed in branch Metricbeat x-pack Mac OS X
[2020-09-03T18:25:42.036Z] Failed in branch Metricbeat Windows
[2020-09-03T18:25:42.037Z] Failed in branch Metricbeat x-pack Windows
[2020-09-03T18:25:42.037Z] Failed in branch Packetbeat Linux
[2020-09-03T18:25:42.038Z] Failed in branch Packetbeat Mac OS X
[2020-09-03T18:25:42.039Z] Failed in branch Packetbeat Windows
[2020-09-03T18:25:42.039Z] Failed in branch dockerlogbeat
[2020-09-03T18:25:42.040Z] Failed in branch Winlogbeat oss
[2020-09-03T18:25:42.040Z] Failed in branch Winlogbeat Windows
[2020-09-03T18:25:42.041Z] Failed in branch Winlogbeat Windows x-pack
[2020-09-03T18:25:42.042Z] Failed in branch Functionbeat x-pack
[2020-09-03T18:25:42.042Z] Failed in branch Functionbeat Mac OS X x-pack
[2020-09-03T18:25:42.043Z] Failed in branch Functionbeat Windows
[2020-09-03T18:25:42.044Z] Failed in branch Journalbeat
[2020-09-03T18:25:42.044Z] Failed in branch Generators Metricbeat Mac OS X
[2020-09-03T18:25:42.045Z] Failed in branch Generators Beat Mac OS X
[2020-09-03T18:25:42.045Z] Failed in branch Kubernetes
[2020-09-03T18:25:42.153Z] Stage "Libbeat" skipped due to earlier failure(s)
[2020-09-03T18:25:42.154Z] Stage "Metricbeat x-pack" skipped due to earlier failure(s)
[2020-09-03T18:25:42.156Z] Stage "Generators" skipped due to earlier failure(s)
[2020-09-03T18:25:42.285Z] Failed in branch Metricbeat x-pack
[2020-09-03T18:25:42.285Z] Failed in branch Generators
[2020-09-03T18:25:42.307Z] Stage "Libbeat" skipped due to earlier failure(s)
[2020-09-03T18:25:42.388Z] Failed in branch Libbeat
[2020-09-03T18:25:46.004Z] [INFO] unstashV2: JOB_GCS_BUCKET is set. bucket param got precedency instead.
[2020-09-03T18:25:46.027Z] [INFO] unstashV2: JOB_GCS_CREDENTIALS is set. credentialsId param got precedency instead.
[2020-09-03T18:25:46.098Z] [Google Cloud Storage Plugin] Found 1 files to download from pattern: gs://beats-ci-temp/Beats/beats/PR-20913-7/source/source.tgz
[2020-09-03T18:25:46.117Z] [Google Cloud Storage Plugin] Downloading: Beats/beats/PR-20913-7/source/source.tgz to local path: /var/lib/jenkins/workspace/Beats_beats_PR-20913/source.tgz
[2020-09-03T18:25:59.141Z] + tar --version
[2020-09-03T18:25:59.436Z] + tar -xpf source.tgz
[2020-09-03T18:26:09.752Z] + rm source.tgz
[2020-09-03T18:26:09.764Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20913/src/github.com/elastic/beats
[2020-09-03T18:26:09.785Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20913/src/github.com/elastic/beats/Lint
[2020-09-03T18:26:10.231Z] + cat
[2020-09-03T18:26:10.231Z] + /usr/local/bin/runbld ./runbld-script --job-name elastic+beats+pull-request
[2020-09-03T18:26:10.231Z] Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
[2020-09-03T18:26:16.828Z] runbld>>> runbld started
[2020-09-03T18:26:16.828Z] runbld>>> 1.6.12/f45d832f2ba0aa2722ab4ec1fda8ad140f027f8b
[2020-09-03T18:26:18.229Z] runbld>>> The following profiles matched the job 'elastic+beats+pull-request' in order of occurrence in the config (last value wins).
[2020-09-03T18:26:18.229Z] runbld>>> Matches in the system config:
[2020-09-03T18:26:18.229Z] runbld>>> - Matched ^elastic\+beats
[2020-09-03T18:26:18.229Z] runbld>>> - Matched ^elastic\+beats\+pull-request
[2020-09-03T18:26:19.628Z] runbld>>> Debug logging enabled.
[2020-09-03T18:26:19.628Z] runbld>>> Storing result
[2020-09-03T18:26:19.628Z] runbld>>> Store result: created {:total 2, :successful 2, :failed 0} 1
[2020-09-03T18:26:19.628Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1597739501209/t/20200903182619-F2380821
[2020-09-03T18:26:19.628Z] runbld>>> Adding system facts.
[2020-09-03T18:26:21.016Z] runbld>>> Adding vcs info for the latest commit:  750cd87c9a4063671689aee8f6d4caea09e67ca9
[2020-09-03T18:26:21.016Z] runbld>>> >>>>>>>>>>>> SCRIPT EXECUTION BEGIN >>>>>>>>>>>>
[2020-09-03T18:26:21.016Z] runbld>>> Adding /usr/lib/jvm/java-8-openjdk-amd64/bin to the path.
[2020-09-03T18:26:21.016Z] + echo 'Processing JUnit reports with runbld...'
[2020-09-03T18:26:21.016Z] Processing JUnit reports with runbld...
[2020-09-03T18:26:21.276Z] runbld>>> <<<<<<<<<<<< SCRIPT EXECUTION END <<<<<<<<<<<<
[2020-09-03T18:26:21.276Z] runbld>>> DURATION: 33ms
[2020-09-03T18:26:21.276Z] runbld>>> STDOUT: 40 bytes
[2020-09-03T18:26:21.277Z] runbld>>> STDERR: 49 bytes
[2020-09-03T18:26:21.277Z] runbld>>> WRAPPED PROCESS: SUCCESS (0)
[2020-09-03T18:26:21.277Z] runbld>>> Searching for build metadata in /var/lib/jenkins/workspace/Beats_beats_PR-20913
[2020-09-03T18:26:22.220Z] runbld>>> Storing build metadata: 
[2020-09-03T18:26:22.220Z] runbld>>> Adding test report.
[2020-09-03T18:26:22.220Z] runbld>>> Searching for junit test output files with the pattern: TEST-.*\.xml$ in: /var/lib/jenkins/workspace/Beats_beats_PR-20913/src/github.com/elastic/beats
[2020-09-03T18:26:23.161Z] runbld>>> Found 0 test output files
[2020-09-03T18:26:23.161Z] runbld>>> Test output logs contained: Errors: 0 Failures: 0 Tests: 0 Skipped: 0
[2020-09-03T18:26:23.161Z] runbld>>> Storing result
[2020-09-03T18:26:23.422Z] runbld>>> Store result: updated {:total 2, :successful 2, :failed 0} 2
[2020-09-03T18:26:23.422Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1597739501209/t/20200903182619-F2380821
[2020-09-03T18:26:23.422Z] runbld>>> Email notification disabled by environment variable.
[2020-09-03T18:26:23.422Z] runbld>>> Slack notification disabled by environment variable.
[2020-09-03T18:26:29.312Z] Running on Jenkins in /var/lib/jenkins/workspace/Beats_beats_PR-20913
[2020-09-03T18:26:29.558Z] [INFO] getVaultSecret: Getting secrets
[2020-09-03T18:26:29.637Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID
[2020-09-03T18:26:30.460Z] + chmod 755 generate-build-data.sh
[2020-09-03T18:26:30.460Z] + ./generate-build-data.sh https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-20913/ https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-20913/runs/7 FAILURE 672737
[2020-09-03T18:26:30.460Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-20913/runs/7/steps/?limit=10000 -o steps-info.json

@andrewvc
Copy link
Contributor Author

Outdated, closing in favor of #20602

@andrewvc andrewvc closed this Jan 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Team:obs-ds-hosted-services Label for the Observability Hosted Services team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants