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

ignore squashfs type for inodes #519

Open
wants to merge 1 commit into
base: master
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ value_unit: "%"
signals:
used:
metric: system.filesystem.inodes.usage
filter: filter('state', 'used')
filter: "(filter('state', 'used') and not filter('type', 'squashfs'))"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sort of filtering is supposed to happen at the collection level (smartagent or otel-collector).

And squashfs is already excluded by default.

How are you collecting the metrics?
Do you have a custom configuration?

free:
metric: system.filesystem.inodes.usage
filter: filter('state', 'free')
filter: "(filter('state', 'free') and not filter('type', 'squashfs'))"
signal:
formula: (used / (used + free) * 100)
rules:
Expand Down
1 change: 1 addition & 0 deletions modules/smart-agent_system-common/conf/04-inodes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ value_unit: "%"
signals:
signal:
metric: percent_inodes.used
filter: not filter('fs_type', 'squashfs')
rules:
critical:
threshold: 95
Expand Down
6 changes: 3 additions & 3 deletions modules/smart-agent_system-common/detectors-gen.tf
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ resource "signalfx_detector" "filesystem_inodes" {
}

program_text = <<-EOF
used = data('system.filesystem.inodes.usage', filter=filter('state', 'used') and ${module.filtering.signalflow})${var.filesystem_inodes_aggregation_function}${var.filesystem_inodes_transformation_function}
free = data('system.filesystem.inodes.usage', filter=filter('state', 'free') and ${module.filtering.signalflow})${var.filesystem_inodes_aggregation_function}${var.filesystem_inodes_transformation_function}
used = data('system.filesystem.inodes.usage', filter=(filter('state', 'used') and not filter('type', 'squashfs')) and ${module.filtering.signalflow})${var.filesystem_inodes_aggregation_function}${var.filesystem_inodes_transformation_function}
free = data('system.filesystem.inodes.usage', filter=(filter('state', 'free') and not filter('type', 'squashfs')) and ${module.filtering.signalflow})${var.filesystem_inodes_aggregation_function}${var.filesystem_inodes_transformation_function}
signal = (used / (used + free) * 100).publish('signal')
detect(when(signal > ${var.filesystem_inodes_threshold_critical}, lasting=%{if var.filesystem_inodes_lasting_duration_critical == null}None%{else}'${var.filesystem_inodes_lasting_duration_critical}'%{endif}, at_least=${var.filesystem_inodes_at_least_percentage_critical})).publish('CRIT')
detect(when(signal > ${var.filesystem_inodes_threshold_major}, lasting=%{if var.filesystem_inodes_lasting_duration_major == null}None%{else}'${var.filesystem_inodes_lasting_duration_major}'%{endif}, at_least=${var.filesystem_inodes_at_least_percentage_major}) and (not when(signal > ${var.filesystem_inodes_threshold_critical}, lasting=%{if var.filesystem_inodes_lasting_duration_critical == null}None%{else}'${var.filesystem_inodes_lasting_duration_critical}'%{endif}, at_least=${var.filesystem_inodes_at_least_percentage_critical}))).publish('MAJOR')
Expand Down Expand Up @@ -218,7 +218,7 @@ resource "signalfx_detector" "disk_inodes" {
}

program_text = <<-EOF
signal = data('percent_inodes.used', filter=${module.filtering.signalflow})${var.disk_inodes_aggregation_function}${var.disk_inodes_transformation_function}.publish('signal')
signal = data('percent_inodes.used', filter=not filter('fs_type', 'squashfs') and ${module.filtering.signalflow})${var.disk_inodes_aggregation_function}${var.disk_inodes_transformation_function}.publish('signal')
detect(when(signal > ${var.disk_inodes_threshold_critical}, lasting=%{if var.disk_inodes_lasting_duration_critical == null}None%{else}'${var.disk_inodes_lasting_duration_critical}'%{endif}, at_least=${var.disk_inodes_at_least_percentage_critical})).publish('CRIT')
detect(when(signal > ${var.disk_inodes_threshold_major}, lasting=%{if var.disk_inodes_lasting_duration_major == null}None%{else}'${var.disk_inodes_lasting_duration_major}'%{endif}, at_least=${var.disk_inodes_at_least_percentage_major}) and (not when(signal > ${var.disk_inodes_threshold_critical}, lasting=%{if var.disk_inodes_lasting_duration_critical == null}None%{else}'${var.disk_inodes_lasting_duration_critical}'%{endif}, at_least=${var.disk_inodes_at_least_percentage_critical}))).publish('MAJOR')
EOF
Expand Down
Loading