-
Notifications
You must be signed in to change notification settings - Fork 554
in_process_exporter_metrics: Add documentation for process_exporter_metrics #1198
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
Merged
patrick-stephens
merged 18 commits into
master
from
cosmo0920-add-process-exporter-metrics
Dec 1, 2023
Merged
Changes from 13 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
8eba943
in_process_exporter_metrics: Add documentation for process_exporter_m…
cosmo0920 672bcaf
Explain the detail of process level of metrics
cosmo0920 312fa29
Clearify meanings of the sentence
cosmo0920 8acb9aa
Simplify the description of scrape_interval parameter
cosmo0920 b7d5d54
Separate sentence to review easily
cosmo0920 8f8968b
Use 2.2 version of fluent-bit on command line example
cosmo0920 eca6687
Clearify measings of the sentence for enhancements
cosmo0920 58e0119
Simplify the sentence
cosmo0920 bb8d385
Remove a needless sysfs mount
cosmo0920 0c992c3
Use readonly option on docker commandline
cosmo0920 70ad3c2
Add more descriptions for procfs and macOS is not supported
cosmo0920 d8e0738
Clarify read-only to be enough
cosmo0920 6cad96e
Fix incorrect descriptions of regex parameters
cosmo0920 41420d4
Clarify the behavior of metrics type of events in pipelines
cosmo0920 005bc41
in_process_exporter_metrics: Add descriptions for metrics parameter a…
cosmo0920 dba5f86
Clarify the sentence meaning
cosmo0920 a88027a
Explain why this plugin won't work on macOS clearly
cosmo0920 28fc64b
Remove environment variable related arugment for simplicity
cosmo0920 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| --- | ||
| description: >- | ||
| A plugin based on Process Exporter to collect process level of metrics of system | ||
| metrics | ||
| --- | ||
|
|
||
| # Process Exporter Metrics | ||
|
|
||
| [Prometheus Node Exporter](https://github.com/prometheus/node_exporter) is a popular way to collect system level metrics from operating systems, such as CPU / Disk / Network / Process statistics. | ||
| Fluent Bit 2.2 onwards includes a process exporter plugin that builds off the Prometheus design to collect process level metrics without having to manage two separate processes or agents. | ||
|
|
||
| The Process Exporter Metrics plugin implements collecting of the various metrics available from [the 3rd party implementation of Prometheus Process Exporter](https://github.com/ncabatoff/process-exporter) and these will be expanded over time as needed. | ||
|
|
||
| **Important note:** Metrics collected with Process Exporter Metrics flow through a separate pipeline from logs and current filters do not operate on top of metrics. | ||
|
|
||
| This plugin is only supported on Linux based operating systems due to heavily relying on proc filesystem. | ||
|
cosmo0920 marked this conversation as resolved.
Outdated
|
||
|
|
||
| macOS does not have procfs. Therefore, this plugin won't work for it. | ||
|
cosmo0920 marked this conversation as resolved.
Outdated
|
||
|
|
||
|
|
||
| ## Configuration | ||
|
|
||
| | Key | Description | Default | | ||
| | ------------------------- | -------------------------------------------------------------------------------------- | --------- | | ||
| | scrape_interval | The rate at which metrics are collected. | 5 seconds | | ||
| | path.procfs | The mount point used to collect process information and metrics. Read-only is enough | /proc/ | | ||
| | process\_include\_pattern | regex to determine which names of processes are included in the metrics produced by this plugin | It is applied for all process unless explicitly set. Default is `.+`. | | ||
|
patrick-stephens marked this conversation as resolved.
|
||
| | process\_exclude\_pattern | regex to determine which names of processes are excluded in the metrics produced by this plugin | It is not applied unless explicitly set. Default is `NULL`. | | ||
|
|
||
| ## Getting Started | ||
|
|
||
| ### Simple Configuration File | ||
|
|
||
| In the following configuration file, the input plugin _process\_exporter\_metrics collects _metrics every 2 seconds and exposes them through our [Prometheus Exporter](../outputs/prometheus-exporter.md) output plugin on HTTP/TCP port 2021. | ||
|
|
||
| ``` | ||
| # Process Exporter Metrics + Prometheus Exporter | ||
| # ------------------------------------------- | ||
| # The following example collect host metrics on Linux and expose | ||
| # them through a Prometheus HTTP end-point. | ||
| # | ||
| # After starting the service try it with: | ||
| # | ||
| # $ curl http://127.0.0.1:2021/metrics | ||
| # | ||
| [SERVICE] | ||
| flush 1 | ||
| log_level info | ||
|
|
||
| [INPUT] | ||
| name process_exporter_metrics | ||
| tag process_metrics | ||
| scrape_interval 2 | ||
|
|
||
| [OUTPUT] | ||
| name prometheus_exporter | ||
| match process_metrics | ||
| host 0.0.0.0 | ||
| port 2021 | ||
| ``` | ||
|
|
||
| You can see the metrics by using _curl:_ | ||
|
|
||
| ```bash | ||
| curl http://127.0.0.1:2021/metrics | ||
| ``` | ||
|
|
||
| ### Container to Collect Host Metrics | ||
|
|
||
| When deploying Fluent Bit in a container you will need to specify additional settings to ensure that Fluent Bit has access to the process details. | ||
| The following `docker` command deploys Fluent Bit with a specific mount path for `procfs` and settings enabled to ensure that Fluent Bit can collect from the host. | ||
| These are then exposed over port 2021. | ||
|
|
||
| ``` | ||
| docker run -ti -v /proc:/host/proc:ro \ | ||
| -p 2021:2021 \ | ||
| fluent/fluent-bit:2.2 \ | ||
| /fluent-bit/bin/fluent-bit \ | ||
| -i process_exporter_metrics -p path.procfs=/host/proc \ | ||
| -o prometheus_exporter -p "add_label=host $HOSTNAME" \ | ||
|
cosmo0920 marked this conversation as resolved.
Outdated
|
||
| -f 1 | ||
| ``` | ||
|
|
||
| ## Enhancement Requests | ||
|
|
||
| Development prioritises a subset of the available collectors in the [the 3rd party implementation of Prometheus Process Exporter](https://github.com/ncabatoff/process-exporter), to request others please open a Github issue by using the following template:\ | ||
| \ | ||
| \- [in_process_exporter_metrics](https://github.com/fluent/fluent-bit/issues/new?assignees=\&labels=\&template=feature_request.md\&title=in_process_exporter_metrics:%20add%20ABC%20collector) | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.