forked from prometheus/node_exporter
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add gitignore to node-observ-lib * Fix typo in node default filteringSelector * Prep alert group names for macos * Add macos-observ-lib * Change overview dashboard: show networkErrorsAndDroppedPerSec instead of networkErrorPerSec for Linux/MacOS * Add more alerts * Move alerts to sep file * Breaking: Update layout To allow to locally import linux from macos * Bring back NodeFilesystemAlmostOutOfFiles alert * Show only errors when they occur * Only show network interfaces that had traffic change at least once during selected dashboard interval
- Loading branch information
1 parent
4a48f6b
commit 94e744e
Showing
473 changed files
with
420 additions
and
81,560 deletions.
There are no files selected for viewing
1 change: 0 additions & 1 deletion
1
...or/github.com/jsonnet-libs/xtd/.gitignore → docs/node-observ-lib/.gitignore
This file contains 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 |
---|---|---|
@@ -1,3 +1,2 @@ | ||
.jekyll-cache | ||
jsonnetfile.lock.json | ||
vendor |
This file contains 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 was deleted.
Oops, something went wrong.
This file contains 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 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
2 changes: 1 addition & 1 deletion
2
docs/node-observ-lib/annotations.libsonnet → ...de-observ-lib/linux/annotations.libsonnet
This file contains 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 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 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
2 changes: 1 addition & 1 deletion
2
docs/node-observ-lib/links.libsonnet → docs/node-observ-lib/linux/links.libsonnet
This file contains 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
File renamed without changes.
This file contains 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
File renamed without changes.
This file contains 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
2 changes: 1 addition & 1 deletion
2
docs/node-observ-lib/variables.libsonnet → ...node-observ-lib/linux/variables.libsonnet
This file contains 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 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,86 @@ | ||
# MacOS exporter observability lib | ||
|
||
This jsonnet observability lib can be used to generate observability package for node exporter(MacOS). | ||
|
||
## Import | ||
|
||
```sh | ||
jb init | ||
jb install https://github.com/grafana/node_exporter/docs/node-observ-lib | ||
``` | ||
|
||
## Examples | ||
|
||
### Example 1: Basic example | ||
|
||
You can use observ-lib to fill in monitoring-mixin structure: | ||
|
||
```jsonnet | ||
// mixin.libsonnet file | ||
local macoslib = import 'node-observ-lib/macos/main.libsonnet'; | ||
local mac = | ||
macoslib.new() | ||
+ macoslib.withConfigMixin({ | ||
filteringSelector: 'job=~".*mac.*"', | ||
groupLabels: ['job'], | ||
instanceLabels: ['instance'], | ||
dashboardNamePrefix: 'MacOS / ', | ||
dashboardTags: ['macos-mixin'], | ||
uid: 'darwin', | ||
// enable loki logs | ||
enableLokiLogs: true, | ||
}); | ||
{ | ||
grafanaDashboards+:: mac.grafana.dashboards, | ||
prometheusAlerts+:: mac.prometheus.alerts, | ||
prometheusRules+:: mac.prometheus.recordingRules, | ||
} | ||
``` | ||
For more examples see [node-observ-lib/linux](../linux). | ||
|
||
## Collectors used: | ||
|
||
Grafana Agent or combination of node_exporter/promtail can be used in order to collect data required. | ||
|
||
### Logs collection | ||
|
||
Loki logs are used to populate logs dashboard and also for annotations. | ||
|
||
To use logs, you need to opt-in, with setting `enableLokiLogs: true` in config. | ||
|
||
See example above. | ||
|
||
The following scrape snippet can be used in grafana-agent/promtail: | ||
|
||
```yaml | ||
- job_name: integrations/node_exporter_direct_scrape | ||
static_configs: | ||
- targets: | ||
- localhost | ||
labels: | ||
__path__: /var/log/*.log | ||
instance: '<your-instance-name>' | ||
job: integrations/macos-node | ||
pipeline_stages: | ||
- multiline: | ||
firstline: '^([\w]{3} )?[\w]{3} +[\d]+ [\d]+:[\d]+:[\d]+|[\w]{4}-[\w]{2}-[\w]{2} [\w]{2}:[\w]{2}:[\w]{2}(?:[+-][\w]{2})?' | ||
- regex: | ||
expression: '(?P<timestamp>([\w]{3} )?[\w]{3} +[\d]+ [\d]+:[\d]+:[\d]+|[\w]{4}-[\w]{2}-[\w]{2} [\w]{2}:[\w]{2}:[\w]{2}(?:[+-][\w]{2})?) (?P<hostname>\S+) (?P<sender>.+?)\[(?P<pid>\d+)\]:? (?P<message>(?s:.*))$' | ||
- labels: | ||
sender: | ||
hostname: | ||
pid: | ||
- match: | ||
selector: '{sender!="", pid!=""}' | ||
stages: | ||
- template: | ||
source: message | ||
template: '{{ .sender }}[{{ .pid }}]: {{ .message }}' | ||
- labeldrop: | ||
- pid | ||
- output: | ||
source: message | ||
``` |
This file contains 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,23 @@ | ||
{ | ||
new(this, parentPrometheus): | ||
{ | ||
groups: | ||
//keep only alerts listed in alertsMacKeep | ||
std.filter( | ||
function(group) std.length(group.rules) > 0, | ||
[ | ||
{ | ||
name: group.name, | ||
rules: [ | ||
rule | ||
for rule in group.rules | ||
if std.length(std.find(rule.alert, this.config.alertsMacKeep)) > 0 | ||
], | ||
} | ||
for group in parentPrometheus.alerts.groups | ||
], | ||
|
||
), | ||
|
||
}, | ||
} |
Oops, something went wrong.