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

Check ephemeral ID of every Beat #74

Merged
merged 2 commits into from
Mar 12, 2018

Conversation

kvch
Copy link
Contributor

@kvch kvch commented Mar 12, 2018

This PR includes assertions which check if a Beat has an ephemeral ID in its monitoring event.
If a Beat has an ephemeral ID, it can be shown in XPack Monitoring. (It's still possible that some metrics are not available, due to the lack of CGO.)

Required by elastic/beats#6501

- name: 'Get {{ beat_name }} metrics from logs'
shell: 'grep "Total non-zero metrics" {{ beat_log_file }} | tail -1'
register: log_metrics
when: ansible_system != "Win32NT"
Copy link
Member

Choose a reason for hiding this comment

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

You can omit these checks because common really means POSIX. So this file never gets used on Windows.


- name: 'Check {{ beat_name }} has ephemeral ID'
assert:
that: "log_metrics_event.monitoring.metrics.beat.info.ephemeral_id"
Copy link
Member

Choose a reason for hiding this comment

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

I think this should also be checking for process cpu/mem/uptime, system load, and system cpu. On Windows, do the same but assert that system load does not exist.

select-string -Encoding UTF8 "Total non-zero" |
Select -Expandproperty Line | select -First 1'
register: log_metrics_win
when: ansible_system == "Win32NT"
Copy link
Member

Choose a reason for hiding this comment

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

You can omit this check because this file is only included on win32nt.

Copy link
Member

@andrewkroh andrewkroh left a comment

Choose a reason for hiding this comment

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

LGTM.

@andrewkroh andrewkroh merged commit 975d7fb into elastic:master Mar 12, 2018
@andrewkroh
Copy link
Member

By adding these tests we discovered an issue where Packetbeat is not exiting cleanly on three Linux versions (ubuntu-1604, awslinux, and opensuse) and this causes these new tests to fail. I opened an issue for Packetbeat, but the solution isn't clear yet. elastic/beats#6535

@andrewkroh
Copy link
Member

@kvch Some of the checks for metrics are failing. I think it is because zero values are filtered by the logging code (it logs "non-zero" metrics only).

I think a more reliable way to verify these metrics would be to fetch the full set of metrics using the HTTP endpoint.

  • We can update the configs to start the metrics endpoint (http.host: localhost).
  • Fetch the JSON data over HTTP and write it to disk by adding a get_url or win_get_url to here, here, and here.
  • Run the assertions you added on this downloaded JSON file.
  • Copy this file to the host machine so that it's archived and available for debugging. here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants