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 #19944 to 7.x: Infer types in Prometheus remote_write #20314

Merged
merged 1 commit into from
Jul 29, 2020

Conversation

ChrsMark
Copy link
Member

@ChrsMark ChrsMark commented Jul 29, 2020

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

This PR add types for Prometheus metrics that are collected via remote_write metricset.
These metrics are in raw format when received so a heuristic approach is applied to extract types from metrics' name patterns.

Closes #17675.

TODOs

  • Implementation
  • Tests
  • Update docs

How to test this PR

Env setup

Use https://github.com/ChrsMark/docker-prometheus-playground for a ready to use prometheus env.
For remote write this config is needed: https://github.com/ChrsMark/docker-prometheus-playground/blob/master/prometheus/prometheus.yml#L10
If using a darwin machine the following should be enough:

remote_write:
- url: "http://host.docker.internal:9201/write"

On linux machines in order to access host from within the Prometheus container one can set network_mode: host in the docker-compose.yml and then host can be reach using 0.0.0.0.

Testing

  1. Use oss version and test collector and remote_write (without types) metricsets for regressions.
  2. Use basic version and test collector (with types) for regressions.
  3. Use basic version and test that remote_write metricset:
    a. uses types as expected.
    b. can identify types based on input patterns: https://github.com/elastic/beats/pull/19944/files?file-filters%5B%5D=.asciidoc#diff-b69e84fad87eb2ae563115f43675a547R118

@ChrsMark ChrsMark added [zube]: In Review backport Team:Platforms Label for the Integrations - Platforms team labels Jul 29, 2020
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jul 29, 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 29, 2020
@elasticmachine
Copy link
Collaborator

💔 Tests Failed

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #20314 opened]

  • Start Time: 2020-07-29T13:20:31.410+0000

  • Duration: 60 min 20 sec

Test stats 🧪

Test Results
Failed 1
Passed 2918
Skipped 674
Total 3593

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.337
    • Error Details: False is not true : fd not found in any process events

Steps errors

Expand to view the steps failures

  • Name: Mage build unitTest
    • Description: mage build unitTest

    • Duration: 9 min 3 sec

    • Start Time: 2020-07-29T13:47:05.472+0000

    • log

Log output

Expand to view the last 100 lines of log output

[2020-07-29T14:20:02.157Z] + tar --exclude=x-pack-metricbeat--system-tests-darwin.tgz -czf x-pack-metricbeat--system-tests-darwin.tgz build/x-pack/metricbeat/build/system-tests
[2020-07-29T14:20:02.369Z] Archiving artifacts
[2020-07-29T14:20:03.678Z] + .ci/scripts/report-codecov.sh auditbeat filebeat heartbeat journalbeat libbeat metricbeat packetbeat winlogbeat
[2020-07-29T14:20:03.678Z] + CODECOV_URL=https://codecov.io/bash
[2020-07-29T14:20:03.678Z] + '[' -e /usr/local/bin/bash_standard_lib.sh ']'
[2020-07-29T14:20:03.678Z] + curl -sSLo codecov https://codecov.io/bash
[2020-07-29T14:20:04.126Z] + for i in '"$@"'
[2020-07-29T14:20:04.126Z] + FILE=auditbeat/build/coverage/full.cov
[2020-07-29T14:20:04.126Z] + '[' -f auditbeat/build/coverage/full.cov ']'
[2020-07-29T14:20:04.126Z] + for i in '"$@"'
[2020-07-29T14:20:04.126Z] + FILE=filebeat/build/coverage/full.cov
[2020-07-29T14:20:04.126Z] + '[' -f filebeat/build/coverage/full.cov ']'
[2020-07-29T14:20:04.126Z] + for i in '"$@"'
[2020-07-29T14:20:04.126Z] + FILE=heartbeat/build/coverage/full.cov
[2020-07-29T14:20:04.126Z] + '[' -f heartbeat/build/coverage/full.cov ']'
[2020-07-29T14:20:04.126Z] + for i in '"$@"'
[2020-07-29T14:20:04.126Z] + FILE=journalbeat/build/coverage/full.cov
[2020-07-29T14:20:04.126Z] + '[' -f journalbeat/build/coverage/full.cov ']'
[2020-07-29T14:20:04.126Z] + for i in '"$@"'
[2020-07-29T14:20:04.126Z] + FILE=libbeat/build/coverage/full.cov
[2020-07-29T14:20:04.126Z] + '[' -f libbeat/build/coverage/full.cov ']'
[2020-07-29T14:20:04.126Z] + for i in '"$@"'
[2020-07-29T14:20:04.126Z] + FILE=metricbeat/build/coverage/full.cov
[2020-07-29T14:20:04.126Z] + '[' -f metricbeat/build/coverage/full.cov ']'
[2020-07-29T14:20:04.126Z] + for i in '"$@"'
[2020-07-29T14:20:04.126Z] + FILE=packetbeat/build/coverage/full.cov
[2020-07-29T14:20:04.126Z] + '[' -f packetbeat/build/coverage/full.cov ']'
[2020-07-29T14:20:04.126Z] + for i in '"$@"'
[2020-07-29T14:20:04.126Z] + FILE=winlogbeat/build/coverage/full.cov
[2020-07-29T14:20:04.126Z] + '[' -f winlogbeat/build/coverage/full.cov ']'
[2020-07-29T14:20:05.625Z] Post stage
[2020-07-29T14:20:05.644Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20314/src/github.com/elastic/beats
[2020-07-29T14:20:06.498Z] Starting "default"...
[2020-07-29T14:20:06.498Z] Machine "default" is already running.
[2020-07-29T14:20:08.625Z] 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-29T14:20:08.625Z] You can attempt to regenerate them using 'docker-machine regenerate-certs [name]'.
[2020-07-29T14:20:08.625Z] Be advised that this will trigger a Docker daemon restart which might stop running containers.
[2020-07-29T14:20:08.625Z] 
[2020-07-29T14:20:08.625Z] Client: Docker Engine - Community
[2020-07-29T14:20:08.625Z]  Version:           19.03.1
[2020-07-29T14:20:08.625Z]  API version:       1.40
[2020-07-29T14:20:08.625Z]  Go version:        go1.12.5
[2020-07-29T14:20:08.625Z]  Git commit:        74b1e89
[2020-07-29T14:20:08.625Z]  Built:             Thu Jul 25 21:18:17 2019
[2020-07-29T14:20:08.625Z]  OS/Arch:           darwin/amd64
[2020-07-29T14:20:08.625Z]  Experimental:      false
[2020-07-29T14:20:08.625Z] Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
[2020-07-29T14:20:08.625Z] It requires Docker daemon to be installed and running
[2020-07-29T14:20:26.054Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20314/src/github.com/elastic/beats
[2020-07-29T14:20:26.394Z] + find . -type f -name TEST*.xml -path */build/* -delete
[2020-07-29T14:20:26.424Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20314/src/github.com/elastic/beats/Lint
[2020-07-29T14:20:26.605Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20314/src/github.com/elastic/beats/Metricbeat-OSS-Go-Integration-tests
[2020-07-29T14:20:26.775Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20314/src/github.com/elastic/beats/Metricbeat-OSS-Python-Integration-tests
[2020-07-29T14:20:26.936Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20314/src/github.com/elastic/beats/Metricbeat-OSS-Unit-tests
[2020-07-29T14:20:27.089Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20314/src/github.com/elastic/beats/Metricbeat-crosscompile
[2020-07-29T14:20:27.242Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20314/src/github.com/elastic/beats/Metricbeat-x-pack
[2020-07-29T14:20:27.407Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20314/src/github.com/elastic/beats/Metricbeat-Windows
[2020-07-29T14:20:27.708Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20314/src/github.com/elastic/beats/Metricbeat-x-pack-Windows
[2020-07-29T14:20:27.980Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20314/src/github.com/elastic/beats/Metricbeat-Mac-OS-X
[2020-07-29T14:20:28.275Z] Running in /var/lib/jenkins/workspace/Beats_beats_PR-20314/src/github.com/elastic/beats/Metricbeat-x-pack-Mac-OS-X
[2020-07-29T14:20:29.163Z] + cat
[2020-07-29T14:20:29.164Z] + /usr/local/bin/runbld ./runbld-script
[2020-07-29T14:20:29.164Z] Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
[2020-07-29T14:20:35.776Z] runbld>>> runbld started
[2020-07-29T14:20:35.776Z] runbld>>> 1.6.12/f45d832f2ba0aa2722ab4ec1fda8ad140f027f8b
[2020-07-29T14:20:37.835Z] runbld>>> The following profiles matched the job 'Beats/beats/PR-20314' in order of occurrence in the config (last value wins).
[2020-07-29T14:20:39.228Z] runbld>>> Debug logging enabled.
[2020-07-29T14:20:39.228Z] runbld>>> Storing result
[2020-07-29T14:20:39.228Z] runbld>>> Store result: created {:total 2, :successful 2, :failed 0} 1
[2020-07-29T14:20:39.228Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1587637540455/t/20200729142038-F1E6D1E7
[2020-07-29T14:20:39.228Z] runbld>>> Adding system facts.
[2020-07-29T14:20:40.618Z] runbld>>> Adding vcs info for the latest commit:  823346b22fe9713565fde11321bc1cd3e28845f0
[2020-07-29T14:20:40.618Z] runbld>>> >>>>>>>>>>>> SCRIPT EXECUTION BEGIN >>>>>>>>>>>>
[2020-07-29T14:20:40.618Z] runbld>>> Adding /usr/lib/jvm/java-8-openjdk-amd64/bin to the path.
[2020-07-29T14:20:40.618Z] + echo 'Processing JUnit reports with runbld...'
[2020-07-29T14:20:40.619Z] Processing JUnit reports with runbld...
[2020-07-29T14:20:40.880Z] runbld>>> <<<<<<<<<<<< SCRIPT EXECUTION END <<<<<<<<<<<<
[2020-07-29T14:20:40.880Z] runbld>>> DURATION: 39ms
[2020-07-29T14:20:40.880Z] runbld>>> STDOUT: 40 bytes
[2020-07-29T14:20:40.880Z] runbld>>> STDERR: 49 bytes
[2020-07-29T14:20:40.880Z] runbld>>> WRAPPED PROCESS: SUCCESS (0)
[2020-07-29T14:20:40.880Z] runbld>>> Searching for build metadata in /var/lib/jenkins/workspace/Beats_beats_PR-20314/src/github.com/elastic/beats
[2020-07-29T14:20:41.825Z] runbld>>> Storing build metadata: 
[2020-07-29T14:20:41.825Z] runbld>>> Adding test report.
[2020-07-29T14:20:41.825Z] runbld>>> Searching for junit test output files with the pattern: TEST-.*\.xml$ in: /var/lib/jenkins/workspace/Beats_beats_PR-20314/src/github.com/elastic/beats
[2020-07-29T14:20:42.770Z] runbld>>> Found 15 test output files
[2020-07-29T14:20:43.713Z] runbld>>> Test output logs contained: Errors: 0 Failures: 1 Tests: 3593 Skipped: 597
[2020-07-29T14:20:43.994Z] runbld>>> Storing result
[2020-07-29T14:20:43.994Z] runbld>>> FAILURES: 1
[2020-07-29T14:20:44.256Z] runbld>>> Store result: updated {:total 2, :successful 2, :failed 0} 2
[2020-07-29T14:20:44.256Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1587637540455/t/20200729142038-F1E6D1E7
[2020-07-29T14:20:44.517Z] runbld>>> Email notification disabled by environment variable.
[2020-07-29T14:20:44.517Z] runbld>>> Slack notification disabled by environment variable.
[2020-07-29T14:20:50.135Z] Running on Jenkins in /var/lib/jenkins/workspace/Beats_beats_PR-20314
[2020-07-29T14:20:50.323Z] [INFO] getVaultSecret: Getting secrets
[2020-07-29T14:20:50.403Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID
[2020-07-29T14:20:51.467Z] + chmod 755 generate-build-data.sh
[2020-07-29T14:20:51.467Z] + ./generate-build-data.sh https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-20314/ https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-20314/runs/1 FAILURE 3619786
[2020-07-29T14:20:51.467Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-20314/runs/1/steps/?limit=10000 -o steps-info.json
[2020-07-29T14:20:52.378Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats/PR-20314/runs/1/tests/?status=FAILED -o tests-errors.json

@ChrsMark ChrsMark merged commit f7c59d5 into elastic:7.x Jul 29, 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
backport Team:Platforms Label for the Integrations - Platforms team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants