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 #16596 to 7.x: Add OpenMetrics Metricbeat module #16791

Merged
merged 3 commits into from
Mar 4, 2020

Conversation

ChrsMark
Copy link
Member

@ChrsMark ChrsMark commented Mar 4, 2020

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

What does this PR do?

This PR adds OpenMetrics Metricbeat module as a light module on top of Prometheus collector metricset.

Why is it important?

OpenMetrics is an effort to standardize exposing metric data based on the Prometheus exposition format. This standalone module will provide an easy and out of the box way to collect metrics from endpoints that follow this format.

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

How to test this PR locally

  1. One can use a nodexporter as an example Prometheus app to collect from. For instance this forked project should be enough: https://github.com/ChrsMark/dockprom. Download and docker-compose up. Then metrics should be exported at http://localhost:9100/metrics.
  2. Configuration:
- module: openmetrics
  metricsets: ['collector']
  period: 10s
  hosts: ['localhost:9100']

  # This module uses the Prometheus collector metricset, all
  # the options for this metricset are also available here.
  metrics_path: /metrics
  metrics_filters:
    include: ["node_filesystem_*"]
    exclude: ["node_filesystem_device_*", "^node_filesystem_readonly$"]

And expect to see only events that match node_filesystem_* but also not node_filesystem_device_* and are not node_filesystem_readonly.
3. Try to remove ^node_filesystem_readonly$ from exclude filters and see that this metric is included in events. One can try different combinations.

Related issues

@ChrsMark ChrsMark requested a review from a team as a code owner March 4, 2020 09:40
@ChrsMark ChrsMark self-assigned this Mar 4, 2020
@ChrsMark ChrsMark merged commit 7f96df1 into elastic:7.x Mar 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants