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

jmx geometry metaspace #216

Open
pierreislande opened this issue Dec 22, 2020 · 1 comment
Open

jmx geometry metaspace #216

pierreislande opened this issue Dec 22, 2020 · 1 comment

Comments

@pierreislande
Copy link
Contributor

Hello, could you please add this, to the jmx module if possible: https://github.com/claranet/terraform-signalfx-detectors/tree/master/modules/smart-agent_genericjmx

resource "signalfx_detector" "jmx_memory_geometry_metaspace_space_usage" {
  name = "${join("", formatlist("[%s]", var.prefixes))}[${var.environment}] JMX Memory Geometry Metaspace Space Usage"

  program_text = <<-EOF
    A = data('jmx_memory.used', filter=filter('plugin_instance', 'memory_pool-Metaspace') and ${module.filter-tags.filter_custom})${var.jmx_memory_geometry_metaspace_space_used_aggregation_function}${var.jmx_memory_geometry_metaspace_space_used_transformation_function}
    B = data('jmx_memory.max', filter=filter('plugin_instance', 'memory_pool-Metaspace') and ${module.filter-tags.filter_custom})${var.jmx_memory_geometry_metaspace_space_max_aggregation_function}${var.jmx_memory_geometry_metaspace_space_max_transformation_function}
    signal = ((A/B).fill(0).scale(100)).publish('signal')
    detect(when(signal > ${var.jmx_memory_geometry_metaspace_space_usage_threshold_critical})).publish('critical')
    detect(when(signal > ${var.jmx_memory_geometry_metaspace_space_usage_threshold_warning}) and (signal < ${var.jmx_memory_geometry_metaspace_space_usage_threshold_critical})).publish('WARN')
EOF

  rule {
    description           = "is too low > ${var.jmx_memory_geometry_metaspace_space_usage_threshold_warning}"
    severity              = "Warning"
    detect_label          = "WARN"
    disabled              = coalesce(var.jmx_memory_geometry_metaspace_space_usage_disabled_warning, var.detectors_disabled)
    notifications         = coalescelist(var.jmx_memory_geometry_metaspace_space_usage_notifications_warning, var.notifications)
    parameterized_subject = "[{{ruleSeverity}}]{{{detectorName}}} {{{readableRule}}} on {{{dimensions}}}"
  }
  rule {
    description           = "is too low > ${var.jmx_memory_geometry_metaspace_space_usage_threshold_critical}"
    severity              = "Critical"
    detect_label          = "critical"
    disabled              = coalesce(var.jmx_memory_geometry_metaspace_space_usage_disabled_critical, var.detectors_disabled)
    notifications         = coalescelist(var.jmx_memory_geometry_metaspace_space_usage_notifications_critical, var.notifications)
    parameterized_subject = "[{{ruleSeverity}}]{{{detectorName}}} {{{readableRule}}} on {{{dimensions}}}"
  }
}

@xp-1000
Copy link
Contributor

xp-1000 commented Dec 22, 2020

please provide a real use case because it seems too much specific to be relevant in this repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants