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
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,22 @@

[[inputs.procstat]]
name_prefix = "t.azm.ms/"
exe = "telegraf"
pattern = "telegraf --"
interval = "60s"
pid_finder = "native"
pid_tag = true
name_override = "agent_telemetry"
fieldpass = ["cpu_usage", "memory_rss"]
[inputs.procstat.tags]
Computer = "placeholder_hostname"
PodName = "placeholder_podname"
AgentVersion = "$AGENT_VERSION"
ControllerType = "$CONTROLLER_TYPE"
AksResourceId = "$AKS_RESOURCE_ID"

[[inputs.procstat]]
name_prefix = "t.azm.ms/"
pattern = "telegraf-process-metrics"
interval = "60s"
pid_finder = "native"
pid_tag = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,22 @@

[[inputs.procstat]]
name_prefix = "t.azm.ms/"
exe = "telegraf"
pattern = "telegraf.exe --"
interval = "60s"
pid_finder = "native"
pid_tag = true
name_override = "agent_telemetry"
fieldpass = ["cpu_usage", "memory_rss"]
[inputs.procstat.tags]
Computer = "placeholder_hostname"
PodName = "placeholder_podname"
AgentVersion = "$AGENT_VERSION"
ControllerType = "DaemonSet-Windows"
AksResourceId = "placeholder_aksresourceid"

[[inputs.procstat]]
name_prefix = "t.azm.ms/"
pattern = "telegraf-process-metrics"
interval = "60s"
pid_finder = "native"
pid_tag = true
Expand Down
4 changes: 3 additions & 1 deletion kubernetes/linux/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1413,7 +1413,9 @@ if [ "${AZMON_COLLECT_AMA_LOGS_PROCESS_METRICS}" == "true" ]; then
appinsightsKey=$(echo "$APPLICATIONINSIGHTS_AUTH" | base64 -d | tr -d '\n')
sed -i -e "s/placeholder_appinsights_key/$appinsightsKey/g" $amaLogsProcessMetricsConfFile
# Use /proc so telegraf only collect process metrics inside ama-logs containers.
HOST_PROC=/proc /opt/telegraf --non-strict-env-handling --config $amaLogsProcessMetricsConfFile &
# Create symlink to give this telegraf instance a distinct process name
ln -sf /opt/telegraf /opt/telegraf-process-metrics
HOST_PROC=/proc /opt/telegraf-process-metrics --non-strict-env-handling --config $amaLogsProcessMetricsConfFile &
else
echo "APPLICATIONINSIGHTS_AUTH or AKS_RESOURCE_ID not set, skipping ama-logs process metrics monitoring"
fi
Expand Down
6 changes: 4 additions & 2 deletions kubernetes/windows/main.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -883,8 +883,10 @@ function Start-Fluent-Telegraf {
$appInsightsKey = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($appInsightsAuth)).Trim()
(Get-Content $amaLogsProcessMetricsConfFile).replace('placeholder_appinsights_key', $appInsightsKey) | Set-Content $amaLogsProcessMetricsConfFile
Write-Host "Starting telegraf for collecting process metrics inside ama-logs containers (Windows)"
C:\opt\telegraf\telegraf.exe --service install --service-name telegraf-ama-logs-process-metrics --config $amaLogsProcessMetricsConfFile
C:\opt\telegraf\telegraf.exe --service start --service-name telegraf-ama-logs-process-metrics
# Create symlink to give this telegraf instance a distinct process name
New-Item -ItemType SymbolicLink -Path "C:\opt\telegraf\telegraf-process-metrics.exe" -Target "C:\opt\telegraf\telegraf.exe" -Force
C:\opt\telegraf\telegraf-process-metrics.exe --service install --service-name telegraf-ama-logs-process-metrics --config $amaLogsProcessMetricsConfFile
C:\opt\telegraf\telegraf-process-metrics.exe --service start --service-name telegraf-ama-logs-process-metrics
} else {
Write-Host "APPLICATIONINSIGHTS_AUTH or AKS_RESOURCE_ID not set, skipping ama-logs process metrics monitoring"
}
Expand Down
Loading