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

Add config spec #6553

Merged
merged 1 commit into from
May 1, 2020
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
161 changes: 161 additions & 0 deletions disk/assets/configuration/spec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
name: Disk
files:
- name: disk.yaml
options:
- template: init_config
- template: instances
options:
- name: use_mount
required: true
description: Instruct the check to collect using mount points instead of volumes.
value:
example: false
type: boolean
- name: all_partitions
description: |
Instruct the check to collect from partitions even without device names.
Setting `use_mount` to true is strongly recommended in this case.
value:
example: false
type: boolean
- template: instances/tags
- name: file_system_whitelist
description: |
Instruct the check to only collect from matching file systems.

Character casing is ignored. For convenience, the regular expressions
start matching from the beginning and therefore to match anywhere you
must prepend `.*`. For exact matches append `$`.
value:
example:
- ext[34]$
- ntfs$
type: array
items:
type: string
- name: file_system_blacklist
description: |
Instruct the check to not collect from matching file systems.

Character casing is ignored. For convenience, the regular expressions
start matching from the beginning and therefore to match anywhere you
must prepend `.*`. For exact matches append `$`.

When conflicts arise, this will override `file_system_whitelist`.
value:
example:
- tmpfs$
- rootfs$
- autofs$
type: array
items:
type: string
- name: device_whitelist
description: |
Instruct the check to only collect from matching devices.

Character casing is ignored on Windows. For convenience, the regular
expressions start matching from the beginning and therefore to match
anywhere you must prepend `.*`. For exact matches append `$`.
value:
example:
- '/dev/sda[1-3]'
- 'C:'
type: array
items:
type: string
- name: device_blacklist
description: |
Instruct the check to not collect from matching devices.

Character casing is ignored on Windows. For convenience, the regular
expressions start matching from the beginning and therefore to match
anywhere you must prepend `.*`. For exact matches append `$`.

When conflicts arise, this will override `device_whitelist`.
value:
example:
- /dev/sde
- '[FJ]:'
type: array
items:
type: string
- name: mount_point_whitelist
description: |
Instruct the check to only collect from matching mount points.

Character casing is ignored on Windows. For convenience, the regular
expressions start matching from the beginning and therefore to match
anywhere you must prepend `.*`. For exact matches append `$`.
value:
example:
- '/dev/sda[1-3]'
- 'C:'
type: array
items:
type: string
- name: mount_point_blacklist
description: |
Instruct the check to not collect from matching mount points.

Character casing is ignored on Windows. For convenience, the regular
expressions start matching from the beginning and therefore to match
anywhere you must prepend `.*`. For exact matches append `$`.
value:
example:
- /proc/sys/fs/binfmt_misc
- /dev/sde
- '[FJ]:'
type: array
items:
type: string
- name: service_check_rw
description: |
Instruct the check to notify based on partition state.

read-write -> OK
read-only -> CRITICAL
other -> UNKNOWN
value:
example: false
type: boolean
- name: tag_by_filesystem
description: Instruct the check to tag all disks with their file system e.g. filesystem:ntfs.
value:
example: false
type: boolean
- name: tag_by_label
description: |
Instruct the check to tag all the metrics with disk label if there is one.
Works on Linux only.
value:
example: true
type: boolean
- name: blkid_cache_file
description: |
Instruct the check to read the labels from the blkid cache file instead of `blkid` executable.
This parameter is used only if `tag_by_label` is true.
Works on Linux only.
value:
example: /run/blkid/blkid.tab
default: null
type: string
- name: device_tag_re
description: |
Instruct the check to apply additional tags to matching
devices (or mount points if `use_mount` is true).

Character casing is ignored on Windows. Multiple comma-separated
tags are supported. You must properly quote the string if the
pattern contains special characters e.g. colons.
value:
example:
/san/.*: device_type:san
/dev/sda3: role:db,disk_size:large
"c:": volume:boot
type: object
- name: min_disk_size
description: Exclude devices with a total disk size less than a minimum value (in MiB)
value:
example: 0
type: number
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
## This file is overwritten upon Agent upgrade.
## To make modifications to the check configuration, please copy this file
## to `disk.yaml` and make your changes on that file.

init_config:
## All options defined here are available to all instances.
#
# init_config: {}

## Every instance is scheduled independent of the others.
#
instances:

## @param use_mount - boolean - required
## Instruct the check to collect using mount points instead of volumes.
#
- use_mount: false

