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

Text updates: prometheus/node-exporter-metrics #314

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion integrations/prometheus/node-exporter-metrics/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ to [Semantic Versioning][semver].

## Unreleased

- N/A
- Remove linux and darwin tags and subscriptions in integraton yaml
- Move labels to the subscription screen in the integration yaml
- Revise text labels and prompts in configuration modal
- Add summary for success screen in integration yaml file
- Add interval patch in integration yaml
- Add and revise setup steps and options in README
- Update reference documentation list in README

## [ 20220421.0.0 ] - 2022-04-21

Expand Down
53 changes: 40 additions & 13 deletions integrations/prometheus/node-exporter-metrics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

<!-- Sensu Integration description; supports markdown -->

The Prometheus `node_exporter` metrics monitoring integration provides metrics from hosts running the [Prometheus `node_exporter`](https://github.com/prometheus/node_exporter#readme) (Linux/macOS hosts).
The Prometheus Node Exporter Metrics integration collects metrics from Linux and macOS hosts running the [Prometheus `node_exporter`][prom-node-exp].

Use the related [Prometheus `windows_exporter`](https://github.com/prometheus-community/windows_exporter#readme) integration for Windows hosts.
**NOTE**: For Windows hosts, use Sensu's Prometheus Windows Exporter integration.

<!-- Provide a high level overview of the integration contents (e.g. checks, filters, mutators, handlers, assets, etc) -->

This integration includes the following resources:
This integration includes the following Sensu resources:

* `node-exporter-metrics` [check]
* `sensu/http-checks:0.7.0` [asset]
Expand All @@ -21,46 +21,71 @@ This integration includes the following resources:

<!-- ![](img/dashboard.png) -->

There are no compatible dashboards for this integration.
The Prometheus Node Exporter Metrics integration does not have compatible dashboards.

## Setup

<!-- Sensu Integration setup instructions, including Sensu agent configuration and external component configuration -->
<!-- EXAMPLE: what configuration (if any) is required in a third-party service to enable monitoring? -->

1. **[OPTIONAL] Configure custom request headers**
1. Get the Prometheus target URL. You will need these target URL elements to install this integration:

To add custom request headers, install this integration, then modify the resulting Sensu Check resource with one or more `--header` flags.
- Protocol (`http` or `https`)
- Host (hostname, IP address, or domain name)
- Port number (default is `9100`)
- Path (default is `/metrics`)

Example:
1. Decide which Sensu agents should execute the `node-exporter-metrics` check. You will need the agent [subscription] names when you install this integration.

**Optional**: Create subscription names that map to the hosts that are running Prometheus.

1. If you want to use a Sensu [pipeline] to process Prometheus Node Exporter Metrics integration data, you will need the pipeline name when you install this integration.

1. **Optional** Configure custom request headers.

To use custom request headers, install the Prometheus Node Exporter Metrics integration. Then, update the `node-exporter-metrics` check to add one or more `--header` flags in the check's `command` attribute.

<details><summary><strong>Example: Custom request header configuration</strong></summary>

```yaml
spec:
command: >-
http-get
--timeout 10
--url "http://127.0.0.1:9100/
--url "http://127.0.0.1:9100"
--header "Content-Type: text/plain"
--header "X-Example-Header: helloworld"
```

</details>
<br>

## Plugins

<!-- Links to any Sensu Integration dependencies (i.e. Sensu Plugins) -->

The Prometheus Node Exporter Metrics uses the following Sensu [plugins]:

- [sensu/http-checks][http-checks-bonsai] ([GitHub][http-checks-github])

## Metrics & Events
## Alerts

<!-- List of all alerts generated by this integration. -->

The Prometheus Node Exporter Metrics integration does not produce any events that should be processed by an alert or incident management pipeline.

## Metrics

<!-- List of all metrics or events collected by this integration. -->

This integration collects a wide range of [metrics], depending on the configuration of your Prometheus `node_exporter` and the platform that it is running on. For a full list, see the [`node_exporter` documentation](https://github.com/prometheus/node_exporter#readme).
The Prometheus Node Exporter Metrics integration collects many [metrics], depending on the Prometheus `node_exporter` configuration and the operating system version that it is running on. For a complete list of metrics, read the [Prometheus `node_exporter` documentation][prom-node-exp].

# Reference Documentation
## Reference Documentation

<!-- Please provide links to any relevant reference documentation to help users learn more and/or troubleshoot this integration; specifically including any third-party software documentation. -->

1. This integration uses [Sensu Tokens][tokens] for variable substitution.
* [Token substitution] (Sensu documentation): the Prometheus Node Exporter Metrics integration supports Sensu tokens for variable substitution with data from Sensu entities


<!-- Links -->
[entity]: https://docs.sensu.io/sensu-go/latest/observability-pipeline/observe-entities/entities/
Expand All @@ -76,7 +101,9 @@ This integration collects a wide range of [metrics], depending on the configurat
[pipeline]: https://docs.sensu.io/sensu-go/latest/observability-pipeline/observe-process/pipelines/
[secret]: https://docs.sensu.io/sensu-go/latest/operations/manage-secrets/secrets/
[secrets]: https://docs.sensu.io/sensu-go/latest/operations/manage-secrets/secrets/
[tokens]: https://docs.sensu.io/sensu-go/latest/observability-pipeline/observe-schedule/tokens/
[Token substitution]: https://docs.sensu.io/sensu-go/latest/observability-pipeline/observe-schedule/tokens/
[sensu-plus]: https://sensu.io/features/analytics
[http-checks-bonsai]: https://bonsai.sensu.io/assets/sensu/http-checks
[http-checks-github]: https://github.com/sensu/http-checks
[prom-win-exp]: https://github.com/prometheus-community/windows_exporter#readme
[prom-node-exp]: https://github.com/prometheus/node_exporter#readme
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
spec:
class: community
provider: monitoring
display_name: Prometheus node_exporter monitoring
display_name: Prometheus Node Exporter Metrics
short_description: Collect metrics from Prometheus node_exporter
supported_platforms:
- darwin
Expand All @@ -16,8 +16,6 @@ spec:
- metrics
- prometheus
- node_exporter
- linux
- darwin
contributors:
- "@sensu"
- "@thoward"
Expand All @@ -27,22 +25,22 @@ spec:
title: Node Exporter Metrics HTTP Endpoint Configuration
- type: markdown
body: |
Configure HTTP Endpoint monitoring with the following parameters:
Provide these configuration parameters for the Prometheus `node_exporter` HTTP endpoint:

* **URL**: the target URL to monitor (e.g. `https://api.mycompany.com:443/health`)
* **Protocol**: select http or https request
* **Host**: provide a hostname, IP address, or domain name
* **Port**: provide the port to check (e.g. `80` for HTTP, `443` for HTTPS)
* **Path**: provide the URL path to check (e.g. `/healthz`)
* **Interval**: how often to monitor the HTTP endpoint (in seconds)
* Target URL to collect metrics from, such as `https://127.0.0.1:9100/metrics`, separated into:
* Protocol (`http` or `https`)
* Host (hostname, IP address, or domain name)
* Port number
* Path (e.g. `/metrics`)
* Interval for collecting metrics from the endpoint (in seconds)
- type: question
name: protocol
required: true
input:
type: string
title: HTTP Endpoint Protocol
title: Target URL protocol
description: >-
Provide the HTTP endpoint protocol (i.e. "http" or "https").
Select the protocol for the Prometheus `node_exporter` target URL (`http` or `https`)
enum:
- http
- https
Expand All @@ -52,80 +50,76 @@ spec:
required: true
input:
type: string
title: HTTP Endpoint Host
title: Target URL host
description: >-
Provide the HTTP endpoint host (e.g. "127.0.0.1")
Enter the host for the Prometheus `node_exporter` target URL
default: 127.0.0.1
- type: question
name: port
required: true
input:
type: integer
title: HTTP Endpoint Port
title: Target URL port
description: >-
Provide the HTTP endpoint port (e.g. 9100 is the default for node_exporter)
Enter the port for the Prometheus `node_exporter` target URL (`node_exporter` default is `9100`)
default: 9100
- type: question
name: path
required: true
input:
type: string
title: HTTP Endpoint Path
title: Target URL path
description: >-
Provide the HTTP endpoint path (e.g. "/metrics"; NOTE: this configuration MUST begin with a "/")
Enter the path for the Prometheus `node_exporter` target URL (MUST begin with `/`)
default: "/metrics"
- type: question
name: interval
input:
type: integer
title: Interval
description: >-
Configure the HTTP endpoint monitoring interval, in seconds (60 = one minute, 300 = five minutes, 600 = 10 minutes, etc)
Specify the metrics collection interval, in seconds (60 = 1 minute, 300 = 5 minutes, 600 = 10 minutes)
default: 30
- type: question
name: labels
input:
type: object
title: Labels
description: Key/value metadata
format: io.sensu.meta.label
additionalProperties:
type: string
- type: section
title: Configure Sensu Subscriptions
title: Check Labels and Sensu Subscriptions
- type: markdown
body: |
Configure which Sensu Agent subscriptions this check should be run on.

E.G. A subscription that maps to the hosts that are running Prometheus `node_exporter`.
Specify the subscriptions for Sensu agents that should execute the `node-exporter-metrics` check and the metadata labels to add to the check definition.
- type: question
name: subscriptions
input:
type: array
items:
type: string
title: Subscriptions (Origins)
title: Subscriptions
ref: core/v2/entity/subscriptions
default:
- prometheus
- node_exporter
- linux
- darwin
- type: question
name: labels
input:
type: object
title: Check labels
description: Add metadata labels for the `node-exporter-metrics` check
format: io.sensu.meta.label
additionalProperties:
type: string
- type: section
title: Pipeline Configuration
- type: markdown
body: |
Configure one or more [pipelines] for processing Prometheus `node_exporter` metrics.
Name the [pipelines] you want to use to process Prometheus Node Exporter Metrics integration data.

[pipelines]: https://docs.sensu.io/sensu-go/latest/observability-pipeline/
[pipelines]: https://docs.sensu.io/sensu-go/latest/observability-pipeline/observe-process/pipelines/
- type: question
name: metrics_pipeline
required: false
input:
type: string
title: Metrics Pipeline
title: Metrics pipeline name
description: >-
How do you want to process metrics collected by this integration?
Which pipeline do you want to use to process the metrics this integration collects?
ref: core/v2/pipeline/metadata/name
refFilter: .labels.provider == "metrics"
resource_patches:
Expand All @@ -143,6 +137,9 @@ spec:
http-get
--timeout 10
--url "[[protocol]]://[[host]]:[[port]][[path]]"
- op: replace
path: /spec/interval
value: interval
- op: replace
path: /spec/subscriptions
value: subscriptions
Expand All @@ -157,4 +154,11 @@ spec:
api_version: core/v2
type: Pipeline
name: "[[metrics_pipeline]]"

post_install:
- type: section
title: Success
- type: markdown
body: |
You enabled the Prometheus Node Exporter Metrics integration for `[[protocol]]://[[host]]:[[port]][[path]]`.

The `node-exporter-metrics` check will run for all Sensu agents with these subscriptions: [[subscriptions]].