Skip to content
Merged
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
2 changes: 1 addition & 1 deletion build/common/installer/scripts/tomlparser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def get_command_windows(env_variable_name, env_variable_value)
file.write(commands)
commands = get_command_windows('AZMON_LOG_TAIL_PATH', @logTailPath)
file.write(commands)
commands = get_command_windows('AZMON_LOG_EXCLUSION_REGEX_PATTERN', @stdoutExcludeNamespaces)
commands = get_command_windows('AZMON_LOG_EXCLUSION_REGEX_PATTERN', @logExclusionRegexPattern)
file.write(commands)
commands = get_command_windows('AZMON_STDOUT_EXCLUDED_NAMESPACES', @stdoutExcludeNamespaces)
file.write(commands)
Expand Down
8 changes: 3 additions & 5 deletions build/windows/installer/certificategenerator/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -414,14 +414,12 @@ static void Main(string[] args)

try
{
if (!String.IsNullOrEmpty(Environment.GetEnvironmentVariable("WSKEY")))
{
logAnalyticsWorkspaceSharedKey = Environment.GetEnvironmentVariable("WSKEY");
}
// WSKEY isn't stored as an environment variable
logAnalyticsWorkspaceSharedKey = File.ReadAllText("C:/etc/omsagent-secret/KEY").Trim();
}
catch (Exception ex)
{
Console.WriteLine("Failed to read env variables (WSKEY)" + ex.Message);
Console.WriteLine("Failed to read secret (WSKEY)" + ex.Message);
}

try
Expand Down
12 changes: 10 additions & 2 deletions build/windows/installer/conf/fluent.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

<source>
@type tail
path /var/log/containers/*.log
path "#{ENV['AZMON_LOG_TAIL_PATH']}"
exclude_path "#{ENV['AZMON_CLUSTER_LOG_TAIL_EXCLUDE_PATH']}"
pos_file /var/opt/microsoft/fluent/fluentd-containers.log.pos
tag oms.container.log.la
@log_level trace
Expand All @@ -28,6 +29,14 @@
@include fluent-docker-parser.conf
</source>

<filter oms.container.log.la>
@type grep
<exclude>
key stream
pattern "#{ENV['AZMON_LOG_EXCLUSION_REGEX_PATTERN']}"
</exclude>
</filter>

<filter oms.container.**>
@type record_transformer
# fluent-plugin-record-modifier more light-weight but needs to be installed (dependency worth it?)
Expand All @@ -37,7 +46,6 @@
</record>
</filter>


<match oms.container.**>
@type forward
send_timeout 60s
Expand Down
12 changes: 2 additions & 10 deletions kubernetes/windows/main.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,11 @@ function Set-EnvironmentVariables {
$wsID = Get-Content /etc/omsagent-secret/WSID
}

# Set DOMAIN
# Set WSID
[System.Environment]::SetEnvironmentVariable("WSID", $wsID, "Process")
[System.Environment]::SetEnvironmentVariable("WSID", $wsID, "Machine")

$wsKey = ""
if (Test-Path /etc/omsagent-secret/KEY) {
# TODO: Change to omsagent-secret before merging
$wsKey = Get-Content /etc/omsagent-secret/KEY
}

# Set KEY
[System.Environment]::SetEnvironmentVariable("WSKEY", $wsKey, "Process")
[System.Environment]::SetEnvironmentVariable("WSKEY", $wsKey, "Machine")
# Don't store WSKEY as environment variable

$proxy = ""
if (Test-Path /etc/omsagent-secret/PROXY) {
Expand Down
12 changes: 10 additions & 2 deletions source/plugins/ruby/filter_cadvisor2mdm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,16 @@ def ensure_cpu_memory_capacity_set
end
elsif controller_type.downcase == "daemonset"
capacity_from_kubelet = KubeletUtils.get_node_capacity
@cpu_capacity = capacity_from_kubelet[0]
@memory_capacity = capacity_from_kubelet[1]

# Error handling in case /metrics/cadvsior endpoint fails
if !capacity_from_kubelet.nil? && capacity_from_kubelet.length > 1
@cpu_capacity = capacity_from_kubelet[0]
@memory_capacity = capacity_from_kubelet[1]
else
# cpu_capacity and memory_capacity keep initialized value of 0.0
@log.error "Error getting capacity_from_kubelet: cpu_capacity and memory_capacity"
end

end
end

Expand Down