From 7e50e6931be5eeb5956d31dd868e76875918f350 Mon Sep 17 00:00:00 2001 From: Maurice Meyer Date: Mon, 16 Sep 2024 11:15:28 +0200 Subject: [PATCH 1/3] chore: bump yet-another-cloudwatch-exporter to v0.61.0 This bumps yet-another-cloudwatch-exporter to v0.61.0, which fixes [an issue with S3 metrics being reported as `NaN`](https://github.com/nerdswords/yet-another-cloudwatch-exporter/issues/728). Affected metrics have a value of `0` in the scraped prometheus metrics. With the update to v0.61.0, they are reported correctly. --- CHANGELOG.md | 7 +++++++ go.mod | 23 ++++++++++++----------- go.sum | 46 ++++++++++++++++++++++++---------------------- 3 files changed, 43 insertions(+), 33 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c6348eb57f..e7a1eb05cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,13 @@ internal API changes are not present. Main (unreleased) ----------------- +### Bugfixes + + +- Update yet-another-cloudwatch-exporter from v0.60.0 vo v0.61.0: (@morreymeyer) + - Fixes a bug where cloudwatch S3 metrics are reported as `0` + + v1.4.0-rc.0 ----------------- diff --git a/go.mod b/go.mod index fe5a3f8ab1..6dd41ac08f 100644 --- a/go.mod +++ b/go.mod @@ -100,7 +100,7 @@ require ( github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f github.com/natefinch/atomic v1.0.1 github.com/ncabatoff/process-exporter v0.7.10 - github.com/nerdswords/yet-another-cloudwatch-exporter v0.60.0 + github.com/nerdswords/yet-another-cloudwatch-exporter v0.61.0 github.com/oklog/run v1.1.0 github.com/olekukonko/tablewriter v0.0.5 github.com/oliver006/redis_exporter v1.54.0 @@ -398,23 +398,23 @@ require ( github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.16 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 // indirect github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.0 // indirect - github.com/aws/aws-sdk-go-v2/service/amp v1.25.5 // indirect - github.com/aws/aws-sdk-go-v2/service/apigateway v1.23.7 // indirect - github.com/aws/aws-sdk-go-v2/service/apigatewayv2 v1.20.5 // indirect - github.com/aws/aws-sdk-go-v2/service/autoscaling v1.40.6 // indirect - github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.38.1 // indirect - github.com/aws/aws-sdk-go-v2/service/databasemigrationservice v1.38.5 // indirect - github.com/aws/aws-sdk-go-v2/service/ec2 v1.161.1 // indirect + github.com/aws/aws-sdk-go-v2/service/amp v1.26.1 // indirect + github.com/aws/aws-sdk-go-v2/service/apigateway v1.24.1 // indirect + github.com/aws/aws-sdk-go-v2/service/apigatewayv2 v1.21.1 // indirect + github.com/aws/aws-sdk-go-v2/service/autoscaling v1.41.1 // indirect + github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.39.1 // indirect + github.com/aws/aws-sdk-go-v2/service/databasemigrationservice v1.39.1 // indirect + github.com/aws/aws-sdk-go-v2/service/ec2 v1.165.1 // indirect github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.4 // indirect github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.0 // indirect github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.18 // indirect github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.0 // indirect - github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi v1.21.5 // indirect + github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi v1.22.1 // indirect github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.27.0 // indirect - github.com/aws/aws-sdk-go-v2/service/shield v1.25.5 // indirect + github.com/aws/aws-sdk-go-v2/service/shield v1.26.1 // indirect github.com/aws/aws-sdk-go-v2/service/sso v1.22.5 // indirect github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.5 // indirect - github.com/aws/aws-sdk-go-v2/service/storagegateway v1.27.5 // indirect + github.com/aws/aws-sdk-go-v2/service/storagegateway v1.30.1 // indirect github.com/aws/aws-sdk-go-v2/service/sts v1.30.4 // indirect github.com/aws/smithy-go v1.20.4 // indirect github.com/axiomhq/hyperloglog v0.0.0-20240124082744-24bca3a5b39b // indirect @@ -813,6 +813,7 @@ require ( ) require ( + github.com/aws/aws-sdk-go-v2/service/iam v1.33.1 // indirect github.com/checkpoint-restore/go-criu/v6 v6.3.0 // indirect github.com/containerd/platforms v0.2.1 // indirect ) diff --git a/go.sum b/go.sum index 92e8705aec..e3fafbf894 100644 --- a/go.sum +++ b/go.sum @@ -503,21 +503,23 @@ github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 h1:VaRN3TlFdd6KxX1x3ILT5ynH6HvK github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1/go.mod h1:FbtygfRFze9usAadmnGJNc8KsP346kEe+y2/oyhGAGc= github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.0 h1:TkbRExyKSVHELwG9gz2+gql37jjec2R5vus9faTomwE= github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.0/go.mod h1:T3/9xMKudHhnj8it5EqIrhvv11tVZqWYkKcot+BFStc= -github.com/aws/aws-sdk-go-v2/service/amp v1.25.5 h1:OV/xhdkvG4rY7lcEBPS9pPbT83ezxXE+gM9nVA1OHWU= -github.com/aws/aws-sdk-go-v2/service/amp v1.25.5/go.mod h1:i5BA2ACkXa8Pzqinz/xEukdVJnMdfQLRcx7ftb5g0pk= -github.com/aws/aws-sdk-go-v2/service/apigateway v1.23.7 h1:VOV21NHMzI0OgywTq2iY9UnXIpH4j4s3pa4ensk8Hh8= -github.com/aws/aws-sdk-go-v2/service/apigateway v1.23.7/go.mod h1:3h9BDpayKgNNrpHZBvL7gCIeikqiE7oBxGGcrzmtLAM= -github.com/aws/aws-sdk-go-v2/service/apigatewayv2 v1.20.5 h1:nk9qRsqcLik5FycE6+y16Xj46oCnoMc0Gp8Q2RHOCpg= -github.com/aws/aws-sdk-go-v2/service/apigatewayv2 v1.20.5/go.mod h1:PkfhkgYj7XKPO/kGyF7s4DC5ZVrxfHoWDD+rrxobLMg= +github.com/aws/aws-sdk-go-v2/service/amp v1.26.1 h1:svGkgUKZDc5SNSiP6BgcOe/6sPmwBniltU6uHmxrjqo= +github.com/aws/aws-sdk-go-v2/service/amp v1.26.1/go.mod h1:mBtHxQRTrzQB0G5oap7IcgP9Ny5p9BJSGhWnuQ+35EY= +github.com/aws/aws-sdk-go-v2/service/apigateway v1.24.1 h1:20jy3+l7bQA6tJ1nJxg8+l+1Xm9KrDslNVvc8HvLoEI= +github.com/aws/aws-sdk-go-v2/service/apigateway v1.24.1/go.mod h1:gcUX4UmbhON3+0ij28aojD7vaMPqsRYFefqwxCLbUnw= +github.com/aws/aws-sdk-go-v2/service/apigatewayv2 v1.21.1 h1:qbbxz47vQdGzvLeHS8xmvp3shV0n8cAnmred+Ehj6qQ= +github.com/aws/aws-sdk-go-v2/service/apigatewayv2 v1.21.1/go.mod h1:3tgssMs7RA6rZoI6K9w6Nc6gCmhadTFAOU+OXh4tPkQ= github.com/aws/aws-sdk-go-v2/service/appconfig v1.4.2/go.mod h1:FZ3HkCe+b10uFZZkFdvf98LHW21k49W8o8J366lqVKY= -github.com/aws/aws-sdk-go-v2/service/autoscaling v1.40.6 h1:IDoEdCkKRy7iPlRVSuDATGE57xUjrk5i1M9eWPYwr/Y= -github.com/aws/aws-sdk-go-v2/service/autoscaling v1.40.6/go.mod h1:ZErgk/bPaaZIpj+lUWGlwI1A0UFhSIscgnCPzTLnb2s= -github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.38.1 h1:Lrq1Tuj+tA569WQzuESkm/rUfhIQMmNoZW6rRuZVHVI= -github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.38.1/go.mod h1:U12sr6Lt14X96f16t+rR52+2BdqtydwN7DjEEHRMjO0= -github.com/aws/aws-sdk-go-v2/service/databasemigrationservice v1.38.5 h1:V97n9sqRIMhQP4GuB3xOBOTsg/41uLo3jyewvHSjxwE= -github.com/aws/aws-sdk-go-v2/service/databasemigrationservice v1.38.5/go.mod h1:hTZS15Gghi40UxU03Cv09Qr2tXgoQrZOSGY6oaNUNAg= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.161.1 h1:NbjXshriDs5bGeqKvrOF70L41X0aCMC60ImN2vkcQAc= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.161.1/go.mod h1:xejKuuRDjz6z5OqyeLsz01MlOqqW7CqpAB4PabNvpu8= +github.com/aws/aws-sdk-go-v2/service/autoscaling v1.41.1 h1:ZNokD9M3On22Qscssyi3iQAzkoeOJxnE5NANNCzPzIA= +github.com/aws/aws-sdk-go-v2/service/autoscaling v1.41.1/go.mod h1:5XY8CFGBv6dZp/thbk8FRIAWjqNckM7PsL848KHdzjI= +github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.39.1 h1:U2qFeD0atfYsNMX7pVPvTG+vI7jCoelcWomOK7F8b34= +github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.39.1/go.mod h1:6cstKfQIguQDuWrHKYhjod025+J7n0AR+azv5t9HYBY= +github.com/aws/aws-sdk-go-v2/service/databasemigrationservice v1.39.1 h1:4NU35PwZufWYLQV1JD43Z2ZGmTSv35250dNYEgrZaRs= +github.com/aws/aws-sdk-go-v2/service/databasemigrationservice v1.39.1/go.mod h1:vKjaBNIcIPOlhBc4+lei/hFnPl7GNDCnkSnGFuKQ0Xg= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.165.1 h1:LkSnU1c9JKJyXYcwpWgQGuwctwv3pDenMUgH2CmLd1A= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.165.1/go.mod h1:Wv7N3iFOKVsZNIaw9MOBUmwCkX6VMmQQRFhMrHtNGno= +github.com/aws/aws-sdk-go-v2/service/iam v1.33.1 h1:0dcMo3330L9LIckl+4iujMoq0AdR8LMK0TtgrjHUi6M= +github.com/aws/aws-sdk-go-v2/service/iam v1.33.1/go.mod h1:sX/naR5tYtlGFN0Bjg9VPNgYNg/rqiDUuKTW9peFnZk= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.4 h1:KypMCbLPPHEmf9DgMGw51jMj77VfGPAN2Kv4cfhlfgI= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.4/go.mod h1:Vz1JQXliGcQktFTN/LN6uGppAIRoLBR2bMvIMP0gOjc= github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.0 h1:UiSyK6ent6OKpkMJN3+k5HZ4sk4UfchEaaW5wv7SblQ= @@ -527,23 +529,23 @@ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.18 h1:tJ5RnkHC github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.18/go.mod h1:++NHzT+nAF7ZPrHPsA+ENvsXkOO8wEu+C6RXltAG4/c= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.0 h1:l5puwOHr7IxECuPMIuZG7UKOzAnF24v6t4l+Z5Moay4= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.0/go.mod h1:Oov79flWa/n7Ni+lQC3z+VM7PoRM47omRqbJU9B5Y7E= -github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi v1.21.5 h1:GR0vFRc5TpN36ppQJjd+gjRRC9vMAHN5C2W53oMWCJU= -github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi v1.21.5/go.mod h1:FWw+Jnx+SlpsrU/NQ/f7f+1RdixTApZiU2o9FOubiDQ= +github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi v1.22.1 h1:73im9DnuBD4+G8hHsbqb0NSA+n6QJ5ApFk6/YeOz8k8= +github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi v1.22.1/go.mod h1:p5FuKT8Rj4fnlT84Pzy7itV11NZ39Fwm/Y52S8Lg1Oc= github.com/aws/aws-sdk-go-v2/service/s3 v1.49.0 h1:VfU15izXQjz4m9y1DkbY79iylIiuPwWtrram4cSpWEI= github.com/aws/aws-sdk-go-v2/service/s3 v1.49.0/go.mod h1:1o/W6JFUuREj2ExoQ21vHJgO7wakvjhol91M9eknFgs= github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.27.0 h1:64jRTsqBcIqlA4N7ZFYy+ysGPE7Rz/nJgU2fwv2cymk= github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.27.0/go.mod h1:JsJDZFHwLGZu6dxhV9EV1gJrMnCeE4GEXubSZA59xdA= github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.31.4 h1:YEY+Y4Lf3TuFrw8keb8NZ5nsbo/YplxEgZWbqnDlq+Y= github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.31.4/go.mod h1:5autx6GwAtQVv8S/qTwBKfxzAAwe8hOlzVuTtLdliVw= -github.com/aws/aws-sdk-go-v2/service/shield v1.25.5 h1:4fTqvsBpHhPA9ngalsvdLPRir22WQNhFDFmeGSKchQQ= -github.com/aws/aws-sdk-go-v2/service/shield v1.25.5/go.mod h1:KizNr+ORjXFVELwvx3ubt49LMeTeBXm9EbhUcDXvHa8= +github.com/aws/aws-sdk-go-v2/service/shield v1.26.1 h1:vlqoPRFrhs/djRKnrPNJvzzVLIsMWITGgP4gHIzprSU= +github.com/aws/aws-sdk-go-v2/service/shield v1.26.1/go.mod h1:1aUTOI7FTFp3ng7NH3C0UqDkbofoLb7NLcd/ufvlHdY= github.com/aws/aws-sdk-go-v2/service/sso v1.4.2/go.mod h1:NBvT9R1MEF+Ud6ApJKM0G+IkPchKS7p7c2YPKwHmBOk= github.com/aws/aws-sdk-go-v2/service/sso v1.22.5 h1:zCsFCKvbj25i7p1u94imVoO447I/sFv8qq+lGJhRN0c= github.com/aws/aws-sdk-go-v2/service/sso v1.22.5/go.mod h1:ZeDX1SnKsVlejeuz41GiajjZpRSWR7/42q/EyA/QEiM= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.5 h1:SKvPgvdvmiTWoi0GAJ7AsJfOz3ngVkD/ERbs5pUnHNI= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.5/go.mod h1:20sz31hv/WsPa3HhU3hfrIet2kxM4Pe0r20eBZ20Tac= -github.com/aws/aws-sdk-go-v2/service/storagegateway v1.27.5 h1:5t0w6FzW65K9nX+7YEKPLvsuOSOMl9HkJ01rG5VXsmQ= -github.com/aws/aws-sdk-go-v2/service/storagegateway v1.27.5/go.mod h1:gCrKxQ0omX8dIo7jQbXW5typwg8Z4rdVXYndHVoJ4XM= +github.com/aws/aws-sdk-go-v2/service/storagegateway v1.30.1 h1:/teUr5AA4/AUaw8A1wF6wcki4oc//lxonloUq1bl1VU= +github.com/aws/aws-sdk-go-v2/service/storagegateway v1.30.1/go.mod h1:LigoGatDhnWionzCxyHIQ96cQhwmLgTEkQDOzZg1Q3E= github.com/aws/aws-sdk-go-v2/service/sts v1.7.2/go.mod h1:8EzeIqfWt2wWT4rJVu3f21TfrhJ8AEMzVybRNSb/b4g= github.com/aws/aws-sdk-go-v2/service/sts v1.30.4 h1:iAckBT2OeEK/kBDyN/jDtpEExhjeeA/Im2q4X0rJZT8= github.com/aws/aws-sdk-go-v2/service/sts v1.30.4/go.mod h1:vmSqFK+BVIwVpDAGZB3CoCXHzurt4qBE8lf+I/kRTh0= @@ -1849,8 +1851,8 @@ github.com/ncabatoff/go-seq v0.0.0-20180805175032-b08ef85ed833 h1:t4WWQ9I797y7QU github.com/ncabatoff/go-seq v0.0.0-20180805175032-b08ef85ed833/go.mod h1:0CznHmXSjMEqs5Tezj/w2emQoM41wzYM9KpDKUHPYag= github.com/ncabatoff/process-exporter v0.7.10 h1:+Ere7+3se6QqP54gg7aBRagWcL8bq3u5zNi/GRSWeKQ= github.com/ncabatoff/process-exporter v0.7.10/go.mod h1:DHZRZjqxw9LCOpLlX0DjBuyn6d5plh41Jv6Tmttj7Ek= -github.com/nerdswords/yet-another-cloudwatch-exporter v0.60.0 h1:+027WNpx6sqn1kuhl4fPPz65TaF7kzG9ymAOJlasZjg= -github.com/nerdswords/yet-another-cloudwatch-exporter v0.60.0/go.mod h1:EXA9yqANHYmkbpe9a41X7iFJbK8/WNhp+Ph/+5DvZo4= +github.com/nerdswords/yet-another-cloudwatch-exporter v0.61.0 h1:aZIz1Dh+dXoesIvv56uReOpvDE21RvRgADhyTgEdNXw= +github.com/nerdswords/yet-another-cloudwatch-exporter v0.61.0/go.mod h1:n/wLEzpw3i44nWQ5UydQBEvPMxeKd2kYqfGt1GFcuKk= github.com/newrelic/newrelic-telemetry-sdk-go v0.2.0/go.mod h1:G9MqE/cHGv3Hx3qpYhfuyFUsGx2DpVcGi1iJIqTg+JQ= github.com/nicolai86/scaleway-sdk v1.10.2-0.20180628010248-798f60e20bb2 h1:BQ1HW7hr4IVovMwWg0E0PYcyW8CzqDcVmaew9cujU4s= github.com/nicolai86/scaleway-sdk v1.10.2-0.20180628010248-798f60e20bb2/go.mod h1:TLb2Sg7HQcgGdloNxkrmtgDNR9uVYF3lfdFIN4Ro6Sk= From 9cb1e62d6f63d01f353abdfc0b1c124b9bbe3fc2 Mon Sep 17 00:00:00 2001 From: Maurice Meyer Date: Mon, 16 Sep 2024 13:32:23 +0200 Subject: [PATCH 2/3] fixup! chore: bump yet-another-cloudwatch-exporter to v0.61.0 JobLevelMetricFields has been removed with https://github.com/nerdswords/yet-another-cloudwatch-exporter/pull/1412 --- .../cloudwatch_exporter/config_test.go | 32 ------------------- 1 file changed, 32 deletions(-) diff --git a/internal/static/integrations/cloudwatch_exporter/config_test.go b/internal/static/integrations/cloudwatch_exporter/config_test.go index f91798c446..dce3369d3b 100644 --- a/internal/static/integrations/cloudwatch_exporter/config_test.go +++ b/internal/static/integrations/cloudwatch_exporter/config_test.go @@ -219,14 +219,6 @@ var expectedConfig = model.JobsConfig{ Regexp: regexp.MustCompile("instance/(?P[^/]+)"), DimensionsNames: []string{"InstanceId"}, }}, - JobLevelMetricFields: model.JobLevelMetricFields{ - Statistics: []string(nil), - Period: 0, - Length: 0, - Delay: 0, - NilToZero: &truePtr, - AddCloudwatchTimestamp: &falsePtr, - }, }, { Regions: []string{"us-east-2"}, Type: "AWS/S3", @@ -253,14 +245,6 @@ var expectedConfig = model.JobsConfig{ Regexp: regexp.MustCompile("(?P[^:]+)$"), DimensionsNames: []string{"BucketName"}, }}, - JobLevelMetricFields: model.JobLevelMetricFields{ - Statistics: []string(nil), - Period: 0, - Length: 0, - Delay: 0, - NilToZero: &truePtr, - AddCloudwatchTimestamp: &falsePtr, - }, }}, StaticJobs: []model.StaticJob{{ Name: "custom_tesis_metrics", @@ -314,14 +298,6 @@ var expectedConfig3 = model.JobsConfig{ Regexp: regexp.MustCompile("instance/(?P[^/]+)"), DimensionsNames: []string{"InstanceId"}, }}, - JobLevelMetricFields: model.JobLevelMetricFields{ - Statistics: []string(nil), - Period: 0, - Length: 0, - Delay: 0, - NilToZero: &falsePtr, - AddCloudwatchTimestamp: &falsePtr, - }, }, { Regions: []string{"us-east-2"}, @@ -350,14 +326,6 @@ var expectedConfig3 = model.JobsConfig{ Regexp: regexp.MustCompile("(?P[^:]+)$"), DimensionsNames: []string{"BucketName"}, }}, - JobLevelMetricFields: model.JobLevelMetricFields{ - Statistics: []string(nil), - Period: 0, - Length: 0, - Delay: 0, - NilToZero: &truePtr, - AddCloudwatchTimestamp: &falsePtr, - }, }, }, StaticJobs: []model.StaticJob{{ From 44371ec1bcf2e1e606f3504dc6ab75308c106569 Mon Sep 17 00:00:00 2001 From: Maurice Meyer Date: Mon, 16 Sep 2024 14:33:48 +0200 Subject: [PATCH 3/3] fixup! chore: bump yet-another-cloudwatch-exporter to v0.61.0 --- .../prometheus/exporter/cloudwatch/config.go | 18 -------- .../exporter/cloudwatch/config_test.go | 42 ------------------- .../cloudwatch_exporter/config.go | 10 ----- 3 files changed, 70 deletions(-) diff --git a/internal/component/prometheus/exporter/cloudwatch/config.go b/internal/component/prometheus/exporter/cloudwatch/config.go index c1032e91d6..a4259218d1 100644 --- a/internal/component/prometheus/exporter/cloudwatch/config.go +++ b/internal/component/prometheus/exporter/cloudwatch/config.go @@ -318,15 +318,6 @@ func toYACEDiscoveryJob(rj DiscoveryJob) *yaceConf.Job { // By setting RoundingPeriod to nil, the exporter will align the start and end times for retrieving CloudWatch // metrics, with the smallest period in the retrieved batch. RoundingPeriod: nil, - JobLevelMetricFields: yaceConf.JobLevelMetricFields{ - // Set to zero job-wide scraping time settings. This should be configured at the metric level to make the data - // being fetched more explicit. - Period: 0, - Length: 0, - Delay: 0, - NilToZero: nilToZero, - AddCloudwatchTimestamp: &addCloudwatchTimestamp, - }, Metrics: toYACEMetrics(rj.Metrics, nilToZero), } return job @@ -348,15 +339,6 @@ func toYACECustomNamespaceJob(cn CustomNamespaceJob) *yaceConf.CustomNamespace { // metrics, with the smallest period in the retrieved batch. RoundingPeriod: nil, RecentlyActiveOnly: cn.RecentlyActiveOnly, - JobLevelMetricFields: yaceConf.JobLevelMetricFields{ - // Set to zero job-wide scraping time settings. This should be configured at the metric level to make the data - // being fetched more explicit. - Period: 0, - Length: 0, - Delay: 0, - NilToZero: nilToZero, - AddCloudwatchTimestamp: &addCloudwatchTimestamp, - }, Metrics: toYACEMetrics(cn.Metrics, nilToZero), } } diff --git a/internal/component/prometheus/exporter/cloudwatch/config_test.go b/internal/component/prometheus/exporter/cloudwatch/config_test.go index c807b40dce..ed381d8775 100644 --- a/internal/component/prometheus/exporter/cloudwatch/config_test.go +++ b/internal/component/prometheus/exporter/cloudwatch/config_test.go @@ -308,13 +308,6 @@ func TestCloudwatchComponentConfig(t *testing.T) { }, }, RoundingPeriod: nil, - JobLevelMetricFields: yaceModel.JobLevelMetricFields{ - Period: 0, - Length: 0, - Delay: 0, - AddCloudwatchTimestamp: &falsePtr, - NilToZero: &defaultNilToZero, - }, ExportedTagsOnMetrics: []string{"name"}, DimensionsRegexps: []yaceModel.DimensionsRegexp{ { @@ -343,13 +336,6 @@ func TestCloudwatchComponentConfig(t *testing.T) { }, }, RoundingPeriod: nil, - JobLevelMetricFields: yaceModel.JobLevelMetricFields{ - Period: 0, - Length: 0, - Delay: 0, - AddCloudwatchTimestamp: &falsePtr, - NilToZero: &defaultNilToZero, - }, ExportedTagsOnMetrics: []string{}, DimensionsRegexps: []yaceModel.DimensionsRegexp{ { @@ -383,13 +369,6 @@ func TestCloudwatchComponentConfig(t *testing.T) { }, }, RoundingPeriod: nil, - JobLevelMetricFields: yaceModel.JobLevelMetricFields{ - Period: 0, - Length: 0, - Delay: 0, - AddCloudwatchTimestamp: &falsePtr, - NilToZero: &defaultNilToZero, - }, ExportedTagsOnMetrics: []string{}, DimensionsRegexps: []yaceModel.DimensionsRegexp{ { @@ -435,13 +414,6 @@ func TestCloudwatchComponentConfig(t *testing.T) { }, }, RoundingPeriod: nil, - JobLevelMetricFields: yaceModel.JobLevelMetricFields{ - Period: 0, - Length: 0, - Delay: 0, - AddCloudwatchTimestamp: &falsePtr, - NilToZero: &defaultNilToZero, - }, }, }, }, @@ -546,13 +518,6 @@ func TestCloudwatchComponentConfig(t *testing.T) { }, }, RoundingPeriod: nil, - JobLevelMetricFields: yaceModel.JobLevelMetricFields{ - Period: 0, - Length: 0, - Delay: 0, - AddCloudwatchTimestamp: &falsePtr, - NilToZero: &falsePtr, - }, ExportedTagsOnMetrics: []string{"name"}, DimensionsRegexps: []yaceModel.DimensionsRegexp{ { @@ -598,13 +563,6 @@ func TestCloudwatchComponentConfig(t *testing.T) { }, }, RoundingPeriod: nil, - JobLevelMetricFields: yaceModel.JobLevelMetricFields{ - Period: 0, - Length: 0, - Delay: 0, - AddCloudwatchTimestamp: &falsePtr, - NilToZero: &falsePtr, - }, }, }, }, diff --git a/internal/static/integrations/cloudwatch_exporter/config.go b/internal/static/integrations/cloudwatch_exporter/config.go index 7756bc72b2..9dcd2fd154 100644 --- a/internal/static/integrations/cloudwatch_exporter/config.go +++ b/internal/static/integrations/cloudwatch_exporter/config.go @@ -297,16 +297,6 @@ func toYACEDiscoveryJob(job *DiscoveryJob) *yaceConf.Job { // By setting RoundingPeriod to nil, the exporter will align the start and end times for retrieving CloudWatch // metrics, with the smallest period in the retrieved batch. RoundingPeriod: nil, - - JobLevelMetricFields: yaceConf.JobLevelMetricFields{ - // Set to zero job-wide scraping time settings. This should be configured at the metric level to make the data - // being fetched more explicit. - Period: 0, - Length: 0, - Delay: 0, - NilToZero: nilToZero, - AddCloudwatchTimestamp: &addCloudwatchTimestamp, - }, } return &yaceJob }