Skip to content

Commit

Permalink
fixing yamls
Browse files Browse the repository at this point in the history
  • Loading branch information
Paramadon committed Dec 16, 2024
1 parent 1a4d9bd commit 5f53ae5
Show file tree
Hide file tree
Showing 29 changed files with 156 additions and 152 deletions.
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ linters:
- goimports
- gosec
- gosimple
- govet
- ineffassign
- misspell
- revive
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ WIN_BUILD = GOOS=windows GOARCH=amd64 go build -trimpath -buildmode=${CWAGENT_BU
DARWIN_BUILD_AMD64 = CGO_ENABLED=1 GO111MODULE=on GOOS=darwin GOARCH=amd64 go build -trimpath -ldflags="${LDFLAGS}" -o $(BUILD_SPACE)/bin/darwin_amd64
DARWIN_BUILD_ARM64 = CGO_ENABLED=1 GO111MODULE=on GOOS=darwin GOARCH=arm64 go build -trimpath -ldflags="${LDFLAGS}" -o $(BUILD_SPACE)/bin/darwin_arm64

IMAGE_REGISTRY = amazon
IMAGE_REPO = cloudwatch-agent
IMAGE_TAG = $(VERSION)
IMAGE_REGISTRY = 730335384949.dkr.ecr.us-west-2.amazonaws.com
IMAGE_REPO = cwagent
IMAGE_TAG = latest
IMAGE = $(IMAGE_REGISTRY)/$(IMAGE_REPO):$(IMAGE_TAG)
DOCKER_BUILD_FROM_SOURCE = docker build -t $(IMAGE) -f ./amazon-cloudwatch-container-insights/cloudwatch-agent-dockerfile/source/Dockerfile
DOCKER_WINDOWS_BUILD_FROM_SOURCE = docker build -t $(IMAGE) -f ./amazon-cloudwatch-container-insights/cloudwatch-agent-dockerfile/source/Dockerfile.Windows
Expand Down
13 changes: 0 additions & 13 deletions plugins/processors/awsentity/processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,6 @@ func newAddToMockEntityStore(rs *mockEntityStore) func(entitystore.LogGroupName,
}
}

func newMockGetMetricAttributesFromEntityStore() func() map[string]*string {
mockPlatform := "AWS::EC2"
mockInstanceID := "i-123456789"
mockAutoScalingGroup := "auto-scaling"
return func() map[string]*string {
return map[string]*string{
entitystore.PlatformType: &mockPlatform,
entitystore.InstanceIDKey: &mockInstanceID,
entitystore.ASGKey: &mockAutoScalingGroup,
}
}
}

