Skip to content
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
2 changes: 2 additions & 0 deletions source/plugins/ruby/MdmAlertTemplates.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ class MdmAlertTemplates
"podName",
"node",
"kubernetesNamespace",
"volumeName",
"thresholdPercentage"
],
"series": [
Expand All @@ -109,6 +110,7 @@ class MdmAlertTemplates
"%{podNameDimValue}",
"%{computerNameDimValue}",
"%{namespaceDimValue}",
"%{volumeNameDimValue}",
"%{thresholdPercentageDimValue}"
],
"min": %{pvResourceUtilizationPercentage},
Expand Down
3 changes: 3 additions & 0 deletions source/plugins/ruby/MdmMetricsGenerator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ def zeroFillMetricRecords(records, batch_time)
pvZeroFillDims = {}
pvZeroFillDims[Constants::INSIGHTSMETRICS_TAGS_PVC_NAMESPACE] = Constants::KUBESYSTEM_NAMESPACE_ZERO_FILL
pvZeroFillDims[Constants::INSIGHTSMETRICS_TAGS_POD_NAME] = Constants::OMSAGENT_ZERO_FILL
pvZeroFillDims[Constants::INSIGHTSMETRICS_TAGS_VOLUME_NAME] = Constants::VOLUME_NAME_ZERO_FILL
pvResourceUtilMetricRecord = getPVResourceUtilMetricRecords(batch_time,
Constants::PV_USED_BYTES,
@@hostName,
Expand Down Expand Up @@ -289,13 +290,15 @@ def getPVResourceUtilMetricRecords(recordTimeStamp, metricName, computer, percen
pvcNamespace = dims[Constants::INSIGHTSMETRICS_TAGS_PVC_NAMESPACE]
podName = dims[Constants::INSIGHTSMETRICS_TAGS_POD_NAME]
podUid = dims[Constants::INSIGHTSMETRICS_TAGS_POD_UID]
volumeName = dims[Constants::INSIGHTSMETRICS_TAGS_VOLUME_NAME]

resourceUtilRecord = MdmAlertTemplates::PV_resource_utilization_template % {
timestamp: recordTimeStamp,
metricName: @@pod_metric_name_metric_percentage_name_hash[metricName],
podNameDimValue: podName,
computerNameDimValue: computer,
namespaceDimValue: pvcNamespace,
volumeNameDimValue: volumeName,
pvResourceUtilizationPercentage: percentageMetricValue,
thresholdPercentageDimValue: thresholdPercentage,
}
Expand Down
1 change: 1 addition & 0 deletions source/plugins/ruby/constants.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class Constants
TELEGRAF_DISK_METRICS = "container.azm.ms/disk"
OMSAGENT_ZERO_FILL = "omsagent"
KUBESYSTEM_NAMESPACE_ZERO_FILL = "kube-system"
VOLUME_NAME_ZERO_FILL = "-"

#Telemetry constants
CONTAINER_METRICS_HEART_BEAT_EVENT = "ContainerMetricsMdmHeartBeatEvent"
Expand Down