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

grwehner/pv-volume-name-in-mdm #452

Merged
merged 2 commits into from
Oct 1, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 = "volume"
gracewehner marked this conversation as resolved.
Show resolved Hide resolved

#Telemetry constants
CONTAINER_METRICS_HEART_BEAT_EVENT = "ContainerMetricsMdmHeartBeatEvent"
Expand Down