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

Issue #515: Fix indentation in monitoring use cases #516

Merged
Merged
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
24 changes: 13 additions & 11 deletions metricshub-doc/src/site/markdown/usecases/network-interfaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,31 @@ To monitor our switch:
* host type: `network`

```yaml
alcatel-switch:
attributes:
host.name: alcatel-switch-01
host.type: network
resources:
alcatel-switch:
attributes:
host.name: alcatel-switch-01
host.type: network
```
2. We configure **MetricsHub** to connect to the network switch using the SNMP `v2c` protocol and the `public` community

```yaml
protocols:
snmp:
version: v2c
community: public
protocols:
snmp:
version: v2c
community: public
```

Here is the complete YAML configuration to be added to `config/metricshub.yaml` to monitor the switch:

```yaml
alcatel-switch:
```yaml
resources:
alcatel-switch:
attributes:
host.name: alcatel-switch-01
host.type: network
protocols:
snmp:
version: v2c
community: public
```
```
20 changes: 10 additions & 10 deletions metricshub-doc/src/site/markdown/usecases/ping.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,17 @@ To configure the **Ping Check** feature:
```yaml
protocols:
ping:
timeout: 3
timeout: 3s
```

Here is the complete YAML configuration to be added to `config/metricshub.yaml` to ping resources:

```yaml
resources:
host-ping:
attributes:
host.name: [ euclide, ibm-v7k, carnap, dev-nvidia-01, babbage, morgan, toland, ibm-fs900, hmc-ds-1, hmc-ds-2, sup-fuji-01 ]
protocols:
ping:
timeout: 3
```
```yaml
resources:
host-ping:
attributes:
host.name: [ euclide, ibm-v7k, carnap, dev-nvidia-01, babbage, morgan, toland, ibm-fs900, hmc-ds-1, hmc-ds-2, sup-fuji-01 ]
protocols:
ping:
timeout: 3s
```
52 changes: 26 additions & 26 deletions metricshub-doc/src/site/markdown/usecases/process-windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,45 +16,45 @@ To monitor the Microsoft SQL Server process:
1. In the `config/metricshub.yaml` file, we configure the monitoring on a local Windows machine through `WMI`:

```yaml
resources:
localhost:
attributes:
host.name: localhost
host.type: windows
protocols:
wmi:
timeout: 120
resources:
localhost:
attributes:
host.name: localhost
host.type: windows
protocols:
wmi:
timeout: 120
```

2. We specify the `mssqlProcess` dedicated instance of the [Windows - Processes (WMI)](../connectors/windowsprocess.html) connector:

```yaml
additionalConnectors:
mssqlProcess:
uses: WindowsProcess # Connector used
additionalConnectors:
mssqlProcess:
uses: WindowsProcess # Connector used
```

3. We specify the regular expression that will match with the command line of Microsoft SQL Server processes (note how we escape the dot in `sqlservr.exe`):

```yaml
variables:
matchCommand: "sqlservr\\.exe"
variables:
matchCommand: "sqlservr\\.exe"
```

Here is the complete YAML configuration to be added to `config/metricshub.yaml` to monitor the `metricshub` process on a Windows machine:

```yaml
resources:
localhost:
attributes:
host.name: localhost
host.type: windows
protocols:
wmi:
timeout: 120
additionalConnectors:
mssqlProcess:
uses: WindowsProcess
variables:
matchCommand: "sqlservr\\.exe"
resources:
localhost:
attributes:
host.name: localhost
host.type: windows
protocols:
wmi:
timeout: 120
additionalConnectors:
mssqlProcess:
uses: WindowsProcess
variables:
matchCommand: "sqlservr\\.exe"
```
5 changes: 4 additions & 1 deletion metricshub-doc/src/site/markdown/usecases/remote-linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,17 @@ To monitor a remote machine running on Linux:
1. In the `config/metricshub.yaml` file, we configure the monitoring on a Linux machine through `SSH`:

```yaml
resources:
dev-nvidia-01:
attributes:
host.name: dev-nvidia-01
host.type: linux
```

2. Then, we configure the SSH protocol

```yaml
protocols:
protocols:
ssh:
username: myusername
password: mypassword
Expand All @@ -39,6 +41,7 @@ Here is the complete YAML configuration to be added to `config/metricshub.yaml`
to monitor a remote machine running on Linux:

```yaml
resources:
dev-nvidia-01:
attributes:
host.name: dev-nvidia-01
Expand Down
124 changes: 64 additions & 60 deletions metricshub-doc/src/site/markdown/usecases/service-health.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,51 +22,95 @@ To collect data from the Grafana health API:
1. In the `config/metricshub.yaml` file, we first declare the `m8b-demo-service` resource, specify its `service.name` and `host.name` attributes, following [OpenTelemetry semantic conventions](https://opentelemetry.io/docs/specs/semconv/resource/), and HTTP as the protocol to connect to this resource:

```yaml
m8b-demo-grafana:
attributes:
service.name: Grafana
host.name: m8b-demo.metricshub.com
protocols:
http:
https: true
port: 443
resources:
m8b-demo-grafana:
attributes:
service.name: Grafana
host.name: m8b-demo.metricshub.com
protocols:
http:
https: true
port: 443
```

2. We then specify the entity we monitor: `grafana-health` with a `simple` job:

```yaml
monitors:
grafana-health:
simple:
monitors:
grafana-health:
simple:
```

3. We specify the Grafana health API as a data source as follows:

```yaml
sources:
# HTTP GET /api/health which returns a JSON
grafanaHealthApi:
type: http
path: /api/health
method: get
header: "Accept: application/json"
computes:
# Convert the JSON document into a simple CSV
- type: json2Csv
entryKey: /
properties: commit;database;version
separator: ;
# Translate the value of "database" in the 2nd column:
# - "ok" --> 1
# - anything else --> 0
- type: translate
column: 3
translationTable:
ok: 1
default: 0
```

4. Finally, we specify how the collected metrics are mapped to **MetricsHub**'s monitoring model:

```yaml
mapping:
source: ${esc.d}{source::grafanaHealthApi}
attributes:
id: $2
service.instance.id: $2
service.version: $4
metrics:
grafana.db.status{state="ok"}: $3
```

Here is the complete YAML configuration to be added to `config/metricshub.yaml` to monitor the health of our Grafana service:

```yaml
resources:
m8b-demo-grafana:
attributes:
service.name: Grafana
host.name: m8b-demo.metricshub.com
protocols:
http:
https: true
port: 443
monitors:
grafana-health:
simple:
sources:
# HTTP GET /api/health which returns a JSON
grafanaHealthApi:
type: http
path: /api/health
method: get
header: "Accept: application/json"
computes:
# Convert the JSON document into a simple CSV
- type: json2Csv
entryKey: /
properties: commit;database;version
separator: ;
# Translate the value of "database" in the 2nd column:
# - "ok" --> 1
# - anything else --> 0
- type: translate
column: 3
translationTable:
ok: 1
default: 0
```
4. Finally, we specify how the collected metrics are mapped to **MetricsHub**'s monitoring model:

```yaml
mapping:
source: ${esc.d}{source::grafanaHealthApi}
attributes:
Expand All @@ -75,44 +119,4 @@ To collect data from the Grafana health API:
service.version: $4
metrics:
grafana.db.status{state="ok"}: $3
```

Here is the complete YAML configuration to be added to `config/metricshub.yaml` to monitor the health of our Grafana service:

```yaml
m8b-demo-grafana:
attributes:
service.name: Grafana
host.name: m8b-demo.metricshub.com
protocols:
http:
https: true
port: 443
monitors:
grafana-health:
simple:
sources:
grafanaHealthApi:
type: http
path: /api/health
method: get
header: "Accept: application/json"
computes:
- type: json2Csv
entryKey: /
properties: commit;database;version
separator: ;
- type: translate
column: 3
translationTable:
ok: 1
default: 0
mapping:
source: ${esc.d}{source::grafanaHealthApi}
attributes:
id: $2
service.instance.id: $2
service.version: $4
metrics:
grafana.db.status{state="ok"}: $3
```
Loading
Loading