Skip to content
Closed
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
14 changes: 12 additions & 2 deletions build/common/installer/scripts/tomlparser-prom-customconfig.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,16 @@ def createPrometheusPluginsWithNamespaceSetting(monitorKubernetesPods, monitorKu
timeout_config_key = "response_timeout"
end

# 'fieldpass'/'fielddrop' were deprecated in telegraf 1.29.0 and removed in 1.40.0.
# Windows still ships telegraf 1.24.2, which predates the replacement options, so it
# must keep emitting the legacy option names.
field_include_key = "fieldinclude"
field_exclude_key = "fieldexclude"
if is_windows?
field_include_key = "fieldpass"
field_exclude_key = "fielddrop"
end

pluginConfigsWithNamespaces = ""
monitorKubernetesPodsNamespaces.each do |namespace|
if !namespace.nil?
Expand All @@ -133,8 +143,8 @@ def createPrometheusPluginsWithNamespaceSetting(monitorKubernetesPods, monitorKu
monitor_kubernetes_pods_namespace = \"#{namespace}\"
kubernetes_label_selector = \"#{kubernetesLabelSelectors}\"
kubernetes_field_selector = \"#{kubernetesFieldSelectors}\"
fieldpass = #{fieldPassSetting}
fielddrop = #{fieldDropSetting}
#{field_include_key} = #{fieldPassSetting}
#{field_exclude_key} = #{fieldDropSetting}
metric_version = #{@metricVersion}
url_tag = \"#{@urlTag}\"
#{timeout_config_key} = \"#{@responseTimeout}\"
Expand Down
36 changes: 18 additions & 18 deletions build/linux/installer/conf/telegraf-ama-logs-process-metrics.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
exe = "mdsd"
interval = "60s"
pid_finder = "native"
pid_tag = true
tag_with = ["pid"]
name_override = "agent_telemetry"
fieldpass = ["cpu_usage", "memory_rss"]
fieldinclude = ["cpu_usage", "memory_rss"]
[inputs.procstat.tags]
Computer = "placeholder_hostname"
PodName = "placeholder_podname"
Expand All @@ -38,9 +38,9 @@
exe = "fluent-bit"
interval = "60s"
pid_finder = "native"
pid_tag = true
tag_with = ["pid"]
name_override = "agent_telemetry"
fieldpass = ["cpu_usage", "memory_rss"]
fieldinclude = ["cpu_usage", "memory_rss"]
[inputs.procstat.tags]
Computer = "placeholder_hostname"
PodName = "placeholder_podname"
Expand All @@ -54,9 +54,9 @@
pattern = "telegraf(-rs|-prom-side-car)?.conf"
interval = "60s"
pid_finder = "native"
pid_tag = true
tag_with = ["pid"]
name_override = "agent_telemetry"
fieldpass = ["cpu_usage", "memory_rss"]
fieldinclude = ["cpu_usage", "memory_rss"]
[inputs.procstat.tags]
Computer = "placeholder_hostname"
PodName = "placeholder_podname"
Expand All @@ -70,9 +70,9 @@
pattern = "telegraf-ama-logs-process-metrics.conf"
interval = "60s"
pid_finder = "native"
pid_tag = true
tag_with = ["pid"]
name_override = "agent_telemetry"
fieldpass = ["cpu_usage", "memory_rss"]
fieldinclude = ["cpu_usage", "memory_rss"]
[inputs.procstat.tags]
Computer = "placeholder_hostname"
PodName = "placeholder_podname"
Expand All @@ -85,9 +85,9 @@
name_prefix = "t.azm.ms/"
interval = "60s"
pid_finder = "native"
pid_tag = true
tag_with = ["pid"]
name_override = "agent_telemetry"
fieldpass = ["cpu_usage", "memory_rss"]
fieldinclude = ["cpu_usage", "memory_rss"]
[inputs.procstat.tags]
Computer = "placeholder_hostname"
PodName = "placeholder_podname"
Expand All @@ -104,9 +104,9 @@
exe = "crond"
interval = "60s"
pid_finder = "native"
pid_tag = true
tag_with = ["pid"]
name_override = "agent_telemetry"
fieldpass = ["cpu_usage", "memory_rss"]
fieldinclude = ["cpu_usage", "memory_rss"]
[inputs.procstat.tags]
Computer = "placeholder_hostname"
PodName = "placeholder_podname"
Expand All @@ -120,9 +120,9 @@
exe = "inotifywait"
interval = "60s"
pid_finder = "native"
pid_tag = true
tag_with = ["pid"]
name_override = "agent_telemetry"
fieldpass = ["cpu_usage", "memory_rss"]
fieldinclude = ["cpu_usage", "memory_rss"]
[inputs.procstat.tags]
Computer = "placeholder_hostname"
PodName = "placeholder_podname"
Expand All @@ -135,9 +135,9 @@
name_prefix = "t.azm.ms/"
interval = "60s"
pid_finder = "native"
pid_tag = true
tag_with = ["pid"]
name_override = "agent_telemetry"
fieldpass = ["cpu_usage", "memory_rss"]
fieldinclude = ["cpu_usage", "memory_rss"]
[inputs.procstat.tags]
Computer = "placeholder_hostname"
PodName = "placeholder_podname"
Expand All @@ -154,9 +154,9 @@
pattern = "main.sh"
interval = "60s"
pid_finder = "native"
pid_tag = true
tag_with = ["pid"]
name_override = "agent_telemetry"
fieldpass = ["cpu_usage", "memory_rss"]
fieldinclude = ["cpu_usage", "memory_rss"]
[inputs.procstat.tags]
Computer = "placeholder_hostname"
PodName = "placeholder_podname"
Expand Down
4 changes: 2 additions & 2 deletions build/linux/installer/conf/telegraf-prom-side-car.conf
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@
$AZMON_TELEGRAF_CUSTOM_PROM_KUBERNETES_LABEL_SELECTOR
$AZMON_TELEGRAF_CUSTOM_PROM_KUBERNETES_FIELD_SELECTOR

fieldpass = $AZMON_TELEGRAF_CUSTOM_PROM_FIELDPASS
fielddrop = $AZMON_TELEGRAF_CUSTOM_PROM_FIELDDROP
fieldinclude = $AZMON_TELEGRAF_CUSTOM_PROM_FIELDPASS
fieldexclude = $AZMON_TELEGRAF_CUSTOM_PROM_FIELDDROP

metric_version = 2
url_tag = "scrapeUrl"
Expand Down
6 changes: 3 additions & 3 deletions build/linux/installer/conf/telegraf-rs.conf
Original file line number Diff line number Diff line change
Expand Up @@ -574,8 +574,8 @@
$AZMON_TELEGRAF_CUSTOM_PROM_KUBERNETES_LABEL_SELECTOR
$AZMON_TELEGRAF_CUSTOM_PROM_KUBERNETES_FIELD_SELECTOR

fieldpass = $AZMON_TELEGRAF_CUSTOM_PROM_FIELDPASS
fielddrop = $AZMON_TELEGRAF_CUSTOM_PROM_FIELDDROP
fieldinclude = $AZMON_TELEGRAF_CUSTOM_PROM_FIELDPASS
fieldexclude = $AZMON_TELEGRAF_CUSTOM_PROM_FIELDDROP

metric_version = 2
url_tag = "scrapeUrl"
Expand Down Expand Up @@ -641,7 +641,7 @@ $AZMON_TELEGRAF_OSM_PROM_PLUGINS
#name_prefix="container.azm.ms/"
## An array of urls to scrape metrics from.
urls = $AZMON_INTEGRATION_NPM_METRICS_URL_LIST_CLUSTER
fielddrop = $AZMON_INTEGRATION_NPM_METRICS_DROP_LIST_CLUSTER
fieldexclude = $AZMON_INTEGRATION_NPM_METRICS_DROP_LIST_CLUSTER

metric_version = 2
url_tag = "scrapeUrl"
Expand Down
21 changes: 10 additions & 11 deletions build/linux/installer/conf/telegraf.conf
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@

## Ignore mount points by filesystem type.
ignore_fs = ["tmpfs", "devtmpfs", "devfs", "overlay", "aufs", "squashfs", "cifs", "fuse"]
fieldpass = ["free", "used", "used_percent"]
fieldinclude = ["free", "used", "used_percent"]
taginclude = ["device","path","hostName"]
# Below due to Bug - https://github.com/influxdata/telegraf/issues/5615
# ORDER matters here!! - i.e the below should be the LAST modifier
Expand Down Expand Up @@ -489,7 +489,7 @@
## The typical use case is for LVM volumes, to get the VG/LV name instead of
## the near-meaningless DM-0 name.
# name_templates = ["$ID_FS_LABEL","$DM_VG_NAME/$DM_LV_NAME"]
fieldpass = ["reads", "read_bytes", "read_time", "writes", "write_bytes", "write_time", "io_time", "iops_in_progress"]
fieldinclude = ["reads", "read_bytes", "read_time", "writes", "write_bytes", "write_time", "io_time", "iops_in_progress"]
taginclude = ["name","hostName"]

# Read metrics about network interface usage
Expand All @@ -501,12 +501,11 @@
##
# interfaces = ["eth0"]
##
## On linux systems telegraf also collects protocol stats.
## Setting ignore_protocol_stats to true will skip reporting of protocol metrics.
## NOTE: protocol stats collection was removed in telegraf 1.37.0 and the
## ignore_protocol_stats option became a no-op (removed in 1.45.0), so it is
## no longer set here. Current behavior matches the previous "true" setting.
##
ignore_protocol_stats = true
##
fieldpass = ["bytes_recv", "bytes_sent", "err_in", "err_out"]
fieldinclude = ["bytes_recv", "bytes_sent", "err_in", "err_out"]
taginclude = ["interface","hostName"]

# net plugin is collecting loopback interface metrics by default from telegraf 1.34.3
Expand Down Expand Up @@ -652,7 +651,7 @@
name_prefix="container.azm.ms/"
## An array of urls to scrape metrics from.
urls = ["$CADVISOR_METRICS_URL"]
fieldpass = ["$KUBELET_RUNTIME_OPERATIONS_METRIC", "$KUBELET_RUNTIME_OPERATIONS_ERRORS_METRIC", "$KUBELET_RUNTIME_OPERATIONS_TOTAL_METRIC", "$KUBELET_RUNTIME_OPERATIONS_ERRORS_TOTAL_METRIC"]
fieldinclude = ["$KUBELET_RUNTIME_OPERATIONS_METRIC", "$KUBELET_RUNTIME_OPERATIONS_ERRORS_METRIC", "$KUBELET_RUNTIME_OPERATIONS_TOTAL_METRIC", "$KUBELET_RUNTIME_OPERATIONS_ERRORS_TOTAL_METRIC"]

metric_version = 2
url_tag = "scrapeUrl"
Expand Down Expand Up @@ -697,7 +696,7 @@

# <= 1.18: metric name is kubelet_running_pod_count
# >= 1.19: metric name changed to kubelet_running_pods
fieldpass = ["kubelet_running_pod_count","kubelet_running_pods","volume_manager_total_volumes", "kubelet_node_config_error", "process_resident_memory_bytes", "process_cpu_seconds_total"]
fieldinclude = ["kubelet_running_pod_count","kubelet_running_pods","volume_manager_total_volumes", "kubelet_node_config_error", "process_resident_memory_bytes", "process_cpu_seconds_total"]

metric_version = 2
url_tag = "scrapeUrl"
Expand All @@ -721,9 +720,9 @@
## An array of urls to scrape metrics from.
urls = $AZMON_DS_PROM_URLS

fieldpass = $AZMON_DS_PROM_FIELDPASS
fieldinclude = $AZMON_DS_PROM_FIELDPASS

fielddrop = $AZMON_DS_PROM_FIELDDROP
fieldexclude = $AZMON_DS_PROM_FIELDDROP

metric_version = 2
url_tag = "scrapeUrl"
Expand Down
2 changes: 1 addition & 1 deletion build/linux/installer/scripts/tomlparser-osm-config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def replaceOsmTelegrafConfigPlaceHolders
monitor_kubernetes_pods = true
pod_scrape_scope = \"#{(@controllerType.casecmp(@replicaset) == 0) ? "cluster" : "node"}\"
monitor_kubernetes_pods_namespace = \"#{namespace}\"
fieldpass = #{@fieldPassSetting}
fieldinclude = #{@fieldPassSetting}
metric_version = #{@metricVersion}
url_tag = \"#{@urlTag}\"
bearer_token = \"#{@bearerToken}\"
Expand Down
6 changes: 3 additions & 3 deletions kubernetes/linux/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1242,7 +1242,7 @@ else
if [ "${CONTAINER_TYPE}" == "PrometheusSidecar" ] && [ -e "/opt/telegraf-test-prom-side-car.conf" ]; then
if [ "${MUTE_PROM_SIDECAR}" != "true" ]; then
echo "****************Start Telegraf in Test Mode**************************"
/opt/telegraf --non-strict-env-handling --config /opt/telegraf-test-prom-side-car.conf --input-filter file -test
/opt/telegraf config check --non-strict-env-handling --config /opt/telegraf-test-prom-side-car.conf
if [ $? -eq 0 ]; then
mv "/opt/telegraf-test-prom-side-car.conf" "/etc/opt/microsoft/docker-cimprov/telegraf-prom-side-car.conf"
echo "Moving test conf file to telegraf side-car conf since test run succeeded"
Expand All @@ -1254,7 +1254,7 @@ else
else
if [ -e "/opt/telegraf-test.conf" ]; then
echo "****************Start Telegraf in Test Mode**************************"
/opt/telegraf --non-strict-env-handling --config /opt/telegraf-test.conf --input-filter file -test
/opt/telegraf config check --non-strict-env-handling --config /opt/telegraf-test.conf
if [ $? -eq 0 ]; then
mv "/opt/telegraf-test.conf" "/etc/opt/microsoft/docker-cimprov/telegraf.conf"
echo "Moving test conf file to telegraf daemonset conf since test run succeeded"
Expand All @@ -1265,7 +1265,7 @@ else
else
if [ -e "/opt/telegraf-test-rs.conf" ]; then
echo "****************Start Telegraf in Test Mode**************************"
/opt/telegraf --non-strict-env-handling --config /opt/telegraf-test-rs.conf --input-filter file -test
/opt/telegraf config check --non-strict-env-handling --config /opt/telegraf-test-rs.conf
if [ $? -eq 0 ]; then
mv "/opt/telegraf-test-rs.conf" "/etc/opt/microsoft/docker-cimprov/telegraf-rs.conf"
echo "Moving test conf file to telegraf replicaset conf since test run succeeded"
Expand Down
5 changes: 5 additions & 0 deletions kubernetes/windows/setup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ Write-Host ('Finished Installing Fluentbit')
Write-Host ('Installing Telegraf');
try {
# For next telegraf update, make sure to update config changes in telegraf.conf, tomlparser-prom-customconfig.rb and tomlparser-osm-config.rb
# NOTE: Windows is intentionally pinned to an older telegraf than Linux. Linux uses the
# 'fieldinclude'/'fieldexclude' options (added in 1.29.0, replacing 'fieldpass'/'fielddrop'
# which were removed in 1.40.0), while the Windows configs below must keep the legacy
# 'fieldpass'/'fielddrop' names until telegraf here is upgraded to >= 1.29.0.
# tomlparser-prom-customconfig.rb is shared by both and branches on is_windows? for this.
$telegrafUri='https://dl.influxdata.com/telegraf/releases/telegraf-1.24.2_windows_amd64.zip'
Invoke-WebRequest -Uri $telegrafUri -OutFile /installation/telegraf.zip
Expand-Archive -Path /installation/telegraf.zip -Destination /installation/telegraf
Expand Down
Loading