## @param all_partitions - boolean - optional
## @param all_partitions - boolean - optional - default: false
## Instruct the check to collect from partitions even without device names.
## Setting `use_mount` to true is strongly recommended in this case.
#
# all_partitions: false

## @param tags - list of key:value string - optional
## List of tags to attach to every metric and service check emitted by this integration.
## @param tags - list of strings - optional
## A list of tags to attach to every metric and service check emitted by this instance.
##
## Learn more about tagging at https://docs.datadoghq.com/tagging
#
# tags:
# - <KEY_1>:<VALUE_1>
# - <KEY_2>:<VALUE_2>

## @param file_system_whitelist - list of regex - optional
## @param file_system_whitelist - list of strings - optional
## Instruct the check to only collect from matching file systems.
##
## Character casing is ignored. For convenience, the regular expressions
Expand All @@ -37,7 +37,7 @@ instances:
# - ext[34]$
# - ntfs$

## @param file_system_blacklist - list of regex - optional
## @param file_system_blacklist - list of strings - optional
## Instruct the check to not collect from matching file systems.
##
## Character casing is ignored. For convenience, the regular expressions
Expand All @@ -51,7 +51,7 @@ instances:
# - rootfs$
# - autofs$

## @param device_whitelist - list of regex - optional
## @param device_whitelist - list of strings - optional
## Instruct the check to only collect from matching devices.
##
## Character casing is ignored on Windows. For convenience, the regular
Expand All @@ -60,9 +60,9 @@ instances:
#
# device_whitelist:
# - /dev/sda[1-3]
# - C:
# - 'C:'

## @param device_blacklist - list of regex - optional
## @param device_blacklist - list of strings - optional
## Instruct the check to not collect from matching devices.
##
## Character casing is ignored on Windows. For convenience, the regular
Expand All @@ -73,9 +73,9 @@ instances:
#
# device_blacklist:
# - /dev/sde
# - [FJ]:
# - '[FJ]:'

## @param mount_point_whitelist - list of regex - optional
## @param mount_point_whitelist - list of strings - optional
## Instruct the check to only collect from matching mount points.
##
## Character casing is ignored on Windows. For convenience, the regular
Expand All @@ -84,23 +84,21 @@ instances:
#
# mount_point_whitelist:
# - /dev/sda[1-3]
# - C:
# - 'C:'

## @param mount_point_blacklist - list of regex - optional
## @param mount_point_blacklist - list of strings - optional
## Instruct the check to not collect from matching mount points.
##
## Character casing is ignored on Windows. For convenience, the regular
## expressions start matching from the beginning and therefore to match
## anywhere you must prepend `.*`. For exact matches append `$`.
##
## When conflicts arise, this will override `mount_point_whitelist`.
#
# mount_point_blacklist:
# - /proc/sys/fs/binfmt_misc
# - /dev/sde
# - [FJ]:
# - '[FJ]:'

## @param service_check_rw - boolean - optional
## @param service_check_rw - boolean - optional - default: false
## Instruct the check to notify based on partition state.
##
## read-write -> OK
Expand All @@ -109,7 +107,7 @@ instances:
#
# service_check_rw: false

## @param tag_by_filesystem - boolean - optional
## @param tag_by_filesystem - boolean - optional - default: false
## Instruct the check to tag all disks with their file system e.g. filesystem:ntfs.
#
# tag_by_filesystem: false
Expand All @@ -127,7 +125,7 @@ instances:
#
# blkid_cache_file: /run/blkid/blkid.tab

## @param device_tag_re - list of regex:tags string - optional
## @param device_tag_re - mapping - optional
## Instruct the check to apply additional tags to matching
## devices (or mount points if `use_mount` is true).
##
Expand All @@ -138,9 +136,9 @@ instances:
# device_tag_re:
# /san/.*: device_type:san
# /dev/sda3: role:db,disk_size:large
# "c:": volume:boot
# 'c:': volume:boot

## @param min_disk_size - float - optional - default: 0
## @param min_disk_size - number - optional - default: 0
## Exclude devices with a total disk size less than a minimum value (in MiB)
#
# min_disk_size: 0
3 changes: 3 additions & 0 deletions disk/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
"type": "check",
"integration_id": "system",
"assets": {
"configuration": {
"spec": "assets/configuration/spec.yaml"
},
"monitors": {},
"dashboards": {},
"service_checks": "assets/service_checks.json"
Expand Down