Skip to content

Commit 2b0e156

Browse files
authored
Revert "Gangams/windows telegraf update (#1359)" (#1363)
This reverts commit 9a8808d.
1 parent d20d49a commit 2b0e156

File tree

5 files changed

+10
-15
lines changed

5 files changed

+10
-15
lines changed

build/common/installer/scripts/tomlparser-prom-customconfig.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@ def createPrometheusPluginsWithNamespaceSetting(monitorKubernetesPods, monitorKu
114114
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")
115115

116116
timeout_config_key = "timeout"
117+
if is_windows?
118+
# For windows, the timeout config key is different because of old version of telegraf
119+
timeout_config_key = "response_timeout"
120+
end
121+
117122
pluginConfigsWithNamespaces = ""
118123
monitorKubernetesPodsNamespaces.each do |namespace|
119124
if !namespace.nil?

build/windows/installer/conf/telegraf.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
#Prometheus Custom Metrics
125125
[[inputs.prometheus]]
126126
interval = "$AZMON_TELEGRAF_CUSTOM_PROM_INTERVAL"
127-
127+
128128
## Scrape Kubernetes pods for the following prometheus annotations:
129129
## - prometheus.io/scrape: Enable scraping for this pod
130130
## - prometheus.io/scheme: If the metrics endpoint is secured then you will need to
@@ -150,7 +150,7 @@
150150
# bearer_token_string = "abc_123"
151151

152152
## Specify timeout duration for slower prometheus clients (default is 3s)
153-
timeout = "15s"
153+
response_timeout = "15s"
154154

155155
## Optional TLS Config
156156
tls_ca = "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"

kubernetes/windows/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ ENV APPLICATIONINSIGHTS_AUTH "NzAwZGM5OGYtYTdhZC00NThkLWI5NWMtMjA3ZjM3NmM3YmRi"
102102
ENV AZMON_COLLECT_ENV False
103103
ENV CI_CERT_LOCATION "C://oms.crt"
104104
ENV CI_KEY_LOCATION "C://oms.key"
105-
ENV TELEGRAF_CONFIG_PATH "/etc/telegraf/telegraf.conf"
106105

107106
# Delete unnecessary files
108107
RUN powershell -Command "Remove-Item -Recurse -Force 'C:\ruby31\share\doc\ruby\html\js'; \

kubernetes/windows/main.ps1

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -812,15 +812,6 @@ function Start-Telegraf {
812812
Write-Host "Failed to set environment variable NODE_IP for target 'machine' since it is either null or empty"
813813
}
814814

815-
$telegrafConfigPath = [System.Environment]::GetEnvironmentVariable("TELEGRAF_CONFIG_PATH", "process")
816-
if (![string]::IsNullOrEmpty($telegrafConfigPath)) {
817-
[System.Environment]::SetEnvironmentVariable("TELEGRAF_CONFIG_PATH", $telegrafConfigPath, "machine")
818-
Write-Host "Successfully set environment variable TELEGRAF_CONFIG_PATH - $($telegrafConfigPath) for target 'machine'..."
819-
}
820-
else {
821-
Write-Host "Failed to set environment variable TELEGRAF_CONFIG_PATH for target 'machine' since it is either null or empty"
822-
}
823-
824815
$hostName = [System.Environment]::GetEnvironmentVariable("HOSTNAME", "process")
825816
Write-Host "nodename: $($hostName)"
826817
Write-Host "replacing nodename in telegraf config"
@@ -852,8 +843,8 @@ function Start-Telegraf {
852843
}
853844
Write-Host "Running telegraf service in test mode"
854845
C:\opt\telegraf\telegraf.exe --config "C:\etc\telegraf\telegraf.conf" --test
855-
Write-Host "Starting telegraf service with auto restart"
856-
C:\opt\telegraf\telegraf.exe --service-auto-restart
846+
Write-Host "Starting telegraf service"
847+
C:\opt\telegraf\telegraf.exe --service start
857848

858849
# Trying to start telegraf again if it did not start due to fluent bit not being ready at startup
859850
Get-Service telegraf | findstr Running

kubernetes/windows/setup.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Write-Host ('Finished Installing Fluentbit')
4242
Write-Host ('Installing Telegraf');
4343
try {
4444
# For next telegraf update, make sure to update config changes in telegraf.conf, tomlparser-prom-customconfig.rb and tomlparser-osm-config.rb
45-
$telegrafUri='https://dl.influxdata.com/telegraf/releases/telegraf-1.33.1_windows_amd64.zip'
45+
$telegrafUri='https://dl.influxdata.com/telegraf/releases/telegraf-1.24.2_windows_amd64.zip'
4646
Invoke-WebRequest -Uri $telegrafUri -OutFile /installation/telegraf.zip
4747
Expand-Archive -Path /installation/telegraf.zip -Destination /installation/telegraf
4848
Move-Item -Path /installation/telegraf/*/* -Destination /opt/telegraf/ -ErrorAction SilentlyContinue

0 commit comments

Comments
 (0)