diff --git a/Dev Guide.md b/Dev Guide.md index 4db81b93da..527d0cf1c5 100644 --- a/Dev Guide.md +++ b/Dev Guide.md @@ -40,10 +40,11 @@ to preserve the overall 15-second metric-scrape limit; upstream's [1.40 documentation](https://github.com/influxdata/telegraf/blob/e9017dc3266369d6fa185e0e130af1d1d4021ce9/plugins/inputs/prometheus/README.md#L152-L157) explains that `response_timeout` now covers headers only, unlike the [1.24.2 client timeout](https://github.com/influxdata/telegraf/blob/9550e7a533dd00632e14435e87ed3eb4b04832c6/plugins/inputs/prometheus/prometheus.go#L254-L261). -Procstat uses `tag_with = ["pid"]` to retain PID tags. Existing `fieldpass`/`fielddrop` -names are unchanged on both OSes because -[1.40 still parses them](https://github.com/influxdata/telegraf/blob/e9017dc3266369d6fa185e0e130af1d1d4021ce9/config/config.go#L1649-L1687). -Linux rendering remains unchanged. Run `ruby build/common/installer/scripts/tomlparser-prom-customconfig_test.rb` +Procstat uses `tag_with = ["pid"]` to retain PID tags. Both OSes render +`fieldinclude`/`fieldexclude` instead of the deprecated `fieldpass`/`fielddrop` +Telegraf options. The public ConfigMap keys remain `fieldpass`/`fielddrop` for +backward compatibility; the shared parser maps them to the current Telegraf names. +Run `ruby build/common/installer/scripts/tomlparser-prom-customconfig_test.rb` for rendering coverage with and without namespace filters. On Windows, set `TELEGRAF_WINDOWS_BINARY` to the extracted `telegraf.exe` to also load the generated configs with that binary in bounded `--test` mode, without Kubernetes access or diff --git a/build/common/installer/scripts/tomlparser-prom-customconfig.rb b/build/common/installer/scripts/tomlparser-prom-customconfig.rb index 4c9bc28703..610d108908 100644 --- a/build/common/installer/scripts/tomlparser-prom-customconfig.rb +++ b/build/common/installer/scripts/tomlparser-prom-customconfig.rb @@ -186,8 +186,6 @@ def createPrometheusPluginsWithNamespaceSetting(monitorKubernetesPods, monitorKu new_contents = new_contents.gsub("$AZMON_TELEGRAF_CUSTOM_PROM_KUBERNETES_FIELD_SELECTOR", "# Commenting this out since new plugins will be created per namespace\n # $AZMON_TELEGRAF_CUSTOM_PROM_KUBERNETES_FIELD_SELECTOR") new_contents = new_contents.gsub("$AZMON_TELEGRAF_CUSTOM_PROM_SCRAPE_SCOPE", "# Commenting this out since new plugins will be created per namespace\n # $AZMON_TELEGRAF_CUSTOM_PROM_SCRAPE_SCOPE") - timeout_config_key = "timeout" - pluginConfigsWithNamespaces = "" podScrapeScope = (@controller.casecmp(@replicaset) == 0) ? "cluster" : "node" monitorKubernetesPodsNamespaces.each do |namespace| @@ -208,11 +206,11 @@ def createPrometheusPluginsWithNamespaceSetting(monitorKubernetesPods, monitorKu monitor_kubernetes_pods_namespace = #{toTomlBasicString(namespace)} kubernetes_label_selector = #{toTomlBasicString(kubernetesLabelSelectors)} kubernetes_field_selector = #{toTomlBasicString(kubernetesFieldSelectors)} - fieldpass = #{fieldPassSetting} - fielddrop = #{fieldDropSetting} + fieldinclude = #{fieldPassSetting} + fieldexclude = #{fieldDropSetting} metric_version = #{@metricVersion} url_tag = #{toTomlBasicString(@urlTag)} - #{timeout_config_key} = #{toTomlBasicString(@responseTimeout)} + timeout = #{toTomlBasicString(@responseTimeout)} tls_ca = #{toTomlBasicString(@tlsCa)} insecure_skip_verify = #{@insecureSkipVerify}\n" end diff --git a/build/common/installer/scripts/tomlparser-prom-customconfig_test.rb b/build/common/installer/scripts/tomlparser-prom-customconfig_test.rb index 2a65f71b58..f2b5b3df49 100644 --- a/build/common/installer/scripts/tomlparser-prom-customconfig_test.rb +++ b/build/common/installer/scripts/tomlparser-prom-customconfig_test.rb @@ -255,19 +255,24 @@ def test_kubernetes_namespace_validation result = run_parser(scenario, configmap_for(scenario, "fieldpass = ['''#{BREAKOUT}''']")) assert_no_injected_plugins(scenario, result[:conf], "the #{scenario} fieldpass array") # The value survives, but only as a single escaped string. - assert_includes collect_values(result[:conf], "fieldpass"), BREAKOUT + assert_includes collect_values(result[:conf], "fieldinclude"), BREAKOUT end define_method("test_fielddrop_breakout_is_neutralized_#{scenario}") do result = run_parser(scenario, configmap_for(scenario, "fielddrop = ['''#{BREAKOUT}''']")) assert_no_injected_plugins(scenario, result[:conf], "the #{scenario} fielddrop array") - assert_includes collect_values(result[:conf], "fielddrop"), BREAKOUT + assert_includes collect_values(result[:conf], "fieldexclude"), BREAKOUT end define_method("test_valid_settings_are_preserved_#{scenario}") do - result = run_parser(scenario, configmap_for(scenario, "interval = \"45s\"\nfieldpass = [\"a\",\"b\"]")) + result = run_parser(scenario, configmap_for(scenario, "interval = \"45s\"\nfieldpass = [\"a\",\"b\"]\nfielddrop = [\"c\"]")) assert_includes result[:conf], "interval = \"45s\"", "a valid interval must be preserved" - assert_includes result[:conf], "fieldpass = [\"a\",\"b\"]", "array formatting must be unchanged" + assert_includes result[:conf], "fieldinclude = [\"a\",\"b\"]", "array formatting must be unchanged" + assert_includes result[:conf], "fieldexclude = [\"c\"]", "array formatting must be unchanged" + parse_generated_toml(result[:conf])["inputs"]["prometheus"].each do |plugin| + refute plugin.key?("fieldpass") + refute plugin.key?("fielddrop") + end assert_no_injected_plugins(scenario, result[:conf], "a benign #{scenario} configuration") end end @@ -333,8 +338,10 @@ def test_namespace_plugins_are_generated_for_valid_namespaces assert_equal "scrapeUrl", plugin["url_tag"] assert_equal "pod_namespace", plugin["pod_namespace_label_name"] assert_equal (scenario == :replicaset ? "cluster" : "node"), plugin["pod_scrape_scope"] - assert_equal ["requests_total"], plugin["fieldpass"] - assert_equal ["debug_total"], plugin["fielddrop"] + assert_equal ["requests_total"], plugin["fieldinclude"] + assert_equal ["debug_total"], plugin["fieldexclude"] + refute plugin.key?("fieldpass") + refute plugin.key?("fielddrop") assert_equal "app=metrics", plugin["kubernetes_label_selector"] assert_equal "spec.nodeName=test-node", plugin["kubernetes_field_selector"] end @@ -375,6 +382,7 @@ def test_windows_rendered_configs_load_in_packaged_telegraf output = readers.map(&:value).join("\n") assert completed, "Telegraf config smoke test exceeded 20 seconds" assert process.value.success?, "Telegraf rejected the rendered config for #{namespaces.inspect}: #{output}" + refute_match(/Deprecation(?:Error|Warning).*"(?:fieldpass|fielddrop|pid_tag)"/, output) end end end @@ -388,7 +396,8 @@ def test_windows_process_metrics_config_preserves_pid_tags_and_fields config["inputs"]["procstat"].each do |plugin| assert_equal ["pid"], plugin["tag_with"] refute plugin.key?("pid_tag") - assert_equal ["cpu_usage", "memory_rss"], plugin["fieldpass"] + assert_equal ["cpu_usage", "memory_rss"], plugin["fieldinclude"] + refute plugin.key?("fieldpass") assert_equal "native", plugin["pid_finder"] assert_equal "agent_telemetry", plugin["name_override"] assert_equal "t.azm.ms/", plugin["name_prefix"] @@ -400,6 +409,51 @@ def test_windows_process_metrics_config_preserves_pid_tags_and_fields ) end + def test_linux_process_metrics_config_preserves_pid_tags_and_fields + path = File.join(REPO_ROOT, "build/linux/installer/conf/telegraf-ama-logs-process-metrics.conf") + config = Tomlrb.load_file(path) + assert_equal({ "telegraf_role" => "ama-logs-process-metrics" }, config["global_tags"]) + assert_equal 9, config["inputs"]["procstat"].length + config["inputs"]["procstat"].each do |plugin| + assert_equal ["pid"], plugin["tag_with"] + refute plugin.key?("pid_tag") + assert_equal ["cpu_usage", "memory_rss"], plugin["fieldinclude"] + refute plugin.key?("fieldpass") + assert_equal "native", plugin["pid_finder"] + assert_equal "agent_telemetry", plugin["name_override"] + assert_equal "t.azm.ms/", plugin["name_prefix"] + assert_equal "$CONTROLLER_TYPE", plugin["tags"]["ControllerType"] + # ORDER matters: renamed keys must stay above [inputs.procstat.tags], otherwise + # TOML binds them to the nested table and telegraf never sees them. + ["tag_with", "fieldinclude"].each do |key| + refute plugin["tags"].key?(key), "#{key} must not be absorbed by [inputs.procstat.tags]" + end + end + assert_equal( + { "ai.cloud.role" => "ControllerType", "ai.cloud.roleInstance" => "PodName" }, + config["outputs"]["application_insights"].first["context_tag_sources"] + ) + end + + # Telegraf treats an unrecognized plugin option as a fatal config-load error, so a single + # reintroduced legacy name silently stops the agent from loading that configuration. + REMOVED_TELEGRAF_OPTIONS = %w[fieldpass fielddrop pid_tag ignore_protocol_stats].freeze + + def test_shipped_telegraf_templates_do_not_use_removed_options + templates = Dir.glob(File.join(REPO_ROOT, "build/{linux,windows}/installer/conf/telegraf*.conf")).sort + refute_empty templates, "expected to find shipped telegraf templates" + + templates.each do |path| + offenders = File.readlines(path).each_with_index.filter_map do |line, index| + stripped = line.strip + next if stripped.empty? || stripped.start_with?("#") + option = REMOVED_TELEGRAF_OPTIONS.find { |name| stripped =~ /\A#{name}\s*=/ } + "#{File.basename(path)}:#{index + 1}: #{stripped}" if option + end + assert_empty offenders, "removed telegraf options must not be used in shipped templates" + end + end + def test_selectors_are_escaped_in_generated_namespace_plugins body = "monitor_kubernetes_pods = true\n" \ "monitor_kubernetes_pods_namespaces = [\"default\"]\n" \ @@ -411,6 +465,28 @@ def test_selectors_are_escaped_in_generated_namespace_plugins assert_equal BREAKOUT, plugin["kubernetes_label_selector"] end + def test_namespace_filters_preserve_modern_keys_and_escaping + [:replicaset, :sidecar, :windows].each do |scenario| + body = "monitor_kubernetes_pods = true\n" \ + "monitor_kubernetes_pods_namespaces = [\"default\"]\n" \ + "fieldpass = ['''#{BREAKOUT}''']\n" \ + "fielddrop = ['''#{BREAKOUT}''']\n" \ + "kubernetes_label_selector = '''#{BREAKOUT}'''\n" \ + "kubernetes_field_selector = '''#{BREAKOUT}'''" + result = run_parser(scenario, configmap_for(scenario, body)) + assert_no_injected_plugins(scenario, result[:conf], "namespaced #{scenario} filters") + plugin = parse_generated_toml(result[:conf])["inputs"]["prometheus"] + .find { |entry| entry["monitor_kubernetes_pods_namespace"] == "default" } + refute_nil plugin + assert_equal [BREAKOUT], plugin["fieldinclude"] + assert_equal [BREAKOUT], plugin["fieldexclude"] + assert_equal BREAKOUT, plugin["kubernetes_label_selector"] + assert_equal BREAKOUT, plugin["kubernetes_field_selector"] + assert_equal(scenario == :replicaset ? "cluster" : "node", plugin["pod_scrape_scope"]) + ["fieldpass", "fielddrop"].each { |key| refute plugin.key?(key), "#{scenario} must not emit #{key}" } + end + end + def monitored_namespaces(conf) parse_generated_toml(conf)["inputs"]["prometheus"] .map { |plugin| plugin["monitor_kubernetes_pods_namespace"] } diff --git a/build/linux/installer/conf/telegraf-ama-logs-process-metrics.conf b/build/linux/installer/conf/telegraf-ama-logs-process-metrics.conf index 02da703021..a22ec03d24 100644 --- a/build/linux/installer/conf/telegraf-ama-logs-process-metrics.conf +++ b/build/linux/installer/conf/telegraf-ama-logs-process-metrics.conf @@ -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" @@ -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" @@ -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" @@ -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" @@ -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" @@ -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" @@ -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" @@ -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" @@ -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" diff --git a/build/linux/installer/conf/telegraf-prom-side-car.conf b/build/linux/installer/conf/telegraf-prom-side-car.conf index 5e1c99ee05..9a7bb0eb15 100644 --- a/build/linux/installer/conf/telegraf-prom-side-car.conf +++ b/build/linux/installer/conf/telegraf-prom-side-car.conf @@ -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" diff --git a/build/linux/installer/conf/telegraf-rs.conf b/build/linux/installer/conf/telegraf-rs.conf index 887e660ccb..12cf533737 100644 --- a/build/linux/installer/conf/telegraf-rs.conf +++ b/build/linux/installer/conf/telegraf-rs.conf @@ -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" @@ -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" diff --git a/build/linux/installer/conf/telegraf.conf b/build/linux/installer/conf/telegraf.conf index 81925e0f0c..ed047284b8 100644 --- a/build/linux/installer/conf/telegraf.conf +++ b/build/linux/installer/conf/telegraf.conf @@ -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 @@ -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 @@ -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 @@ -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" @@ -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" @@ -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" diff --git a/build/linux/installer/scripts/tomlparser-osm-config.rb b/build/linux/installer/scripts/tomlparser-osm-config.rb index e2fdcd289e..0215469149 100644 --- a/build/linux/installer/scripts/tomlparser-osm-config.rb +++ b/build/linux/installer/scripts/tomlparser-osm-config.rb @@ -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}\" diff --git a/build/windows/installer/conf/telegraf-ama-logs-process-metrics.conf b/build/windows/installer/conf/telegraf-ama-logs-process-metrics.conf index 9f004fda13..3a56e1d546 100644 --- a/build/windows/installer/conf/telegraf-ama-logs-process-metrics.conf +++ b/build/windows/installer/conf/telegraf-ama-logs-process-metrics.conf @@ -22,7 +22,7 @@ pid_finder = "native" 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" @@ -38,7 +38,7 @@ pid_finder = "native" 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" @@ -54,7 +54,7 @@ pid_finder = "native" 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" @@ -70,7 +70,7 @@ pid_finder = "native" 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" @@ -86,7 +86,7 @@ pid_finder = "native" 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" @@ -102,7 +102,7 @@ pid_finder = "native" 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" @@ -118,7 +118,7 @@ pid_finder = "native" 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" @@ -134,7 +134,7 @@ pid_finder = "native" 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" @@ -150,7 +150,7 @@ pid_finder = "native" 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" @@ -166,7 +166,7 @@ pid_finder = "native" 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" @@ -182,7 +182,7 @@ pid_finder = "native" 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" diff --git a/build/windows/installer/conf/telegraf.conf b/build/windows/installer/conf/telegraf.conf index 8bf96e3f66..85c645c7d8 100644 --- a/build/windows/installer/conf/telegraf.conf +++ b/build/windows/installer/conf/telegraf.conf @@ -136,8 +136,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" diff --git a/kubernetes/linux/main.sh b/kubernetes/linux/main.sh index 55625148b8..5a3112f450 100644 --- a/kubernetes/linux/main.sh +++ b/kubernetes/linux/main.sh @@ -1245,7 +1245,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" @@ -1257,7 +1257,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" @@ -1268,7 +1268,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"