Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimize agent telemetry #1329

Merged
merged 2 commits into from
Oct 4, 2024
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
12 changes: 10 additions & 2 deletions source/plugins/go/input/lib/cadvisor.go
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,11 @@ func getContainerCpuMetricItemRate(metricInfo map[string]interface{}, hostName,
telemetryProps["clusterenvvars"] = os.Getenv("AZMON_CLUSTER_COLLECT_ENV_VAR")
telemetryProps["clusterstderrlogs"] = os.Getenv("AZMON_CLUSTER_COLLECT_STDERR_LOGS")
telemetryProps["clusterstdoutlogs"] = os.Getenv("AZMON_CLUSTER_COLLECT_STDOUT_LOGS")
telemetryProps["clusterlogtailexcludepath"] = os.Getenv("AZMON_CLUSTER_LOG_TAIL_EXCLUDE_PATH")
clusterlogtailexcludepath := os.Getenv("AZMON_CLUSTER_LOG_TAIL_EXCLUDE_PATH")
// Limit the length of the clusterlogtailexcludepath to 1KB since it can impact telemetry ingestion
if len(clusterlogtailexcludepath) <= 1024 {
telemetryProps["clusterlogtailexcludepath"] = clusterlogtailexcludepath
}
telemetryProps["clusterLogTailPath"] = os.Getenv("AZMON_LOG_TAIL_PATH")
telemetryProps["clusterAgentSchemaVersion"] = os.Getenv("AZMON_AGENT_CFG_SCHEMA_VERSION")
telemetryProps["clusterCLEnrich"] = os.Getenv("AZMON_CLUSTER_CONTAINER_LOG_ENRICH")
Expand Down Expand Up @@ -1030,7 +1034,11 @@ func getContainerCpuMetricItems(metricInfo map[string]interface{}, hostName, met
telemetryProps["clusterenvvars"] = os.Getenv("AZMON_CLUSTER_COLLECT_ENV_VAR")
telemetryProps["clusterstderrlogs"] = os.Getenv("AZMON_CLUSTER_COLLECT_STDERR_LOGS")
telemetryProps["clusterstdoutlogs"] = os.Getenv("AZMON_CLUSTER_COLLECT_STDOUT_LOGS")
telemetryProps["clusterlogtailexcludepath"] = os.Getenv("AZMON_CLUSTER_LOG_TAIL_EXCLUDE_PATH")
clusterlogtailexcludepath := os.Getenv("AZMON_CLUSTER_LOG_TAIL_EXCLUDE_PATH")
// Limit the length of the clusterlogtailexcludepath to 1KB since it can impact telemetry ingestion
if len(clusterlogtailexcludepath) <= 1024 {
telemetryProps["clusterlogtailexcludepath"] = clusterlogtailexcludepath
}
telemetryProps["clusterLogTailPath"] = os.Getenv("AZMON_LOG_TAIL_PATH")
telemetryProps["clusterAgentSchemaVersion"] = os.Getenv("AZMON_AGENT_CFG_SCHEMA_VERSION")
telemetryProps["clusterCLEnrich"] = os.Getenv("AZMON_CLUSTER_CONTAINER_LOG_ENRICH")
Expand Down
10 changes: 8 additions & 2 deletions source/plugins/ruby/CAdvisorMetricsAPIClient.rb
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,10 @@ def getContainerCpuMetricItems(metricJSON, hostName, cpuMetricNameToCollect, met
telemetryProps["clusterenvvars"] = @clusterEnvVarCollectionEnabled
telemetryProps["clusterstderrlogs"] = @clusterStdErrLogCollectionEnabled
telemetryProps["clusterstdoutlogs"] = @clusterStdOutLogCollectionEnabled
telemetryProps["clusterlogtailexcludepath"] = @clusterLogTailExcludPath
# Limit the length of the clusterlogtailexcludepath to 1KB since it can impact telemetry ingestion
if ([email protected]? && [email protected]? && @clusterLogTailExcludPath.size <= 1024)
telemetryProps["clusterlogtailexcludepath"] = @clusterLogTailExcludPath
end
telemetryProps["clusterLogTailPath"] = @clusterLogTailPath
telemetryProps["clusterAgentSchemaVersion"] = @clusterAgentSchemaVersion
telemetryProps["clusterCLEnrich"] = @clusterContainerLogEnrich
Expand Down Expand Up @@ -629,7 +632,10 @@ def getContainerCpuMetricItemRate(metricJSON, hostName, cpuMetricNameToCollect,
telemetryProps["clusterenvvars"] = @clusterEnvVarCollectionEnabled
telemetryProps["clusterstderrlogs"] = @clusterStdErrLogCollectionEnabled
telemetryProps["clusterstdoutlogs"] = @clusterStdOutLogCollectionEnabled
telemetryProps["clusterlogtailexcludepath"] = @clusterLogTailExcludPath
# Limit the length of the clusterlogtailexcludepath to 1KB since it can impact telemetry ingestion
if ([email protected]? && [email protected]? && @clusterLogTailExcludPath.size <= 1024)
telemetryProps["clusterlogtailexcludepath"] = @clusterLogTailExcludPath
end
telemetryProps["clusterLogTailPath"] = @clusterLogTailPath
telemetryProps["clusterAgentSchemaVersion"] = @clusterAgentSchemaVersion
telemetryProps["clusterCLEnrich"] = @clusterContainerLogEnrich
Expand Down
Loading