func newMockGetServiceNameAndSource(service, source string) func() (string, string) {
return func() (string, string) {
return service, source
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@ processors:
ec2_instance_tag_keys:
- AutoScalingGroupName
ec2_metadata_tags:
- InstanceId
- InstanceType
- ImageId
- InstanceId
imds_retries: 1
middleware: agenthealth/statuscode
refresh_interval_seconds: 0s
receivers:
telegraf_cpu:
Expand Down Expand Up @@ -88,11 +89,11 @@ service:
- awsentity/resource
- ec2tagger
receivers:
- telegraf_swap
- telegraf_cpu
- telegraf_disk
- telegraf_mem
- telegraf_netstat
- telegraf_swap
- telegraf_cpu
metrics/hostDeltaMetrics:
exporters:
- awscloudwatch
Expand Down
5 changes: 3 additions & 2 deletions translator/tocwconfig/sampleConfig/advanced_config_linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ processors:
- InstanceId
- InstanceType
imds_retries: 1
middleware: agenthealth/statuscode
refresh_interval_seconds: 0s
receivers:
telegraf_cpu:
Expand Down Expand Up @@ -96,13 +97,13 @@ service:
- awsentity/resource
- ec2tagger
receivers:
- telegraf_swap
- telegraf_ethtool
- telegraf_nvidia_smi
- telegraf_cpu
- telegraf_disk
- telegraf_mem
- telegraf_netstat
- telegraf_swap
- telegraf_ethtool
metrics/hostDeltaMetrics:
exporters:
- awscloudwatch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ processors:
- InstanceId
- InstanceType
imds_retries: 1
middleware: agenthealth/statuscode
refresh_interval_seconds: 0s
receivers:
telegraf_win_perf_counters/1492679118:
Expand Down Expand Up @@ -89,13 +90,13 @@ service:
- awsentity/resource
- ec2tagger
receivers:
- telegraf_win_perf_counters/3446270237
- telegraf_win_perf_counters/3762679655
- telegraf_win_perf_counters/2073218482
- telegraf_win_perf_counters/2039663244
- telegraf_win_perf_counters/4283769065
- telegraf_win_perf_counters/1492679118
- telegraf_win_perf_counters/3610923661
- telegraf_win_perf_counters/3446270237
- telegraf_win_perf_counters/3762679655
telemetry:
logs:
development: false
Expand Down
3 changes: 2 additions & 1 deletion translator/tocwconfig/sampleConfig/amp_config_linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,11 @@ processors:
ec2_instance_tag_keys:
- AutoScalingGroupName
ec2_metadata_tags:
- ImageId
- InstanceId
- InstanceType
- ImageId
imds_retries: 1
middleware: agenthealth/statuscode
refresh_interval_seconds: 0s
rollup:
attribute_groups:
Expand Down
1 change: 1 addition & 0 deletions translator/tocwconfig/sampleConfig/basic_config_linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ processors:
- InstanceId
- InstanceType
imds_retries: 1
middleware: agenthealth/statuscode
refresh_interval_seconds: 0s
receivers:
telegraf_disk:
Expand Down
3 changes: 2 additions & 1 deletion translator/tocwconfig/sampleConfig/basic_config_windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@ processors:
ec2_instance_tag_keys:
- AutoScalingGroupName
ec2_metadata_tags:
- InstanceType
- ImageId
- InstanceId
- InstanceType
imds_retries: 1
middleware: agenthealth/statuscode
refresh_interval_seconds: 0s
receivers:
telegraf_win_perf_counters/1492679118:
Expand Down
3 changes: 2 additions & 1 deletion translator/tocwconfig/sampleConfig/compass_linux_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@ processors:
ec2_instance_tag_keys:
- AutoScalingGroupName
ec2_metadata_tags:
- ImageId
- InstanceId
- InstanceType
- ImageId
imds_retries: 1
middleware: agenthealth/statuscode
refresh_interval_seconds: 0s
receivers:
telegraf_socket_listener:
Expand Down
13 changes: 7 additions & 6 deletions translator/tocwconfig/sampleConfig/complete_darwin_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ processors:
- InstanceId
- InstanceType
imds_retries: 1
middleware: agenthealth/statuscode
refresh_interval_seconds: 0s
transform:
error_mode: propagate
Expand All @@ -145,11 +146,11 @@ processors:
metric_statements:
- context: metric
statements:
- set(unit, "unit") where name == "disk_free"
- set(name, "DISK_FREE") where name == "disk_free"
- set(unit, "unit") where name == "cpu_usage_idle"
- set(name, "CPU_USAGE_IDLE") where name == "cpu_usage_idle"
- set(unit, "unit") where name == "cpu_usage_nice"
- set(unit, "unit") where name == "disk_free"
- set(name, "DISK_FREE") where name == "disk_free"
trace_statements: []
receivers:
awsxray:
Expand Down Expand Up @@ -283,12 +284,12 @@ service:
- ec2tagger
- transform
receivers:
- telegraf_swap
- telegraf_netstat
- telegraf_disk
- telegraf_mem
- telegraf_processes
- telegraf_procstat/1917393364
- telegraf_mem
- telegraf_swap
- telegraf_cpu
metrics/hostCustomMetrics:
exporters:
Expand All @@ -298,8 +299,8 @@ service:
- ec2tagger
- transform
receivers:
- telegraf_socket_listener
- telegraf_statsd
- telegraf_socket_listener
metrics/hostDeltaMetrics:
exporters:
- awscloudwatch
Expand All @@ -309,8 +310,8 @@ service:
- ec2tagger
- transform
receivers:
- telegraf_diskio
- telegraf_net
- telegraf_diskio
traces/xray:
exporters:
- awsxray
Expand Down
15 changes: 8 additions & 7 deletions translator/tocwconfig/sampleConfig/complete_linux_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ processors:
- InstanceId
- InstanceType
imds_retries: 1
middleware: agenthealth/statuscode
refresh_interval_seconds: 0s
filter/jmx/0:
error_mode: propagate
Expand Down Expand Up @@ -197,11 +198,11 @@ processors:
metric_statements:
- context: metric
statements:
- set(unit, "unit") where name == "disk_free"
- set(name, "DISK_FREE") where name == "disk_free"
- set(unit, "unit") where name == "cpu_usage_idle"
- set(name, "CPU_USAGE_IDLE") where name == "cpu_usage_idle"
- set(unit, "unit") where name == "cpu_usage_nice"
- set(unit, "unit") where name == "disk_free"
- set(name, "DISK_FREE") where name == "disk_free"
trace_statements: []
transform/jmx/0:
error_mode: propagate
Expand Down Expand Up @@ -390,13 +391,13 @@ service:
- ec2tagger
- transform
receivers:
- telegraf_netstat
- telegraf_disk
- telegraf_processes
- telegraf_cpu
- telegraf_mem
- telegraf_procstat/1917393364
- telegraf_swap
- telegraf_procstat/1917393364
- telegraf_disk
- telegraf_netstat
- telegraf_mem
metrics/hostCustomMetrics/cloudwatch:
exporters:
- awscloudwatch
Expand All @@ -416,8 +417,8 @@ service:
- ec2tagger
- transform
receivers:
- telegraf_diskio
- telegraf_net
- telegraf_diskio
metrics/jmx/cloudwatch/0:
exporters:
- awscloudwatch
Expand Down
3 changes: 2 additions & 1 deletion translator/tocwconfig/sampleConfig/delta_config_linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@ processors:
ec2_instance_tag_keys:
- AutoScalingGroupName
ec2_metadata_tags:
- ImageId
- InstanceId
- InstanceType
- ImageId
imds_retries: 1
middleware: agenthealth/statuscode
refresh_interval_seconds: 0s
transform:
error_mode: propagate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@ processors:
ec2_instance_tag_keys:
- AutoScalingGroupName
ec2_metadata_tags:
- ImageId
- InstanceId
- InstanceType
- ImageId
imds_retries: 1
middleware: agenthealth/statuscode
refresh_interval_seconds: 0s
receivers:
telegraf_net:
Expand Down
3 changes: 2 additions & 1 deletion translator/tocwconfig/sampleConfig/drop_origin_linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ processors:
ec2_instance_tag_keys:
- AutoScalingGroupName
ec2_metadata_tags:
- ImageId
- InstanceId
- InstanceType
- ImageId
imds_retries: 1
middleware: agenthealth/statuscode
refresh_interval_seconds: 0s
transform:
error_mode: propagate
Expand Down
Loading

0 comments on commit 5f53ae5

Please sign in to comment.